diff --git a/python/stdlib/timing_attack.py b/python/stdlib/timing_attack.py new file mode 100644 index 0000000..591e25e --- /dev/null +++ b/python/stdlib/timing_attack.py @@ -0,0 +1,14 @@ +import hmac + + +received_digest = ( + b"\xe2\x93\x08\x19T8\xdc\x80\xef\x87\x90m\x1f\x9d\xf7\xf2" + b"\xf5\x10>\xdbf\xa2\xaf\xf7x\xcdX\xdf" +) + +key = b"my-super-duper-special-secret-key" +password = b"pass" +digest = hmac.digest(key, password, digest="sha224") + +if digest == received_digest: + print("Authentication okay")