Client-Side AES-GCM / CBC Encryptor & Decryptor
Hardware-accelerated AES-256 authenticated encryption executed strictly in your browser via Web Crypto API. Zero server retention.
Cryptographic Parameters & Security Specs
Input Plaintext
Encrypted Result (Ciphertext)
Client-Side File Encryption & Decryption Container
100% computed inside browser memory. Files are NEVER uploaded to any server. Output file is a portable AES container (.enc).
Click or drag file here to encrypt or decrypt
Supports any format (.txt, .pdf, .zip, .png, .docx, .enc) up to 250 MB
Developer Integration Decryption Code
// Browser Native Web Crypto API Decryption
async function decryptAes(ciphertextB64, password, ivHex, saltHex, iterations = 100000) {
const hexToBytes = (h) => new Uint8Array(h.match(/.{1,2}/g).map(byte => parseInt(byte, 16)));
const b64ToBytes = (b) => Uint8Array.from(atob(b), c => c.charCodeAt(0));
const salt = hexToBytes(saltHex);
const iv = hexToBytes(ivHex);
const ciphertext = b64ToBytes(ciphertextB64);
const enc = new TextEncoder();
const keyMaterial = await crypto.subtle.importKey(
"raw", enc.encode(password), "PBKDF2", false, ["deriveKey"]
);
const key = await crypto.subtle.deriveKey(
{ name: "PBKDF2", salt, iterations, hash: "SHA-256" },
keyMaterial,
{ name: "AES-GCM", length: 256 },
false,
["decrypt"]
);
const decrypted = await crypto.subtle.decrypt(
{ name: "AES-GCM", iv, tagLength: 128 },
key,
ciphertext
);
return new TextDecoder().decode(decrypted);
}
// Example Execution:
decryptAes("YOUR_CIPHERTEXT_BASE64...", "YOUR_PASSWORD", "", "")
.then(console.log);Zero-Knowledge Local Execution
All data processing, parsing, and compilation execute strictly inside your local browser memory. Zero external server uploads.
Instant Local Cryptography
Instant real-time reactive computation delivers immediate feedback on every keystroke with zero network latency.
Production Standards & Compliance
Follows modern browser Web Crypto and security practices for safe client-side inspection.
AES Encryption Tool Developer Reference
Production guide and technical parameter reference for browser-based AES-GCM and AES-CBC symmetric encryption.
Key Parameters & Controls
| Parameter | Type / Unit | Description | Default |
|---|---|---|---|
| algorithm | "AES-GCM" | "AES-CBC" | Block cipher mode of operation. AES-GCM offers authenticated encryption (AEAD) with integrity validation, whereas AES-CBC provides confidentiality with PKCS#7 padding. | "AES-GCM" |
| keyLength | 128 | 192 | 256 | Cryptographic key size in bits. 256-bit keys deliver post-quantum resistance margins and require 32 bytes of raw entropy or derived key material. | 256 |
| keyMode | "passphrase" | "raw" | Secret key provision method. 'passphrase' derives symmetric keys via PBKDF2 using a random cryptographic salt, while 'raw' expects direct hexadecimal entropy. | "passphrase" |
| iterations | number | PBKDF2 key stretching iteration count when deriving keys from human passphrases to defend against offline dictionary and GPU brute-force attacks. | 100000 |
| aad | string | Optional Additional Authenticated Data for AES-GCM. AAD is authenticated into the GHASH tag alongside the ciphertext without being encrypted itself. | "" |
Pro Tips & Best Practices
Always default to AES-GCM over AES-CBC for application payloads. GCM creates a 128-bit authentication tag that verifies message integrity and detects tampering before plaintext decryption occurs, preventing padding oracle vulnerabilities.
Never encrypt two distinct plaintexts with the same key and Initialization Vector (IV) in AES-GCM. Reusing an IV destroys GCM authenticity guarantees and exposes the internal GHASH key, enabling ciphertext forgery.
When deriving keys from passphrases, maintain at least 100,000 to 250,000 PBKDF2 iterations using SHA-256. Always persist the random salt alongside the ciphertext, as PBKDF2 cannot reproduce the identical key without it.
Common Gotchas & Troubleshooting
⚠️DOMException: The operation failed for an operation-specific reason
This Web Crypto API error indicates AES-GCM authentication tag verification failure during decryption. Verify that the ciphertext, IV, cryptographic salt, and Additional Authenticated Data (AAD) match the original encryption values exactly without byte truncation or encoding corruption.
⚠️Invalid hex string: length must be an even number of characters
The raw key or IV hexadecimal input has an odd number of nibbles or contains non-hexadecimal characters. Ensure hex strings contain only characters 0-9 and a-f, strip prefixes like '0x', and confirm length is exactly 32 chars for 128-bit or 64 chars for 256-bit.
⚠️SubtleCrypto.importKey rejected with InvalidAccessError
The supplied raw key byte length does not match the configured keyLength parameter. Provide an exact 32-character hex string for 128-bit (16 bytes), 48-character hex for 192-bit (24 bytes), or 64-character hex for 256-bit (32 bytes).
Frequently Asked Questions
Does this utility transmit plaintext or secret keys to any remote backend?▼
No. All encryption, key derivation, and decryption routines run locally in your client runtime using the native Web Cryptography API (SubtleCrypto). No plaintexts, passphrases, raw keys, or ciphertexts leave your device.
What payload structure is included in the exported JSON bundle?▼
The bundle contains the algorithm, keyLength, iteration count, Base64/Hex ciphertext, random 12-byte or 16-byte IV, and the cryptographic salt used for PBKDF2. This self-contained schema can be deserialized directly in Node.js, Python cryptography, or Go.
Why is a 12-byte (96-bit) IV recommended for AES-GCM instead of 16 bytes?▼
Per NIST SP 800-38D, a 96-bit IV is directly mapped into the initial GCM counter block (J0) without requiring an intermediate GHASH computation. Using 16-byte IVs forces an extra hash operation, reducing throughput and introducing collision risk.
How can exported AES-GCM outputs be decrypted in Node.js crypto?▼
Parse the JSON bundle, convert the hex/base64 strings to Buffer objects, instantiate a decipher via crypto.createDecipheriv('aes-256-gcm', key, iv), set the authentication tag via decipher.setAuthTag(tag), specify AAD via decipher.setAAD(aad) if used, and call decipher.update() followed by decipher.final().
Related Tools & Utilities
All Tools →Parse and inspect PEM-encoded SSL/TLS certificates locally, displaying Subject Alternative Names (SAN), issuer authority, SHA-256 fingerprints, and expiration validity dates.
Convert text, hex, and cryptographic public keys to and from Bitcoin and IPFS Base58 / Base58Check formats with SHA-256 double-hash checksum verification.
Generate bcrypt password hashes with custom salt rounds and verify candidate passwords against existing hashes locally.
Calculate Keyed-Hash Message Authentication Codes (HMAC) for webhook signing (Stripe, GitHub, Shopify) directly in browser memory.
Generate cryptographically secure RSA public and private key pairs (1024, 2048, 4096-bit) in PKCS#1 and PKCS#8 PEM formats using browser Web Crypto API.
Simulate and debug modern TLS cryptographic handshakes, ECDHE key exchanges, ALPN protocol negotiation, and AES-GCM / ChaCha20 cipher suite security.