Password Hashing Project
Thu Mar 14 2024 03:54:14 GMT+0000 (Coordinated Universal Time)
Saved by
@aniket_chavan
def start():
print()
print('********************************')
print("Student Name - Aniket")
print("Title - Micro Project")
print("Project Name - Password Hashing")
print("Language - Python")
print('********************************')
print()
class Hash:
def __init__(self, secret_key):
self.secret_key = secret_key
def hash(self, password):
hashed_password = ""
for char in password:
hashed_password += chr(ord(char) + self.secret_key)
return hashed_password
def decrypt(self, hashed_password):
decrypted_password = ""
for char in hashed_password:
decrypted_password += chr(ord(char) - self.secret_key)
return decrypted_password
start()
while True:
obj = Hash(1)
print("----------------------------------")
password = input("Enter Your Password : ")
print("----------------------------------")
print("Your entered Password : ", password)
print("----------------------------------")
hashed_password = obj.hash(password)
print("Your Hashed password:", hashed_password)
print("----------------------------------")
decrypted_password = obj.decrypt(hashed_password)
print("Your Decrypted password:", decrypted_password)
print("----------------------------------")
ans = input("Do You want to Continue (Y/N) :")
if ans.lower() != 'y':
print('.....Thank You.....')
break
content_copyCOPY
Comments