Skip to content

AES Encrypt/Decrypt

Password-based AES-256-GCM demo via Web Crypto.

AES Encrypt/Decrypt demonstrates password-based AES-256-GCM encryption entirely in your browser using the Web Crypto API and PBKDF2 key derivation. It is built for learning how authenticated encryption and key derivation work together—not as a production secrets tool.

How it works

A random 16-byte salt and 12-byte IV are generated for each encryption. Your password and the salt are fed into PBKDF2-SHA256 for the configured iteration count to derive a 256-bit AES key, which then encrypts your text with AES-GCM. The iteration count, salt, IV, and ciphertext are packed together and Base64-encoded into a single copyable payload. Decryption reverses the process using the same password.

Benefits

  • AES-256-GCM authenticated encryption via native Web Crypto
  • PBKDF2-SHA256 key derivation with a visible, adjustable iteration count
  • Self-contained payload—salt, IV, and iteration count travel with the ciphertext
  • Clear, repeated warnings that this is educational, not production-grade

Use cases

  • Learn how AES-GCM authenticated encryption behaves in practice
  • Demonstrate PBKDF2 iteration count trade-offs in a classroom setting
  • Build small local demos of password-based encryption for prototypes
  • Experiment with tamper detection by editing ciphertext and observing decryption failures

Best practices

  • Never use this tool for real production secrets—use an audited secrets manager instead
  • Use a long, unique passphrase; PBKDF2 cannot make a weak password strong
  • Keep PBKDF2 iterations high enough to resist offline brute-force but reasonable for your device
  • Treat AES-GCM authentication failures as a sign of tampering or wrong credentials, not a bug to bypass

Common mistakes

  • Reusing this browser-only tool to protect real passwords, API keys, or PII
  • Assuming a low iteration count is fine because the demo runs quickly
  • Losing the password with no recovery path—there is no backdoor by design
  • Editing the Base64 payload manually and expecting decryption to still succeed

Privacy

All key derivation, encryption, and decryption happen locally via Web Crypto—nothing is uploaded. Because this tool touches a secret password and derived key material, it is marked sensitive and on-device history is disabled entirely.

Frequently asked questions

Is this tool suitable for encrypting production secrets?
No. This is an educational/demo tool for learning AES-GCM and PBKDF2 concepts in the browser. For production secrets, use a dedicated, audited secrets manager or encryption library with proper key management, not a browser-based text tool.
What algorithm and key derivation does it use?
It uses AES-256-GCM for authenticated encryption and PBKDF2 with SHA-256 to derive a key from your password. A random salt and IV are generated for every encryption and stored alongside the ciphertext in the output payload.
Why does decryption need the same password but not the same iteration count field?
The PBKDF2 iteration count used to encrypt is embedded in the output payload itself, along with the salt and IV, so decryption automatically uses the correct parameters as long as you provide the same password.
What happens if I enter the wrong password?
AES-GCM includes an authentication tag, so decryption with the wrong password (or a tampered payload) fails with an integrity error rather than silently returning garbage plaintext.
Does this tool upload my plaintext or password?
No. Encryption and decryption run entirely in your browser via the Web Crypto API. Nothing is sent to ToolHub, and history is disabled entirely because this tool touches secrets and keys.
Why are PBKDF2 iterations configurable?
Higher iteration counts make brute-force password guessing slower but also slow down legitimate encryption/decryption. The tool shows the derivation parameters so you can see the real-world trade-off, for learning purposes.
Can I decrypt a payload encrypted with a different iteration count?
Yes, as long as you use the exact same password. The iteration count is read from the payload automatically during decryption, so it does not need to match your current UI setting.

Version 1.0.0 · Updated 2026-07-27 · 2 minutes