跳到主要内容

Argon2 哈希生成器

根据密码或消息生成标准的 RFC 9106 Argon2id、Argon2i 或 Argon2d 哈希,支持自定义内存开销、迭代次数和并行度。完全在浏览器中运行,无需上传至服务器。

输入

Argon2id(推荐)是兼具抵御侧信道攻击和 GPU 攻击的混合变体。Argon2i 抵御侧信道攻击;Argon2d 最大化抵御 GPU 攻击。

哈希过程中使用的内存大小 (KiB)。OWASP 当前推荐的最小值为 19456 KiB (19 MiB)。

内存遍历遍数(时间成本)。

并行通道数量。

派生密钥的长度(字节)。通用默认值为 32 字节(256 位)。

默认自动生成随机盐(推荐)。

PHC 编码字符串包含变体、参数和盐值。

输出

用于此哈希的十六进制编码盐值。

这对您有帮助吗?

使用指南

What this tool does

It computes a real Argon2 hash — Argon2id, Argon2i, or Argon2d, as specified in RFC 9106 — from a password or message you enter, with configurable memory cost, iterations, parallelism, hash length, and salt. Output is available as a PHC-encoded string (the portable $argon2id$v=19$m=...,t=...,p=...$salt$hash format most libraries expect), hex, or Base64.

What is Argon2?

Argon2 is a memory-hard key derivation function — the winner of the 2015 Password Hashing Competition, and the current best-practice choice (per OWASP) for hashing passwords before storing them. Unlike a plain hash function (MD5, SHA-256), Argon2 is deliberately slow and memory-intensive, which makes brute-force and GPU/ASIC cracking attacks far more expensive without meaningfully slowing down a single legitimate login check.

Argon2id (the default here, and the recommended variant for almost all use cases) is a hybrid of the other two: resistant to both GPU cracking (like Argon2d) and side-channel timing attacks (like Argon2i). Argon2i favors side-channel resistance; Argon2d favors maximum GPU/ASIC resistance but is more vulnerable to certain side-channel attacks — it's typically used for cryptocurrency or non-interactive settings rather than password storage.

The parameters

  • Memory cost (m), in KiB — how much RAM the computation uses. Higher is more secure but slower. 19456 KiB (19 MiB) is OWASP's current minimum recommendation for interactive use (e.g. a login form).
  • Iterations (t) — how many passes are made over that memory. Also trades security for speed.
  • Parallelism (p) — the number of independent lanes the algorithm's internal computation is split into. This changes the derived output (it's a real Argon2 parameter, not just a speed knob), so hashing the same password with a different p produces a different hash.
  • Hash length — the size, in bytes, of the derived key/hash itself. 32 bytes (256 bits) is typical.
  • Salt — a random value mixed into every hash so identical passwords don't produce identical hashes. Leave it on auto-generate unless you specifically need a reproducible salt for testing.

How to use it

  1. Enter the password or message to hash.
  2. Adjust the Argon2 parameters if needed — the defaults are a reasonable, OWASP-aligned starting point.
  3. Choose a salt mode and output format.
  4. Click Generate hash.
  5. Copy the result, or download it as a text file.

FAQ

Is this safe to use for real passwords? The computation runs entirely in your browser — your password is never sent anywhere. The underlying Argon2 implementation is @noble/hashes, an independently audited, open-source library; this tool doesn't reimplement the algorithm itself.

Why is Generate slower than other tools on this site? That's by design — Argon2 is meant to be computationally expensive, so that trying millions of password guesses is expensive too. Raising memory cost or iterations makes it slower still (and more secure); this tool caps both to keep the browser responsive.

Can I verify a password against an existing Argon2 hash here? Not currently — this tool focuses on generating hashes. To verify, most languages have a built-in or well-known Argon2 verify function (e.g. PHP's password_verify()).

Why does the PHC string not always match other tools with the "same" settings? If the salt differs, the hash differs — that's the point of a salt. Compare the parameters (m, t, p, v) inside the PHC string instead, or set a custom salt on both sides for a like-for-like comparison.

Privacy

Everything happens client-side in your browser. Nothing you type here — the password, salt, or resulting hash — is transmitted to or stored on our servers.

argon2hashpasswordkdfcryptosecurityrfc9106generator

Use it from code

From 3 credits per call

REST API

curl -X POST https://api.iotools.cloud/v1/tool/argon2-hash-generator \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "password": "correct horse battery staple",
    "variant": "argon2id",
    "memoryCost": "19456",
    "iterations": "2",
    "parallelism": "1",
    "hashLength": "32",
    "saltMode": "custom",
    "customSalt": "argon2-tool-salt",
    "outputFormat": "encoded"
  }'

Swap in your own key from your account. The tool's fields are the body — no wrapper.

Ask an AI agent

Use the IOTools `argon2-hash-generator` tool (Argon2 Hash Generator) on this input:

YOUR_INPUT_HERE

Paste this at any agent connected to the IOTools MCP server, then add your input.

工作流的一部分

全部工具集

喜欢这些工具?去掉广告吧。

一次性付款即可永久移除您账户中的所有广告。无需订阅,不追踪。