Skip to content
uencoder
TASK

Encrypt text with AES and decrypt it back

Symmetrically encrypt a message with a passphrase using AES-256-GCM, then decrypt the ciphertext with the same key to recover the original.

  1. 1

    AES is the standard symmetric cipher: the same key encrypts and decrypts. GCM mode provides authenticated encryption — it detects tampering of the ciphertext. Never use ECB or unauthenticated CBC for new data.

  2. 2
    AES Encryptor →

    Enter the plaintext and a passphrase. The tool derives a key (PBKDF2), generates a random IV, and outputs ciphertext + IV + salt, typically Base64-encoded.

  3. 3
    AES Decryptor →

    Paste the ciphertext output and the same passphrase. The tool recovers the original plaintext. If the passphrase is wrong, GCM mode fails with an authentication error rather than returning garbage.

  4. 4

    Store the passphrase separately from the ciphertext. The IV and salt are not secret and travel with the ciphertext — only the passphrase needs protection.

Frequently asked questions

What happens if I use the wrong passphrase to decrypt?
With GCM mode, decryption fails with an authentication tag mismatch — you get an error, not garbage text. This is why GCM is preferred over CBC: it detects tampering and wrong keys immediately.
Is the IV safe to store alongside the ciphertext?
Yes. The IV (or nonce) is not secret — it only needs to be unique per encryption with the same key. Storing it with the ciphertext is standard practice. Only the key/passphrase must be kept secret.

Workflows that solve this

Learn more

Want to understand why?

Related tools