Crypto
AES-256-CBC Encryption & Decryption
Encrypt and decrypt sensitive text data using AES-256 in CBC mode with PBKDF2 key derivation (100,000 iterations of SHA-256) via the Web Cryptography API. Zero data sent to server.
Quick answer
Encrypt or decrypt text with AES-256-CBC in your browser using PBKDF2 key derivation. Nothing is uploaded — use this for demos and local secrets, not as a full production crypto stack.
About this tool
This tool uses the Web Cryptography API for AES-256-CBC with PBKDF2 (100k SHA-256 iterations). Prefer authenticated modes (GCM) in production systems; CBC here is for learning and quick local transforms.
How to use
- Choose Encrypt or Decrypt.
- Enter plaintext (or ciphertext) and a passphrase; generate or paste an IV when decrypting.
- Copy the Base64 output and store the IV with the ciphertext (IV is not secret, but must be unique per message).
Common use cases
- Local demos of passphrase-based encryption without sending data to a server.
- Teaching AES-CBC + PBKDF2 concepts alongside HMAC signature checks.
- Quick round-trip tests before wiring Web Crypto into an app.
Example inputs
Plaintext + Key → Base64 CiphertextBase64 Ciphertext + IV + Key → PlaintextCommon issues and fixes
IV Reuse Risk
In CBC mode, never reuse the same Initialization Vector (IV) with the same encryption key across multiple distinct messages.
Decryption Padding Error
If the key or IV is off by even 1 character, AES PKCS#7 padding validation will reject the ciphertext.
Recommended remediation
Always store the IV alongside the ciphertext (e.g. iv:ciphertext). For production APIs prefer AES-GCM. Verify webhook integrity with the HMAC / signature checkers — encryption ≠ authentication.
Pro tips
- CBC without a MAC is malleable — pair with HMAC when integrity matters.
- Never reuse IVs; regenerate for every encrypt.
- Browse more crypto tools under /security/crypto-encoding-tools.
FAQ
Is AES encrypt/decrypt online safe?
This page runs entirely in your browser via Web Crypto — we do not receive your plaintext or key. Still avoid pasting production secrets into any shared device.
Why AES-CBC instead of GCM?
CBC is widely taught and easy to demo with explicit IVs. Production systems usually prefer AES-GCM for built-in authentication.
Does encryption replace HMAC signatures?
No. Encryption hides content; HMAC/signatures prove integrity. Use /security/hmac-generator or /signature-checker for webhook verification.
Related security tools
Base64 Encoder / Decoder
Encode and decode text to and from Base64 format. Fully client-side — your data never leaves the browser.
HMAC Generator
Compute HMAC-SHA256, HMAC-SHA384, HMAC-SHA512. Hex or Base64 output. 100% client-side.
Hash Identifier
Detect hash type by length/format. MD5, SHA1, SHA256, bcrypt.
Webhook Signature Validator
Verify Stripe and GitHub webhook signatures. HMAC-SHA256. 100% client-side — secret never leaves browser.
Run a full security check
After this tool passes, run related header and policy checks to catch transport and browser-level risks.