Definition
One-Time Password Generator
A one-time password generator is a mechanism by which the user and the authentication server compute a password on the fly during the authentication process.
Cryptographic algorithms — hash functions or encryption schemes — are used to generate short-lived one-time passwords.
Properties
Time-Dependent
The value of the one-time password generally depends on the time at which it is generated.
Computation on User Side
On the user’s side, the password is computed on specialised hardware (hardware tokens) or by generator apps installed on a smartphone.
Implementations
Hash-Based
where is a hash function and is a user-specific secret.
Encryption-Based
where is a symmetric encryption scheme with key .
Secret Derivation
User-Specific Secret
Both user and server share the user-specific secret . To avoid storing a separate secret for every user, is typically generated by combining some user-specific information with a master key — for example, by hashing the concatenation of the username and the master key.
Validation
Server Verification
The server computes multiple candidate one-time passwords (for example, those generated in the last five minutes) and accepts the authentication if any of these matches the value provided by the user.