PY
py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
"""
Hashing In Python!
This Is How Hackers Crack Passwords:
First They Hack The Database
And Sees A Table Where Usernames,E-Mails Are Stored
But Passwords Are Secured,
They're Hashed Password
Then Hackers Cracks The Password
Makes It A Plain Text
Ranbow Tables Are A Table Which Only Stores Two Values In A Row- Password Hashed And Password Plain Text
"""
print(__doc__)
import hashlib
#Use zlib for other hashing algirithms like alder32.
hashed = hashlib.md5(b"MyPassword").hexdigest()
#MD5 -------> ^ ^--- Unicode Object
#Printing all genarated algorithms in hashlib
print(hashlib.algorithms_guaranteed,"\n")
#Printing hashed password
print(hashed,"Is The Hashed Of MD5.\nString: {}".format("MyPassword"))
#Hashing Functions:
#encode(), digest(), hexdigest()
#The main way of hashing is hexdigest() but you can use digest()
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run