2FA

Implementing TOTP in Go

Introduction In this article, I would like to try implementing a code that generates a one-time password, which is often used in many two-factor authentication functions, called Time-based One-time Password (TOTP), using Go. What is Two-Factor Authentication? Before writing the TOTP generation code, let’s briefly review what two-factor authentication is. There are mainly three types of factors for authentication: knowledge, possession, and biometrics. Knowledge: Something only the user knows or remembers, such as a login password.