Argon2 Hash Generator

Free online Argon2 Hash Generator tool. 100% local processing — your data never leaves your device.

General
Password Hashing / KDF
Specialized
Deprecated
KiB
iterations

Verify: input format is "password|hash"

Output

Result will be displayed here...

Input Calculate Hash

Usage Guide

About Argon2

Argon2 is the winner of the 2015 Password Hashing Competition, designed by the University of Luxembourg. It's currently the most secure password hashing algorithm, recommended by authoritative organizations like OWASP and NIST for password storage. Argon2 has three variants: Argon2d (GPU-resistant), Argon2i (side-channel resistant), and Argon2id (hybrid mode, recommended). Unlike traditional hash algorithms, Argon2 has adjustable computational cost and memory consumption, effectively resisting brute-force, GPU, and ASIC attacks.

OWASP Recommended: Argon2id is the preferred algorithm in the OWASP Password Storage Cheat Sheet. It combines Argon2d's GPU resistance with Argon2i's side-channel attack resistance, providing the most comprehensive security protection. Recommended for all new projects' password storage.

Usage Steps

Argon2 supports two operations: password hashing and verification:

1. Select ModeChoose 'Encrypt' mode to hash passwords, or 'Decrypt' mode to verify passwords
2. Input PasswordFill in the password to be hashed or verified in the input box
3. Calculate HashClick 'Calculate Hash' button, Argon2 will automatically generate random salt and compute hash
4. Save ResultCopy the complete hash string (including algorithm parameters, salt, and hash) to store in database
5. Verify PasswordFor verification, input original password and complete hash string, system will automatically extract parameters and verify
Privacy Protection: All calculations are performed locally in your browser, data is never uploaded to servers, completely offline processing.

Algorithm Features

Argon2 is specifically designed for password storage with the following unique advantages:

Memory-HardRequires large memory (default 64MB), making GPU and ASIC attacks extremely costly
Adjustable CostCan adjust time cost (iterations), memory cost, and parallelism to meet different security needs
Side-Channel ResistantArgon2i and Argon2id resist cache-timing attacks and other side-channel attacks
Auto-SaltingBuilt-in random salt generation, no manual salt management needed
VersionedHash string includes algorithm version and parameters, facilitating future upgrades and migrations
Parameter Configuration: Argon2's security depends on parameter configuration. OWASP recommends: memory cost ≥ 47MB (m=47104), time cost ≥ 1 iteration (t=1), parallelism = 1 (p=1). If server performance allows, increase memory cost to 64MB or higher. Avoid using too low parameters, as it reduces security.

Three Variants Comparison

Argon2 has three variants suitable for different scenarios:

Argon2dData-dependent, most GPU/ASIC resistant, but vulnerable to side-channel attacks, suitable for cryptocurrency mining
Argon2iData-independent, side-channel resistant, but slightly weaker GPU resistance, suitable for password hashing
Argon2idHybrid mode (recommended), combines advantages of both, both GPU and side-channel resistant, suitable for all scenarios
Recommended Choice: Unless you have special needs, always use Argon2id. It's the unanimous recommendation of OWASP, NIST, and cryptography experts, providing the most comprehensive security protection.

FAQ

Q: What's the difference between Argon2 and bcrypt/PBKDF2?

A: Argon2: Modern algorithm (2015), memory-hard, GPU/ASIC resistant, OWASP preferred. bcrypt: Classic algorithm (1999), computation-hard, moderate GPU resistance, widely used but gradually being replaced by Argon2. PBKDF2: Standard algorithm (2000), computation-hard, vulnerable to GPU attacks, requires extremely high iterations (≥ 600k) for security. Performance comparison: At the same security level, Argon2 is 2-3x faster than bcrypt and 10x+ faster than PBKDF2. Recommendation: Use Argon2id for new projects, gradually migrate existing projects to Argon2.

Q: How should Argon2 parameters be configured?

