One-time passwords (OTP): TOTP, HOTP, and delivered codes
Separate how an OTP is generated from how it is delivered, and understand the security limits and service-side controls for each type.
A one-time password (OTP) is a short value issued or calculated for one authentication. It is not one specific algorithm. TOTP uses a shared secret and time; HOTP uses a shared secret and an increasing counter. SMS or voice codes are usually generated by the service and delivered over a telephone network. Email codes are also called OTPs in everyday usage, but NIST SP 800-63B-4 does not allow email as an out-of-band authentication channel. Email-address confirmation and account-recovery codes are separate from authentication.
Assess the generation algorithm separately from the delivery channel. OTPs can be relayed in real-time phishing and are not phishing-resistant. Verifiers should collect them over an authenticated protected channel, accept a successful code only once while valid, and limit guessing of short codes. Protect TOTP/HOTP secrets and prepare alternate authenticators and recovery for lost phones or apps. RFC 4226 (HOTP) and RFC 6238 (TOTP) are Informational documents, not Internet Standards Track specifications.
At enrollment, a TOTP app and verifier share a secret and calculate the same code from the current time interval. RFC 6238 defaults to 30 seconds, though service settings may differ. HOTP advances a counter whenever a code is generated, so unused codes can desynchronize a token; keep resynchronization windows limited. Hypothetical example: a server accepts an app code once, while an SMS flow creates a code and sends it over the phone network. Neither delivery method makes the code phishing-resistant.
References
[RFC 4226: HOTP](https://www.rfc-editor.org/rfc/rfc4226.html)
[RFC 6238: TOTP](https://www.rfc-editor.org/rfc/rfc6238.html)
[NIST SP 800-63B-4: Authenticator requirements](https://pages.nist.gov/800-63-4/sp800-63b/authenticators/)