Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Python 2.7] Programming a simple MD5 Hasher in Python

Newbie Spellweaver
Joined
Jul 8, 2015
Messages
7
Reaction score
1
Hello today i will teach you how to code a Md5 hasher with 3 line on Python.
If i make this tutorial it's only for explain to people how and why Md5 is important, on google you have plenty of tools to encrypt your password with a few clicks.
So first let's have a FAQ before the tutorial.

What is MD5 Hash ?

Why use MD5 Hash ?
  • It can not be hacked, it was broken but with difficulty by experts.
  • It is secured (i think :eek:).
  • For passwords in Mysql database.

How to decrypt MD5 Hashed password ?
  • Not possible, but really ? So on the web you have a lot of tools that can help you decrypt MD5 codes but not all so be careful!
  • It is one-way, you can't code a Md5 Decrypter it doesn't exist.*

So let's start.
You will need for first :
  • Your brain & your hands.
  • Python 2.5 and > 2.7 > 3.
  • and internet.

Go to
and install passlib.

Open your Python IDLE.
and import haslib.
Code:
import [COLOR=#ff0000]hashlib[/COLOR]
now for yo be able to type your password to encrypt:
Code:
hash_key = [COLOR=#ff0000]raw_input[/COLOR]( "Type here your MD5 Password : " )
and now we asked to display the word encrypted md5 hash :
Code:
print [COLOR=#ff0000]hashlib.md5[/COLOR]( hash_key ).hexdigest()

We have finished !

Full code :
Code:
import hashlib
hash_key = raw_input( "Type here your MD5 Password : " )
print hashlib.md5( hash_key ).hexdigest()

Thank you all, it's my first tutorial so be nice :D !
 
Newbie Spellweaver
Joined
Jun 10, 2013
Messages
94
Reaction score
21
You dont use a cryptographic hash to store passwords. You use a password hash instead

A quick example would be

Code:
import hashlib, uuid
salt = uuid.uuid4().hex
hashed_password = hashlib.sha512(password + salt).hexdigest()

But yeah for 100 users website. even plain will do the trick..
 
Newbie Spellweaver
Joined
Jul 8, 2015
Messages
7
Reaction score
1
Hi,

MD5 is not totally secured i already said it in the tutorial.
But for decrypt it is very hard and need to be a pro, a decrypt tool don't exist.
With Hashlib library you have a lot of modular - sha1(), sha224(), sha256(), sha384(), and sha512()...



@Raggaer - Yes, you are right but this is a very simple tutorial for a VERY simple MD5 Hasher, after u can improve the code for make it more secure.
for use sha224 type "hashlib.sha224".
 
Last edited:
Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
130
@Silio When you say that there is no decrypt tool available for MD5 Hash, have you checked with websites online? Or are you just talking about a stand alone program that will decrypt MD5 Hash? Just a small example:
 
Newbie Spellweaver
Joined
Jul 8, 2015
Messages
7
Reaction score
1
@jbeitz107 Look at the tutorial i have already spoken about it.
And their tool don't DECRYPT or CRACK a Md5 Hash, they just have in their database a lot of md5 hash paswords so they juste look if your password is the same as they have in their database.
Try it with a real powerfull password their tool can not decrypt ALL md5 passwords.
 
Elite Diviner
Joined
Apr 7, 2008
Messages
494
Reaction score
66
sorry for the bump was this your first programming language, yeah python is quite cool :) and easy to gasp.
 
Back
Top