Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#9417·logto

feature request: Support Argon2id with Configurable Parameters for Password Hashing

Author: sunshang-hlCreated Aug 11, 2026Updated Sep 30, 2026
Labelsstale

What problem did you meet?

Logto currently uses Argon2i as the sole password hashing algorithm (UsersPasswordEncryptionMethod.Argon2i). While Argon2i provides resistance against side-channel/timing attacks, Argon2id is the recommended variant for password hashing by industry standards including OWASP Password Storage Cheat Sheet and RFC 9106.

Argon2id combines the strengths of both variants:

  • Uses Argon2i for the first pass (resisting side-channel attacks)
  • Uses Argon2d for subsequent passes (resisting GPU-based brute-force attacks)

Additionally, the current implementation uses hardcoded parameters (m=8192, t=8) without providing administrators the ability to tune them based on their hardware capabilities and security requirements. This means:

  • Deployments on high-security environments cannot increase the memory/time cost for stronger protection
  • Deployments on resource-constrained environments cannot reduce parameters to fit their hardware
  • Administrators have no flexibility to follow evolving security best practices as hardware and attack techniques change over time

Although the database schema's password_encryption_method enum already includes Argon2id as a possible value, the actual encryption logic only supports Argon2i and rejects other methods.

Describe what you'd like Logto to have

  1. Add support for Argon2id as a first-class password encryption method alongside the existing Argon2i support, allowing administrators to choose which algorithm to use for new password hashes.

  2. Make the following Argon2 parameters configurable via environment variables or Logto configuration:

    • Memory cost (m): Memory size in KiB
    • Time cost (t): Number of iterations
    • Parallelism (p): Number of parallel threads/lanes
  3. Provide secure default values following industry best practices. Based on OWASP 2025 recommendations:

    Parameter OWASP Minimum (2025) Recommended Default
    Memory Cost (m) 19 MiB (19,456 KiB) 64 MiB (65,536 KiB)
    Time Cost (t) 2 iterations 3 iterations
    Parallelism (p) 1 Number of available CPU cores (capped at 4)

    For higher security environments, administrators could increase memory to 128 MiB or more.

  4. Maintain backward compatibility: Existing Argon2i hashes should continue to work for verification. New users and password changes can use either Argon2id (default) or Argon2i (configurable).


Additional context: The database schema already includes Argon2id in the password_encryption_method enum, suggesting this was anticipated. The current encryption function (encryptPassword) validates that only Argon2i is supported and rejects other methods. This change would extend that function to support Argon2id as well.

I have searched the existing issues and found no similar feature request regarding Argon2id or configurable Argon2 parameters.

Source: logto-io/logto

View original on GitHubView discussion on GitHub