By Tim King · Updated
Text Encryptor
AES-256-GCM With PBKDF2 Key Derivation, Output as Base64 and Decrypt Here
OneTask is free, with no sign-up, and built by one person.
If this tool saved you time, a coffee helps keep new ones coming.
How the Text Encryptor works
This text encryptor locks a message with a passphrase using AES-256 in GCM mode. Type or paste the message, choose a passphrase, and copy the Base64 result into an email, chat or note. Anyone with the same passphrase can paste it back here in Decrypt mode to read it. Encryption runs in your browser.
How the text encryptor protects a message
Your passphrase is stretched into a 256-bit key with PBKDF2-HMAC-SHA256 and 600,000 iterations, the figure OWASP recommends, using a random 16-byte salt. The message is then encrypted with AES-GCM and a random 12-byte nonce. The output is the salt, the nonce and the ciphertext joined together and written as Base64, so everything needed to decrypt, except the passphrase, travels with the message.
Tamper detection
GCM adds a 16-byte authentication tag. If a single character of the encrypted text is changed, or the passphrase is wrong, decryption fails outright instead of producing garbage. That is why a wrong passphrase gives a clear error rather than a scrambled message.
Choosing a passphrase
The encryption is only as strong as the passphrase. Four or five random words, or a long random password from a manager, are far beyond guessing range. A short, common word can be guessed offline by anyone who gets the encrypted text, however many iterations are used. Share the passphrase over a different channel from the message itself.
FAQ
Why does the encrypted text change every time?
A fresh random nonce is used for every encryption, and a fresh salt whenever the passphrase changes. The same message therefore never produces the same output twice, which stops an observer from telling that two encrypted messages are identical.
Can I decrypt this with OpenSSL or another tool?
Yes, if the other tool follows the same layout: the first 16 bytes are the salt, the next 12 the GCM nonce, and the rest is ciphertext with the tag at the end. The key is PBKDF2-HMAC-SHA256 with 600,000 iterations and a 32-byte output.
Is my message sent anywhere?
No. The Web Crypto API in your browser does all the work, and the page makes no network request with your text or passphrase. You can load the page, disconnect from the internet and it still works.
See also: all Security & Identifiers tools, Dev Utilities, Formatters & Validators, Data & Encoding, SEO, Accessibility, AI.
Related tools
Secret Splitter
Split a secret into shares; any threshold of them rebuilds it.
Hash Generator
Generate MD5, SHA-1, SHA-256 and SHA-512 digests from text.
Passphrase Generator
Diceware passphrases from the EFF wordlist, generated locally.
Base64 Encoder / Decoder
Encode and decode Base64, standard or URL-safe.
AES Key Generator
Random AES-128, 192 or 256-bit keys in hex, Base64 or JWK.