Skip to content

0.9.0 — 2025-02-20

← 0.10.0 | 0.8.0 → | ↑ 0.x series

Security

  • TOTP System: Comprehensive Time-based One-Time Password implementation:

    • Secure token generation and validation
    • Configurable time windows
    • Built-in expiration handling
    • RFC compliance
  • Multi-Factor Authentication: Enhanced security framework:

    • Multiple authentication factor support
    • Flexible factor configuration
    • Integration with existing auth systems

Usage Example

from archipy.helpers.utils.totp_utils import TOTPUtils
from uuid import uuid4

# Generate a TOTP code
user_id = uuid4()
totp_code, expires_at = TOTPUtils.generate_totp(user_id)

# Verify a TOTP code
is_valid = TOTPUtils.verify_totp(user_id, totp_code)

# Generate a secure key for TOTP initialization
secret_key = TOTPUtils.generate_secret_key_for_totp()