Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import hashlib
- def sha256(s):
- return hashlib.sha256(s.encode()).hexdigest()
- def main():
- h = input('Enter hashed password: ')
- s = 'a'
- while s != 'zzz':
- s = list(s)
- i = len(s)-1
- while i>=0 and s[i] == 'z':
- s[i] = 'a'
- i -= 1
- if i<0:
- s.insert(0,'a')
- else:
- s[i] = chr(ord(s[i])+1)
- s = ''.join(s)
- #print(s)
- if sha256(s) == h:
- print(f'The password is: {s}')
- return
- main()
Advertisement
Add Comment
Please, Sign In to add comment