Ravi Sir's Cards › AWS
Why protect a stored OTP?
A database copy plus a plain hash lets someone guess from a small six-digit space. Use a keyed HMAC and keep its key separate from the table. Do not log the OTP. Check expiry and failed attempts. One conditional update marks the OTP used and removes the digest.
Read card text
What this card says
Risk
A database copy plus a plain hash lets someone guess from a small six-digit space.
Secret key
Use a keyed HMAC and keep its key separate from the table. Do not log the OTP.
One-time check
Check expiry and failed attempts. One conditional update marks the OTP used and removes the digest.