Ethereum Keystore Generator
Generate and recover Ethereum V3 keystore JSON files client-side. PBKDF2 encryption, private key derivation, and AES-128-CTR - all in-browser.
About
An Ethereum V3 keystore file encrypts a private key using a passphrase-derived symmetric key. The standard (defined in Web3 Secret Storage) combines PBKDF2 key derivation with AES-128-CTR cipher and HMAC-SHA256 message authentication. A weak passphrase or corrupted keystore means permanent, irrecoverable loss of funds. This tool performs real cryptographic operations entirely in your browser using the Web Crypto API and a pure-JavaScript Keccak-256 implementation for Ethereum address derivation. No data leaves your machine. Limitation: this tool uses PBKDF2 exclusively. Native Scrypt is unavailable in Web Crypto; if your workflow requires Scrypt-based keystores, use a dedicated node environment.
Formulas
The keystore generation pipeline follows three stages: key derivation, encryption, and MAC computation.
where dk is the derived key of length dklen = 32 bytes, c is the iteration count, and salt is 32 random bytes.
The encryption key is the first 16 bytes of dk. The iv is 16 random bytes.
The MAC ensures integrity. During recovery, the MAC is recomputed and compared. A mismatch indicates wrong passphrase or corrupted data.
where pubKey is the 64-byte uncompressed public key (without the 0x04 prefix) derived from elliptic curve point multiplication G × privateKey on the secp256k1 curve.
Reference Data
| Parameter | V3 Keystore Default | Description |
|---|---|---|
| KDF | PBKDF2 | Key derivation function |
| KDF Iterations (c) | 262144 | PBKDF2 iteration count. Higher = slower brute-force |
| Derived Key Length (dklen) | 32 bytes | Output length of derived key |
| PRF | HMAC-SHA256 | Pseudo-random function for PBKDF2 |
| Cipher | AES-128-CTR | Symmetric encryption algorithm |
| Cipher Key Length | 16 bytes | First 16 bytes of derived key |
| IV Length | 16 bytes | Initialization vector for CTR mode |
| MAC Input | dk[16..32] || ciphertext | Last 16 bytes of derived key concatenated with ciphertext |
| MAC Hash | Keccak-256 | Integrity check hash |
| Address Hash | Keccak-256 | Last 20 bytes of hash of uncompressed public key (no 0x04 prefix) |
| Private Key Length | 32 bytes (64 hex chars) | secp256k1 scalar |
| Public Key (Uncompressed) | 64 bytes (128 hex chars) | X and Y coordinates on secp256k1 curve |
| Salt Length | 32 bytes | Random salt for KDF |
| UUID Version | v4 | Random UUID for keystore ID |
| Keystore Version | 3 | Web3 Secret Storage version |
| Min Passphrase (recommended) | ≥ 12 chars | Shorter passphrases are vulnerable to dictionary attacks |
| secp256k1 Order (n) | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 | Curve order; private key must be in [1, n − 1] |
| secp256k1 Prime (p) | FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEFFFFFC2F | Field prime for coordinate arithmetic |
Frequently Asked Questions
"kdf": "scrypt", you need a tool with Scrypt support. Attempting recovery here will produce a clear error indicating the unsupported KDF.