diff --git a/Cargo.toml b/Cargo.toml index 9ed1455..d1100d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,14 +3,14 @@ name = "totp-rfc" version = "0.1.1" edition = "2021" rust-version = "1.85" -description = "Strict no_std HOTP and TOTP with constant-time code comparison, implementing RFC 4226 and RFC 6238" +description = "Security-hardened, allocation-free no_std HOTP and TOTP for Rust with strict RFC 4226/6238 behavior" documentation = "https://docs.rs/totp-rfc" homepage = "https://github.com/copyleftdev/totp-rfc" repository = "https://github.com/copyleftdev/totp-rfc" license = "MIT" readme = "README.md" publish = ["crates-io"] -keywords = ["totp", "hotp", "2fa", "authentication", "no-std"] +keywords = ["totp", "hotp", "2fa", "no-std", "constant-time"] categories = ["authentication", "cryptography", "no-std"] exclude = ["/mutants.out/", "/mutants.out.old/", "/tools/"] diff --git a/README.md b/README.md index f9f279f..e863402 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,16 @@ [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE.md) [![Core-only](https://img.shields.io/badge/no__std-supported-success.svg)](#no_std) -Strict, `no_std` HOTP and TOTP with constant-time code comparison for Rust. +Security-hardened, allocation-free, `no_std` HOTP and TOTP primitives for +Rust. -`totp-rfc` implements the HMAC-based one-time password algorithm from +`totp-rfc` is a compact Rust authentication library implementing the HMAC-based +one-time password algorithm from [RFC 4226](https://www.rfc-editor.org/rfc/rfc4226) and the time-based one-time password algorithm from [RFC 6238](https://www.rfc-editor.org/rfc/rfc6238). -It is designed for security-sensitive 2FA and MFA systems that need a small, -auditable, `no_std` foundation instead of provisioning, QR-code, or storage -abstractions. +It is designed for embedded, server, and security-sensitive 2FA and MFA systems +that need a small, auditable verification core instead of provisioning, +QR-code, or storage abstractions. ## Why totp-rfc? @@ -23,7 +25,8 @@ abstractions. - Six-, seven-, and eight-digit decimal one-time passwords - Mandatory 128-bit minimum secret length - Strict ASCII input parsing with preserved leading zeroes -- Constant-time comparison for well-formed authentication codes +- Constant-address dynamic truncation across every RFC-defined digest offset +- Constant-time comparison and first-match selection for well-formed codes - Checked 64-bit counters and timestamps beyond the year 2038 - Bounded HOTP resynchronization and TOTP clock-drift windows - Borrowed secrets and zeroized transient HMAC/hash state @@ -32,6 +35,18 @@ abstractions. The [RFC compliance matrix](docs/compliance.md) maps each protocol requirement to its implementation and test evidence. +## Deliberately a primitive layer + +Choose `totp-rfc` when the trusted OTP core should remain compact, portable, +allocation-free, and independently testable. It exposes explicit timestamps, +counters, validation windows, drift, and next-counter state so the surrounding +authentication service can enforce its own replay and throttling policy. + +Base32, `otpauth://` provisioning, QR generation, random-secret generation, +database access, and system-clock policy remain outside the crate. Applications +that want an all-in-one enrollment toolkit can compose those concerns above +`totp-rfc` without adding them to the cryptographic verification boundary. + ## Installation Add the crate with Cargo: diff --git a/docs/repository-metadata.md b/docs/repository-metadata.md index abd1a76..d82c9b9 100644 --- a/docs/repository-metadata.md +++ b/docs/repository-metadata.md @@ -4,7 +4,7 @@ Canonical repository: `copyleftdev/totp-rfc` ## About description -> Strict no_std HOTP and TOTP for Rust with constant-time code comparison, implementing RFC 4226 and RFC 6238 for secure 2FA and MFA systems. +> Security-hardened, allocation-free no_std HOTP/TOTP for Rust with strict RFC 4226/6238 behavior and constant-time verification. ## Website @@ -30,6 +30,8 @@ Canonical repository: `copyleftdev/totp-rfc` - `no-std` - `embedded` - `rustcrypto` +- `constant-time` +- `security` ## CI badge