ssoni

crack.py

Dec 22nd, 2025
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import hashlib
  2.  
  3. def sha256(s):
  4.     return hashlib.sha256(s.encode()).hexdigest()
  5.  
  6. def main():
  7.     h = input('Enter hashed password: ')
  8.     s = 'a'
  9.    
  10.     while s != 'zzz':
  11.         s = list(s)
  12.         i = len(s)-1
  13.        
  14.         while i>=0 and s[i] == 'z':
  15.             s[i] = 'a'
  16.             i -= 1
  17.         if i<0:
  18.             s.insert(0,'a')
  19.         else:
  20.             s[i] = chr(ord(s[i])+1)
  21.        
  22.         s = ''.join(s)
  23.         #print(s)
  24.  
  25.         if sha256(s) == h:
  26.             print(f'The password is: {s}')
  27.             return
  28.  
  29. main()
Advertisement
Add Comment
Please, Sign In to add comment