Skip to content

Simple, dependency-free Go library for HOTP/TOTP (RFC 4226/6238) — generate, verify, and integrate OTPs for 2FA.

Notifications You must be signed in to change notification settings

PillaiManish/authenticator-hmac-hotp-totp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hmac — Simple HOTP/TOTP generator and verifier for Go

A small, dependency-free Go library for generating and verifying one-time passwords (OTPs) using HMAC per RFC 4226 (HOTP) and RFC 6238 (TOTP). Ideal for integrating 2FA into CLIs, web services, or microservices.

  • HOTP: Counter-based one-time passwords
  • TOTP: Time-based one-time passwords
  • otpauth:// URI generator for use with authenticator apps

Project module: github.com/pillaimanish/hmac
Go version: 1.25

Features

  • Generate and verify HOTP (counter-based) OTPs
  • Generate and verify TOTP (time-based) OTPs
  • Build otpauth-compatible URIs to add accounts to Google Authenticator, 1Password, Authy, etc.
  • Small surface area and straightforward API

Install