AES-256 Encryption Explained: How It Protects Your Data

AES-256 with GCM mode is the gold standard for symmetric encryption. This article breaks down blocks, rounds, key derivation with PBKDF2, and how ToollyX implements it client-side.

AES-256 is the encryption standard used by banks, governments, and every major HTTPS connection you make. When Signal says your messages are "end-to-end encrypted," AES is doing the heavy lifting. This article explains the cipher from the ground up โ€” blocks, rounds, key derivation โ€” and shows exactly how ToollyX implements it in your browser.

AES vs SHA โ€” know the difference: AES is symmetric encryption โ€” it can be reversed with the correct key. SHA-256 is a hash function โ€” one-way, irreversible. Use AES when you need to decrypt later. Use SHA when you don't.

AES: The Block Cipher

AES (Advanced Encryption Standard) is a block cipher โ€” it encrypts data in fixed 128-bit (16-byte) blocks. The "256" in AES-256 refers to the key length: 256 bits. AES-128 uses a 128-bit key and 10 rounds; AES-256 uses a 256-bit key and 14 rounds.

More rounds = more mixing = harder to break. The extra rounds in AES-256 provide a meaningful security margin even against theoretical future quantum computers (Grover's algorithm halves the effective key length, leaving AES-256 with ~128-bit quantum security).

What Happens Inside Each Round

Each of the 14 rounds applies four transformations to the 4ร—4 byte state matrix:

  1. SubBytes: Each byte is replaced using a substitution table (S-box) derived from the multiplicative inverse in GF(2โธ). This adds nonlinearity.
  2. ShiftRows: Each row of the 4ร—4 matrix is cyclically shifted left by 0, 1, 2, and 3 positions respectively. This spreads bytes across columns.
  3. MixColumns: Each column is multiplied by a fixed polynomial in GF(2โธ). This diffuses each byte's influence across four output bytes.
  4. AddRoundKey: Each byte is XORed with the round key, derived from the original key via the key schedule.

GCM Mode: Why Mode Matters as Much as the Cipher

AES-256-GCM is what ToollyX uses โ€” not just AES-256. GCM (Galois/Counter Mode) adds two critical properties:

  • Confidentiality โ€” CTR mode within GCM encrypts the data using a counter, making it a stream cipher wrapper around AES. Each plaintext block is XORed with an AES-encrypted counter value.
  • Authenticity (AEAD) โ€” GCM produces a 128-bit authentication tag that detects any tampering with the ciphertext. If an attacker flips a single bit in the encrypted output, decryption fails with an authentication error. This is Authenticated Encryption with Associated Data (AEAD).
Why this matters: AES-CBC (older mode) doesn't authenticate the ciphertext โ€” an attacker can flip bits in the encrypted message and the receiver gets garbage they can't detect. AES-256-GCM prevents this entirely.

From Passphrase to 256-bit Key: PBKDF2

You don't enter a 256-bit key directly โ€” you type a passphrase. AES-256-GCM requires a key derived from it. Here's the exact process in ToollyX's implementation:

1. Generate random 16-byte salt (crypto.getRandomValues)
2. Generate random 12-byte IV (Initialisation Vector)
3. PBKDF2(passphrase, salt, 100,000 iterations, SHA-256) โ†’ 256-bit key
4. AES-256-GCM encrypt(plaintext, key, IV) โ†’ ciphertext + auth tag
5. Concatenate: [salt (16) | IV (12) | ciphertext+tag] โ†’ Base64 encode โ†’ output

The salt ensures two encryptions of the same text with the same passphrase produce different ciphertext. The IV ensures the same key produces different output for identical messages. The 100,000 PBKDF2 iterations make brute-forcing the passphrase computationally expensive.

The ToollyX AES Encrypt/Decrypt Tool

The AES Encrypt tool has two modes โ€” ๐Ÿ”’ Encrypt and ๐Ÿ”“ Decrypt:

  • Encrypt mode: Enter your text, type a passphrase, click Encrypt. Output is Base64-encoded ciphertext you can share safely.
  • Decrypt mode: Paste the ciphertext, enter the same passphrase, click Decrypt. Wrong passphrase returns "Decryption failed โ€” wrong passphrase or corrupted ciphertext."
  • Show/Hide passphrase: Toggle visibility of the passphrase field for entering without revealing to onlookers.
  • All processing is client-side: The passphrase and plaintext never leave your browser. ToollyX servers never see them.

What AES-256 Can't Protect Against

AES-256 is cryptographically unbreakable โ€” but the implementation around it matters:

  • Weak passphrases: "password123" weakens any encryption. Use a strong, random passphrase โ€” generate one with the Password Generator.
  • Passphrase exposure: If the receiver's device is compromised, the key is compromised regardless of cipher strength.
  • Metadata: AES encrypts content, not context. An adversary may still know who communicated with whom, file sizes, and timestamps.

When to Use ToollyX AES vs Other Security Tools

NeedTool
Encrypt a secret message or noteAES Encrypt
Generate a strong passphrasePassword Generator
Verify file integrity without encryptionHash Generator
Decode a JWT to read its claimsJWT Decoder
๐Ÿ›ก๏ธ
Encrypt text with AES-256-GCM

PBKDF2 key derivation. 100,000 iterations. Client-side only.

Open AES Encrypt โ†’