| 54 | # ----------------------------- Paste this code into your program / script ----------------------------- |
| 55 | # determine if a password matches the secret password by comparing SHA1 hash codes |
| 56 | def PasswordMatches(password, a_hash): |
| 57 | password_utf = password.encode('utf-8') |
| 58 | sha1hash = hashlib.sha1() |
| 59 | sha1hash.update(password_utf) |
| 60 | password_hash = sha1hash.hexdigest() |
| 61 | return password_hash == a_hash |
| 62 | |
| 63 | login_password_hash = '6adfb183a4a2c94a2f92dab5ade762a47889a5a1' # helloworld |
| 64 | password = sg.popup_get_text( |