# mdp/rotp

Ruby One Time Password library

Repository: https://github.com/mdp/rotp
Canonical: https://ross.abutalabs.com/products/rotp
Homepage: http://rubydoc.info/github/mdp/rotp/master/frames
Language: Ruby
License: MIT
License Family: permissive
Last push: 2025-11-24T21:17:25+00:00

## Health v2 (maintenance only)
Score: 47/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 53, release rhythm 8, longevity 100
- inputs: {"age_days": 5680, "days_push": 282, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1657, forks 481 (observed 2026-08-28T04:05:18.139270+00:00)

## What it is
A Ruby library for generating and validating one-time passwords (HOTP and TOTP) according to RFC 4226 and RFC 6238. It is compatible with Google Authenticator and other TOTP-based apps and is commonly used to add multi-factor authentication to web applications.

## Use cases
- add two-factor authentication to a ruby or rails app
- generate TOTP codes compatible with Google Authenticator
- verify HOTP one-time passwords per RFC 4226
- generate base32 secrets for user MFA enrollment
- implement time-based OTP login verification with drift tolerance

## When to choose
- you need standards-compliant HOTP/TOTP generation and verification in Ruby
- your users authenticate with authenticator apps like Google Authenticator
- you want a small, mature, MIT-licensed gem with minimal dependencies

## When to avoid
- you are building a new 2FA solution today and can use WebAuthn instead
- you need push-based or SMS-based multi-factor authentication
- you are not working in Ruby

## Facets
- artifact type: library
- maturity: maintenance
- function: auth, cryptography, security
- domain: security, developer-tools, web-development
- platform: ruby
- tags: otp, totp, hotp, two-factor-authentication, rfc4226, rfc6238, google-authenticator

## Member repositories
- mdp/rotp (main) score 47

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:18.139270+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T03:44:47.240455+00:00, confidence not recorded.
  - readme: https://github.com/mdp/rotp (fetched 2026-08-28T04:05:18.139270+00:00, sha e41b7aa26679)
- Data as of 2026-08-30T08:39:29.467469+00:00.
