def encrypt_old(pwd, key):
""" """
iv = os.urandom(16)
cipher = cipher(algorithms.AES(key), modes.CBC(iv), backend=default_backend())
encryptor = cipher.encryptor()
cipher_text = encryptor.update(bytes(pwd.encode('utf-8'))) + encryptor.finalize()
return cipher_text, iv
评论列表
文章目录