Made a secure API key library for my project… now I need Reddit to tell me what I did wrong.
github.com·1d·
Discuss: r/rust
🦀Rust
Preview
Report Post

API Keys Simplified

A secure Rust library for generating and validating API keys with built-in security best practices.

Features

  • Cryptographically secure key generation (192-bit entropy)
  • Argon2id hashing (memory-hard, OWASP recommended)
  • BLAKE3 checksums (2900x faster DoS protection)
  • Constant-time verification (prevents timing attacks)
  • Automatic memory zeroing (protects sensitive data)
  • Key expiration (time-based access control)
  • Key revocation (instant access denial via stored hash)

Quick Example

use api_keys_simplified::{ApiKeyManager, Environment, KeyConfig, HashConfig};

// Generate with checksum (enabled by default - 2900x faster DoS protection)
let manager = ApiKeyManager::init_default_config("myapp_sk")?;
let a...

Similar Posts

Loading similar posts...