Guest User

Untitled

a guest
May 19th, 2018
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. def ascii_to_hex(string_in):
  2. a=""
  3. for c in string_in:
  4. a = a + ("0" + ((hex(ord(c)))[2:]))[-2:]
  5. return(a)
  6.  
  7. def hex_to_dec(hex_in):
  8. a = ""
  9. a = int(hex_in, 16)
  10. return(a)
  11.  
  12. def dec_to_hex(dec_in):
  13. a = ""
  14. a = hex(dec_in)[2:]
  15. return(a)
  16.  
  17. def hash_algorithm(URL, Username, salt):
  18. URL_hex, Username_hex, salt_hex = ascii_to_hex(URL), ascii_to_hex(Username), ascii_to_hex(salt)
  19. URL_dec, Username_dec, salt_dec = hex_to_dec(URL_hex), hex_to_dec(Username_hex), hex_to_dec(salt_hex)
  20. Password_dec = (URL_dec * Username_dec) * salt_dec
  21. Password_hex = dec_to_hex(Password_dec)
  22. Password = Password_hex[-12:]
  23. copy_to_clipboard(Password)
  24. return(Password)
  25.  
  26. def copy_to_clipboard(to_copy):
  27. import win32clipboard
  28. win32clipboard.OpenClipboard()
  29. win32clipboard.EmptyClipboard()
  30. win32clipboard.SetClipboardText(to_copy)
  31. win32clipboard.CloseClipboard()
  32.  
  33. def program():
  34. a = input("Web URL: ")
  35. b = input("Username: ")
  36. c = input("Unique Salt: ")
  37. password = hash_algorithm(a, b, c)
  38. print("The password has been copied to your clipboard.")
Add Comment
Please, Sign In to add comment