Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def ascii_to_hex(string_in):
- a=""
- for c in string_in:
- a = a + ("0" + ((hex(ord(c)))[2:]))[-2:]
- return(a)
- def hex_to_dec(hex_in):
- a = ""
- a = int(hex_in, 16)
- return(a)
- def dec_to_hex(dec_in):
- a = ""
- a = hex(dec_in)[2:]
- return(a)
- def hash_algorithm(URL, Username, salt):
- URL_hex, Username_hex, salt_hex = ascii_to_hex(URL), ascii_to_hex(Username), ascii_to_hex(salt)
- URL_dec, Username_dec, salt_dec = hex_to_dec(URL_hex), hex_to_dec(Username_hex), hex_to_dec(salt_hex)
- Password_dec = (URL_dec * Username_dec) * salt_dec
- Password_hex = dec_to_hex(Password_dec)
- Password = Password_hex[-12:]
- copy_to_clipboard(Password)
- return(Password)
- def copy_to_clipboard(to_copy):
- import win32clipboard
- win32clipboard.OpenClipboard()
- win32clipboard.EmptyClipboard()
- win32clipboard.SetClipboardText(to_copy)
- win32clipboard.CloseClipboard()
- def program():
- a = input("Web URL: ")
- b = input("Username: ")
- c = input("Unique Salt: ")
- password = hash_algorithm(a, b, c)
- print("The password has been copied to your clipboard.")
Add Comment
Please, Sign In to add comment