Created
January 14, 2024 11:31
-
-
Save kianurivzzz/3d54f42b94a165b0408a4bb49530912d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import hashlib | |
| # Сохраняем пароль пользователя | |
| my_pwd = input('Введите пароль: ').encode() | |
| print(pwd) | |
| my_pwd_hash = hashlib.md5(my_pwd).hexdigest() | |
| print(hash_pwd) | |
| # Сравниваем хеши введёного пароля с паролем пользователя | |
| pwd = input('Введите пароль: ').encode() | |
| hash_pwd = hashlib.md5(pwd).hexdigest() | |
| if my_pwd_hash == hash_pwd: | |
| print('Поздравляем, вы взломали Пентагон!') | |
| else: | |
| print('Увы, до Пентагона ещё далеко.') | |
| print('Попробуйте что-нибудь попроще.') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment