У меня есть игра (Rock Paper Scissors).Как зашифровать ответ компьютера с помощью HMAC (SHA-2 или SHA-3) и в конце игры сравнить с ответом пользователя?
import random
import hmac
import hashlib
import base64
options = {"r": "rock", "p": "paper", "s": "scissors"}
while True:
user = input('Choose r for rock, p for paper, s for scissors or q to quit: ')
user = user.lower()
if user == 'q':
break
if user not in options.keys():
continue
choice = random.choice(list(options.keys()))
print('Computer picked:', options[choice])
if choice == user:
print('You tie against the computer\n')
elif (user, choice) in (("r", "s"), ("p", "r"), ("s", "p")):
print('You win against the computer\n')
else:
print('You lose against the computer\n')