Advertisement
Guest User

Untitled

a guest
Apr 8th, 2020
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.88 KB | None | 0 0
  1. import hashlib
  2.  
  3. from datetime import datetime, timedelta
  4.  
  5. DATE_FORMAT = '%m/%d/%Y'  # Format of the birthdate password (mm/dd/YYYY)
  6. CORRECT_HASH = 'a9fdb86a833dff5245ab1ea74195b2e3'  # Input your hash string here
  7.  
  8.  
  9. def hash(s: str) -> str:
  10.     # Currently using the MD5 hash, be sure to use the same
  11.     # hashing algorithm
  12.     hash = hashlib.md5(s.encode())
  13.     return hash.hexdigest()
  14.  
  15.  
  16. def findDateHash():
  17.     date = datetime.today()
  18.  
  19.     for i in range(40_000):  # Check through the last 40,000 days
  20.         date -= timedelta(days=1)  # Go back 1 day
  21.         dateStr = date.strftime(DATE_FORMAT)
  22.  
  23.         # Check if the hashes are the same or not
  24.         if hash(dateStr) == CORRECT_HASH:
  25.             print(f'Found password: {dateStr}')
  26.             break
  27.  
  28.     else:
  29.         print('Could not find the password!')
  30.  
  31.  
  32. if __name__ == '__main__':
  33.     findDateHash()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement