fork(1) download
  1. from hashlib import sha256
  2. import string
  3.  
  4. secret_hash = "2f05d4b689d270cafb02285f35f44866f7dc8a2d368a3f9d1124373eeab31fb1"
  5.  
  6. def pass_generator(max_length, charset):
  7. for i in range(len(charset)**max_length):
  8. yield get_pass(i, charset)
  9.  
  10. def get_pass(num, charset):
  11. password = ""
  12. while num > len(charset) - 1:
  13. num, index = divmod(num, len(charset))
  14. password += charset[index]
  15. password += charset[num]
  16. return password
  17.  
  18. for password in pass_generator(4, string.ascii_lowercase):
  19. if sha256(password.encode()).hexdigest() == secret_hash:
  20. print(password)
Success #stdin #stdout 1.36s 11480KB
stdin
Standard input is empty
stdout
bad