A: OWASP recommended configuration: Memory cost (m): 47104 KB (about 47MB), can increase to 64MB or higher if server performance is good. Time cost (t): 1-3 iterations, usually 1 is sufficient. Parallelism (p): 1 (single-threaded), avoid parallel attacks. Hash length: 32 bytes (256 bits). Tuning method: Test in development environment, ensure single hash takes 0.5-1 seconds, then adjust based on server performance. Note: Higher parameters mean more security, but increase server load and response time.

Q: Why is Argon2 more suitable for password storage than SHA-256?

A: SHA-256 is a general-purpose hash function designed for fast computation, which is a fatal weakness in password storage scenarios. GPUs can compute billions of SHA-256 hashes per second, making even salted passwords vulnerable to brute-force attacks. Argon2's advantages: 1) Slow design: Single hash takes 0.5-1 seconds, dramatically reducing brute-force speed. 2) Memory-hard: Requires large memory (64MB), GPUs and ASICs cannot parallelize attacks. 3) Adjustable cost: As hardware improves, parameters can be increased to maintain security. Conclusion: Password storage must use specialized password hashing algorithms (Argon2, bcrypt, PBKDF2), not general-purpose hash functions (SHA-256, MD5).

Q: What is the Argon2 hash string format?

A: Argon2 uses PHC (Password Hashing Competition) string format: $argon2id$v=19$m=65536,t=3,p=1$saltbase64$hashbase64.
Component meanings:
$argon2id: Algorithm variant (id/i/d).
v=19: Algorithm version (currently 19).
m=65536,t=3,p=1: Memory cost (KB), time cost (iterations), parallelism.
saltbase64: Base64-encoded salt (16 bytes).
hashbase64: Base64-encoded hash (32 bytes).
Advantage: Self-contained with all parameters, no additional storage needed for verification, facilitates future upgrades.

Q: How to migrate from bcrypt to Argon2?

A: Progressive migration approach: 1) Dual verification: Keep bcrypt verification logic, use Argon2 for new users and password changes. 2) Transparent upgrade: When users log in, verify with bcrypt first, then immediately rehash with Argon2 and update database upon success. 3) Identifier field: Add database field to identify hash algorithm type (bcrypt/argon2). 4) Complete migration: After some time (e.g., 6 months), most active users have migrated, can force remaining users to reset passwords. Note: bcrypt and Argon2 have different hash formats, can be automatically identified by prefix ($2a$ vs $argon2id$).

Q: Won't Argon2 be too slow in browsers?

A: Argon2's design goal is slow computation, which is a security guarantee, not a flaw. Using WebAssembly to compute Argon2 in browsers, single hash takes 0.5-1 seconds, which has minimal impact on user experience (users waiting 1 second after entering password is acceptable). Optimization suggestions: 1) Async computation: Use Web Workers to compute in background, avoid blocking UI. 2) Progress indicator: Display “Encrypting...” message to improve user experience. 3) Parameter adjustment: Browser environment can moderately reduce memory cost (e.g., 32MB), but don't go below OWASP minimum recommendation (47MB). Note: Server-side verification also requires the same computation time, which is Argon2's core security mechanism.

Use Cases

Recommended: User Password Storage

This is Argon2's primary use case. When users register or change passwords, use Argon2id to hash passwords and store in database. During login, extract stored hash string, hash user-entered password with same parameters, then compare results. Argon2's memory-hard characteristics make brute-force attacks extremely costly, protecting user passwords even if database is compromised.

Recommended Configuration:
  • ✅ Argon2id (OWASP recommended, preferred)
  • bcrypt (classic choice, cost factor ≥ 12)
  • PBKDF2-SHA256 (≥ 600k iterations)
  • ❌ Don't use SHA-256, MD5, or other general-purpose hashes
Recommended: API Key Hashing

