Update SafeComparisonOfHash.py

This commit is contained in:
Ahmed Farid
2022-08-04 12:27:35 +01:00
committed by GitHub
parent 1fed6074e9
commit 9c0a71d880

View File

@@ -11,7 +11,7 @@ key = "e179017a-62b0-4996-8a38-e91aa9f1"
msg = "Test"
def sign(pre_key, imsg, alg):
return hmac.new(pre_key, msg, alg).digest()
return hmac.new(pre_key, imsg, alg).digest()
def verify(msg, sig):
return hmac.compare_digest(sig, sign(key, msg, hashlib.sha256)) #good