Skip to main content
CalcChef

Text Encryptor and Decryptor

Encrypt or decrypt text with a password using AES-256-GCM and a PBKDF2-SHA-256 key of 600,000 iterations. The password cannot be recovered if lost. How it works

Use the Text Encryptor and Decryptor

How It Works

AES-256-GCM with PBKDF2 key derivation (600,000 iterations, SHA-256), run in your browser with the Web Crypto API; the output starts with lted-v2:. Strings from earlier versions of this page (no prefix, 100,000 iterations) can still be decrypted. The password is the only protection: a short or common password can be guessed, and a lost password cannot be recovered.

About the Text Encryptor and Decryptor

Encrypting hello with the password correct horse gives a 76-character string that starts with lted-v2:. The tool derives an AES-256 key with PBKDF2-HMAC-SHA-256 from your password and a random 16-byte salt at 600,000 iterations, then encrypts with AES-GCM. Strings from the older version of this page, with 100,000 iterations and no prefix, still decrypt.

The two string formats this tool reads

FormatStarts withPBKDF2-SHA-256 iterationsBytes that are Base64-encodedWritten by Encrypt
Currentlted-v2:600,000salt (16), IV (12), ciphertext, tag (16)Yes
Earlier versionno prefix100,000salt (16), IV (12), ciphertext, tag (16)No, decrypt only

From the constants the tool uses. The key is 256 bits and the salt is used as raw bytes. Standard Base64 is written; URL-safe Base64 with the padding left off is also read.

Length of the encrypted string by text length

Text length (UTF-8 bytes)Encrypted string (characters)
068
168
576
100200
1,0001,400

Produced by running Encrypt on text of each length; the count includes the 8 characters of lted-v2:. The rule is 8 + 4 × ceil((44 + n) / 3) for n bytes.

How to use this tool

  1. Choose Encrypt or Decrypt.
  2. Type or paste the text. To decrypt, paste the whole string, starting with lted-v2: for a string made by the current version.
  3. Type the password. Show password lets you check it.
  4. Press the button. The result appears below with a Copy button; changing the mode, the text or the password clears it.

Frequently asked questions

How do I encrypt text with a password?
Choose Encrypt, type the text and a password, and press the button. Send the lted-v2: string, and give the password to the other person by a different route. To read it, they paste the string into Decrypt with the same password. A lost password cannot be recovered.
Is AES-256-GCM secure enough for my text?
The cipher is not the weak point; the password is. AES is specified in FIPS 197. The tool slows each password guess with 600,000 PBKDF2 iterations, but a guessable password stays guessable: 8 random lowercase letters have 37.6 bits in the Password Entropy Calculator’s model, and 16 have 75.2 bits.
Can I still decrypt text from the older version of this page?
Yes. A string with no lted-v2: prefix is read as the older format, 100,000 iterations. If decryption fails for such a string, the message adds that a string made by the current page starts with lted-v2:, so paste it with the prefix.
Why is the encrypted text different every time?
Each encryption uses a new random 16-byte salt and 12-byte IV. The same text and password give a different string every run, and every one of them decrypts to the original text.
What does “the password is wrong or the encrypted string was changed” mean?
AES-GCM adds a 16-byte tag that fails to check when the key is wrong or any character of the string was altered, and the two cases look the same, so the page cannot say which. Text that is not Base64, or is shorter than 44 bytes once decoded, gets a different message that does not blame the password.
Can I decrypt the string with another program?
Yes, if it follows the layout in the table: PBKDF2-HMAC-SHA-256 with the raw salt bytes, 600,000 iterations, a 256-bit key, then AES-GCM with the 12-byte IV and the tag at the end. The AES Encryption tool on this site uses the same cipher, key size and iteration count but writes its own v1: format, and the two are not interchangeable: decrypt a lted-v2: string, or an older one with no prefix, here, and a v1: string there.

Related Tools

View all tools