xltdp/tests/kms/auth/simpleverify.py
2023-01-15 13:39:59 -07:00

12 lines
346 B
Python
Executable File

from simpleverify import SimpleVerify
# Usage example
kdf = SimpleVerify(b"password", b"salt", 100000, 32, hashes.SHA256)
key = kdf.derive_key()
password_to_check = b"password"
key_to_check = kdf.derive_key()
if kdf.verify_key(password_to_check, key_to_check):
print("The key is correct")
else:
print("The key is incorrect")