API keys (like API Tokens, Access Keys) typically need database storage but shouldn't be stored in plaintext. Use Argon2 to hash API keys; even if database is compromised, attackers cannot obtain original keys. For verification, hash user-provided key and compare. Note: API keys are usually randomly generated high-entropy strings, can moderately reduce Argon2 parameters (e.g., t=1, m=32MB) to improve performance.

Recommended Configuration:
  • ✅ Argon2id (high security)
  • bcrypt (balance performance and security)
  • SHA-256 + salt (usable for high-entropy keys)
  • 💡 Consider using hash prefix indexing to speed up queries
Recommended: Cryptocurrency Wallets

Cryptocurrency wallets need passwords to protect private keys. Use Argon2d (data-dependent) to derive encryption key from user password, then use that key to encrypt private key. Argon2d's GPU resistance makes brute-forcing wallet passwords extremely costly. Note: Wallet scenarios typically use Argon2d rather than Argon2id because side-channel attack risk is lower, while GPU resistance is more important.

Recommended Configuration:
  • ✅ Argon2d (GPU-resistant, wallet recommended)
  • ✅ Argon2id (more comprehensive security)
  • scrypt (classic choice, used by Bitcoin Core)
  • 💡 Combine with hardware wallets for higher security
Recommended: File Encryption Key Derivation

Use Argon2 to derive file encryption key from user password. After user provides password, Argon2 generates fixed-length key (e.g., 256 bits), then use that key to encrypt file (e.g., using AES-256-GCM). Salt and Argon2 parameters are stored in file header; during decryption, extract parameters and re-derive key. This approach is widely used in encrypted archives (like 7-Zip, WinRAR) and disk encryption (like VeraCrypt).

Recommended Configuration:
  • ✅ Argon2id (recommended)
  • ✅ Argon2i (side-channel resistant)
  • scrypt (classic choice)
  • 💡 Store salt and parameters in file header
Recommended: Two-Factor Authentication Backup Codes

Two-factor authentication (2FA) backup codes need to be hashed before storage to prevent abuse if database is compromised. Since backup codes are randomly generated high-entropy strings (typically 8-16 characters), can use lower Argon2 parameters (e.g., t=1, m=32MB) to improve performance. During verification, hash user-entered backup code and compare; immediately invalidate backup code upon successful verification.

Recommended Configuration:
  • ✅ Argon2id (recommended)
  • bcrypt (better performance)
  • SHA-256 + salt (usable for high-entropy backup codes)
  • 💡 Invalidate backup code immediately after use
Not Recommended: Real-time Performance-Sensitive Scenarios

Argon2's slow characteristics make it unsuitable for scenarios requiring extremely high performance, such as high-frequency API authentication, real-time game login, IoT device authentication, etc. These scenarios should use token-based authentication (like JWT, OAuth) or session management, rather than password hashing for every request. Argon2 is only used once during user login; after successful verification, issue token, subsequent requests use token authentication.

Recommended Configuration:
  • ✅ JWT + HMAC-SHA256 (high performance)
  • ✅ Session + Cookie (traditional approach)
  • ✅ OAuth 2.0 (standard protocol)
  • ❌ Don't use Argon2 in high-frequency scenarios

Best Practice Recommendations

  • Argon2id is the best choice for password storage, recommended for all new projects. Existing projects should gradually migrate from bcrypt/PBKDF2 to Argon2.
  • Parameter configuration follows OWASP recommendations: m ≥ 47MB, t ≥ 1, p = 1. If server performance is good, can increase memory cost to 64MB or higher.
  • Don't use Argon2 in high-frequency scenarios; should combine with token authentication (JWT, Session) for high performance.
  • When migrating from bcrypt, use progressive approach: keep bcrypt verification, use Argon2 for new users and password changes, transparently upgrade during login.
  • Browser environment uses WebAssembly to compute Argon2, combine with Web Workers and progress indicators to improve user experience.

Discussion & Feedback

0 comments
Me