Tools · Modern cryptography
AES password encryption
Encrypt text with a password (AES-256-GCM, key from PBKDF2) and decrypt it. All in your browser.
Runs in your browser. Your text goes nowhere.
How to use it
Pick a password and type your text: a moment later the ciphertext appears, a Base64 string you can email, keep in your notes or print. To read it, switch to “Decrypt” (or press “⇅” and the ciphertext moves up for you) and enter the same password. If the password is wrong, or a single character of the ciphertext has changed, the tool tells you plainly that it can’t decrypt.
The same phrase with the same password comes out different every time: each ciphertext carries a fresh random salt and nonce. That’s not a bug but a defence: an eavesdropper can’t tell that you sent the same thing twice.
The password isn’t stored anywhere. Forget it and nobody can recover the text: not you, not us, not the biggest computer on Earth. Keep your passwords somewhere safe.
How it works
First the password becomes a 256-bit key. The password and a random salt are run through SHA-256 250,000 times (a function called PBKDF2). That’s slow on purpose: each attempt takes a noticeable fraction of a second, and an attacker guessing passwords pays the same price for every guess.
Then the text is encrypted with AES-256 in GCM mode. AES has been the US encryption standard since 2001; it protects HTTPS, Wi-Fi, archives and disks. Besides encrypting, GCM adds a 16-byte authentication tag, so any tampering with the ciphertext is caught.
The output format is Base64 of: the bytes “CK1” (a format tag), a 16-byte salt, a 12-byte nonce, the ciphertext and the 16-byte tag. The “What the result is made of” block takes any ciphertext apart into these pieces.
FAQ
How secure is it?
AES-256 itself has not been broken. The weak spot is the password. A short or dictionary password will be guessed, however slow each guess is made. Use a long phrase of several random words.
Can other software decrypt this?
The format is our own, but it’s made of standard parts: PBKDF2-SHA256 with 250,000 iterations, and AES-256-GCM. A programmer can rebuild it in any language in a few lines.
How is this different from XOR?
XOR is a single operation, one of the building blocks of AES. On its own, XOR with a short key falls in minutes; see the lesson on XOR.
Does my text go to the server?
No. The browser’s built-in cryptography (Web Crypto) does the work, and the page sends nothing anywhere.