raw=input("请输入密码:")
import hashlib
str =raw
h1 = hashlib.md5()
h1.update(str.encode(encoding='utf-8'))
from secrets import token_bytes
from typing import Tuple
def random_key(length:int) -> int:
key:bytes = token_bytes(nbytes=length)
key_int:int = int.from_bytes(key, 'big')
return key_int
def encrypt(raw:str) -> Tuple[int, int]:
raw_bytes:bytes = raw.encode()
raw_int:int = int.from_bytes(raw_bytes, 'big')
key_int:int = random_key(len(raw_bytes))
return raw_int ^ key_int, key_int
encrypted=encrypt(raw)
print("加密后的密码为")
print(encrypted)