A tiny Elixir library for implementing TOTP-based two-factor authentication (2FA) in applications.
NimbleTOTP is an Elixir library that implements Time-based One-Time Password (TOTP) functionality for two-factor authentication (2FA) systems. It provides tools to generate secure secrets, create authentication URIs for QR codes, and verify time-based codes according to the TOTP standard. The library solves the problem of adding secure 2FA to Elixir applications with minimal code and dependencies.
Elixir developers building applications that require two-factor authentication, particularly those who need to implement TOTP-based 2FA for user accounts or administrative interfaces.
Developers choose NimbleTOTP because it provides a complete TOTP implementation in a tiny, focused package that follows Elixir conventions and integrates seamlessly with the ecosystem. Its minimal API and lack of dependencies make it easy to understand, use, and maintain compared to more complex authentication libraries.
A tiny Elixir library for time-based one time passwords (TOTP)
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Offers just three core functions (secret, otpauth_uri, valid?), making it straightforward to implement TOTP without bloat or complexity, as highlighted in the README.
Follows RFC 6238 for TOTP, ensuring generated codes and URIs are compatible with common authenticator apps like Google Authenticator, per the project description.
Uses cryptographically secure random bytes for secrets, adhering to security best practices as specified in the key features.
Simple installation via mix.exs and follows Elixir conventions, with no external dependencies, fitting seamlessly into Elixir projects.
Only provides otpauth URIs; developers must use separate libraries to generate actual QR code images, adding extra steps for setup.
Adheres strictly to TOTP defaults (e.g., SHA1, 30-second intervals) with no options for alternative hash algorithms or code lengths, which may not suit all use cases.
The README is concise and assumes familiarity with TOTP, lacking examples for real-world scenarios like user enrollment flows or error handling.