Skip to content

Commit 43ebebb

Browse files
authored
Create hashing.py
1 parent 5ca8fe0 commit 43ebebb

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Diff for: hashing.py

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import hashlib
2+
3+
password = input("Emter your password: \n->")
4+
passw = "password123"
5+
6+
hash_pass = hashlib.sha1(bytes(password,"ascii"))
7+
hex_pass = hash_pass.hexdigest()
8+
9+
print("Your hash",hex_pass)
10+
11+
hash_object = hashlib.sha1(bytes(passw,"ascii"))
12+
hex_dig = hash_object.hexdigest()
13+
14+
Fake_DB = [hex_dig]
15+
16+
if hex_pass in Fake_DB:
17+
print("Logged in ..........")
18+
else:
19+
print("Sorry Wrong password")
20+
print("Actual hash",hex_dig)

0 commit comments

Comments
 (0)