Encrypt
Decrypt
How Does AES-GCM Encryption Work?
AES-GCM (Galois/Counter Mode) is one of the "authenticated encryption" methods that both hides your data and verifies its integrity. At the end of encryption, an extra 16-byte block called the authentication tag is appended to the output; during decryption, this tag is recomputed and compared — if even a single byte of the ciphertext has been changed or corrupted, decryption doesn't silently return a wrong result, it fails outright.
Why isn't the passphrase used directly as the key? An AES-256 key is 32 bytes (256 bits) of random data; a passphrase you type isn't nearly that random, and using it directly would limit the number of candidate passphrases an attacker would need to try. That's why your passphrase is first run through PBKDF2 (Password-Based Key Derivation Function 2); this algorithm deliberately hashes your passphrase 600,000 times in a row (with SHA-256) to turn it into a single encryption key — this slowness makes it dramatically more costly for an attacker to brute-force millions of candidate passphrases.
Every encryption run generates a random 16-byte "salt" and a random 12-byte initialization vector (IV); both are prepended to the actual output and Base64-encoded together. This is why encrypting the same text with the same passphrase twice gives you a completely different output each time — this isn't a bug, it's a deliberate design called "semantic security", and it ensures no pattern or hint about the original content leaks from the ciphertext. During decryption, the salt and IV are parsed back out from the start of the output to re-derive the same key.
An honest limit: This tool uses the browser's built-in Web Crypto API (crypto.subtle) — no third-party encryption library is loaded. AES-256-GCM and PBKDF2 are real, industry-standard algorithms; but no encryption can make a weak passphrase strong. A short or guessable passphrase like "1234" renders even a strong algorithm meaningless — use a long, random passphrase that only you know, and store it somewhere safe (e.g. a password manager).
Try This Next
Finished here? These might be your next step.
Frequently Asked Questions
crypto.subtle); no third-party library is used.Last updated: