Skip to content

Instantly share code, notes, and snippets.

@kianurivzzz
Created January 14, 2024 11:31
Show Gist options
  • Select an option

  • Save kianurivzzz/3d54f42b94a165b0408a4bb49530912d to your computer and use it in GitHub Desktop.

Select an option

Save kianurivzzz/3d54f42b94a165b0408a4bb49530912d to your computer and use it in GitHub Desktop.
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