Tech News, Tech & Coding · Free Online Tools

IT Question Answer
Tools

AES Encryption & Decryption

Secure text encryption using Advanced Encryption Standard (AES) entirely in your browser.

Advertisement

What this AES tool does

AES (Advanced Encryption Standard) is the symmetric cipher behind most disk, file and network encryption. Symmetric means the same secret key both locks and unlocks the data. This tool lets you encrypt a piece of text with AES, then decrypt it again, and choose the key size, cipher mode, key and IV formats, and the output format.

It works with 128, 192 and 256-bit keys and four modes: GCM, CBC, CTR and ECB. All the maths runs in your browser, so the text and the key are not sent to a server. That makes it useful for learning, for testing an integration, and for checking that two systems produce the same ciphertext from the same inputs.

How to encrypt and decrypt

Use the Encrypt tab to protect text and the Decrypt tab to read it again:

  • Enter the plain text and the secret key. Pick the key size (128, 192 or 256 bits) and tell the tool whether the key is typed as text, Base64 or hex.
  • Choose a mode. GCM is the best default for new work. CBC needs an IV and padding (PKCS5 / PKCS7 is the default). CTR needs an IV. ECB needs neither but is not safe for real data.
  • For modes that use an IV, leave it empty to get a random one generated for you, or paste your own. Keep it: you need the same IV to decrypt.
  • Pick Base64 or hex for the output and copy the result.
  • To decrypt, use the same key size, mode, key, IV and (for GCM) tag length, and paste the ciphertext.

Which mode should you use?

The mode decides how blocks of data are chained together, and it matters more than the key size.

  • GCM encrypts and also authenticates, so tampering is detected when you decrypt. Use a fresh random IV every time. The tool generates a standard 12-byte IV and uses the IV exactly as you give it, so results match other GCM software. GCM works with 128 and 256-bit keys here.
  • CBC is common in older systems. It needs a random IV and padding, and it does not detect changes to the data on its own.
  • CTR turns AES into a stream cipher. Never reuse the same key and IV pair.
  • ECB encrypts every block separately, so equal blocks of plain text give equal blocks of ciphertext and patterns show through. Use it only to understand why it is avoided.

Mistakes that cause failed decryption

Most "it will not decrypt" problems come from a mismatch between the two sides:

  • A different key size, mode or padding on the decrypt side.
  • A key typed as text on one side and as hex on the other.
  • A lost or changed IV, or a wrong GCM tag length.
  • Ciphertext copied with extra spaces or line breaks, or in Base64 on one side and hex on the other.

Safety notes

A browser tool is fine for tests and learning. For production secrets, use a vetted library and a proper key management system, and never paste real production keys into any website. Remember that a key typed as a password is only as strong as the password; real systems derive keys from passwords with a slow function such as PBKDF2 or Argon2, which this tool does not do.

Related tools

Advertisement

Frequently asked questions

No. Encryption and decryption run in your browser, so the text, the key and the IV stay on your device.

AES-128, AES-192 and AES-256 in CBC, CTR and ECB modes, and AES-128 and AES-256 in GCM (browsers do not support 192-bit GCM). Keys, IVs and output can be plain text, Base64 or hex.

In GCM, CBC and CTR a random IV is used each time, so the same text and key give different ciphertext. This is correct and expected. Keep the IV so you can decrypt.

No. ECB leaks patterns because equal blocks encrypt to equal blocks. It is included for learning and compatibility, not for protecting real data.

Do not encrypt passwords for storage. Passwords should be hashed with a slow, salted function such as bcrypt. Use the bcrypt tool for that.