argon2 (npm)

Node.js bindings for the Argon2 password hashing algorithm — OWASP's recommended password hashing algorithm and winner of the Password Hashing Competition. Supports Argon2id (recommended), Argon2i, and Argon2d variants with configurable time, memory, and parallelism cost parameters. Argon2id is memory-hard making it resistant to GPU and ASIC cracking attacks that can undermine bcrypt.

Evaluated Mar 06, 2026 (0d ago) v0.31+
Homepage ↗ Repo ↗ Developer Tools argon2 argon2id password hashing security node native-addon owasp
⚙ Agent Friendliness
66
/ 100
Can an agent use this?
🔒 Security
93
/ 100
Is it safe for agents?
⚡ Reliability
88
/ 100
Does it work consistently?

Score Breakdown

⚙ Agent Friendliness

MCP Quality
--
Documentation
85
Error Messages
80
Auth Simplicity
95
Rate Limits
100

🔒 Security

TLS Enforcement
100
Auth Strength
95
Scope Granularity
90
Dep. Hygiene
88
Secret Handling
92

OWASP-recommended algorithm. Memory-hard — resistant to GPU/ASIC attacks. Argon2id provides both side-channel resistance (Argon2i) and GPU resistance (Argon2d) in one variant. Industry-leading password security.

⚡ Reliability

Uptime/SLA
100
Version Stability
85
Breaking Changes
82
Error Recovery
85
AF Security Reliability

Best When

Starting new Node.js authentication systems where OWASP compliance and maximum password security matter — Argon2id is the current gold standard.

Avoid When

Your deployment environment can't compile native addons — bcryptjs (pure JS bcrypt) is more portable if Argon2 native compilation fails.

Use Cases

  • Hash user passwords in new agent systems using Argon2id with OWASP-recommended parameters (memory=65536, iterations=3, parallelism=4)
  • Migrate from bcrypt to Argon2id in agent auth systems — hash new passwords with argon2 while verifying old bcrypt hashes during transition
  • Implement API key and token hashing for agent credential storage with stronger memory-hard protection against database breach attacks
  • Derive encryption keys from user passwords using Argon2 KDF with configurable salt for agent data encryption key derivation
  • Add configurable security cost parameters to agent auth systems that can be increased over time as hardware improves

Not For

  • Non-password use cases requiring speed — Argon2 is intentionally slow; use SHA-256/SHA-512 for data integrity checking where speed matters
  • Environments without native build tools — Argon2 uses a C native addon; bcryptjs (pure JS) may be simpler in restricted build environments
  • Key derivation from truly random keys — Argon2 is for human passwords; HKDF is more appropriate for deriving keys from already-random material

Interface

REST API
No
GraphQL
No
gRPC
No
MCP Server
No
SDK
Yes
Webhooks
No

Authentication

Methods: none
OAuth: No Scopes: No

No authentication — cryptographic library. argon2 IS the password auth primitive.

Pricing

Model: open_source
Free tier: Yes
Requires CC: No

argon2 npm package is open source and free.

Agent Metadata

Pagination
none
Idempotent
Partial
Retry Guidance
Not documented

Known Gotchas

  • argon2.verify() returns a boolean — never throws for wrong password; must check if (await argon2.verify(hash, password)) not try/catch for auth logic
  • Default parameters may need tuning for production — run benchmarks on your hardware and increase memoryCost/timeCost until hashing takes ~0.5s for your use case
  • Native addon requires build tools (gcc, python, make) at npm install time — add to Dockerfile: apt-get install build-essential before npm install
  • Alpine Linux requires additional packages for native compilation: apk add build-base python3 — arm builds may also need to install node-gyp globally
  • Argon2id is the recommended variant — Argon2i is for side-channel resistance only; Argon2d for GPU resistance only; use argon2.argon2id for general password hashing
  • Hash output includes variant and parameters encoded in the hash string — argon2.verify() auto-detects the correct variant; don't parse the hash string manually

Alternatives

Full Evaluation Report

Comprehensive deep-dive: security analysis, reliability audit, agent experience review, cost modeling, competitive positioning, and improvement roadmap for argon2 (npm).

AI-powered analysis · PDF + markdown · Delivered within 30 minutes

$99

Package Brief

Quick verdict, integration guide, cost projections, gotchas with workarounds, and alternatives comparison.

Delivered within 10 minutes

$3

Score Monitoring

Get alerted when this package's AF, security, or reliability scores change significantly. Stay ahead of regressions.

Continuous monitoring

$3/mo

Scores are editorial opinions as of 2026-03-06.

5404
Packages Evaluated
26151
Need Evaluation
173
Need Re-evaluation
Community Powered