AES modes, and why DES is old

CodeMoment · Updated 2026-10-31

AES is a block cipher. The mode is how those blocks are chained, and the mode changes what an observer can see. DES is an older block cipher with a key that is too short for new data. A password is not yet an AES key until something like PBKDF2 stretches it.

ECB encrypts each block on its own. The same plaintext block becomes the same ciphertext block, and the IV is ignored. A repeated pattern in the message, such as a run of identical blocks, stays visible. CBC, CFB, CTR, and OFB exist so that pattern does not leak that way. For a real message, pick one of those. ECB is on the AES page because old ciphertext uses it, not because it is a good default.

The AES key on that page is raw bytes, not a password. A short key is filled with zero bytes out to 16, 24, or 32 bytes, which selects AES-128, AES-192, or AES-256. Extra bytes are dropped. Zero-fill is a way to match a test vector. It is not a key-derivation function. Iso10126 adds random padding, so the same text encrypts to a different result each time. Other paddings do not. The key and the plaintext stay in the tab.

If the secret you have is a password, derive a key first. PBKDF2 uses HMAC-SHA-256 by default and HMAC-SHA-1 when you need older CryptoJS output to match. You choose the salt and the iteration count. One iteration only reproduces a test vector. Password storage needs a large count, because a small count can be guessed. The same password, salt, and count produce different keys under the two hashes. The salt is text. A generated salt is hex characters, not bytes decoded from that hex. Copy the derived key into AES yourself. This page does not apply it for you.

DES is for ciphertext that already exists. The key and IV are 8 bytes, and short values are filled with zero bytes. ECB again ignores the IV. Only 56 bits of the key are secret, because the eighth bit of each byte is parity, and that keyspace can be searched. The DES page is single DES. Triple DES will not decrypt the output, and this output will not open as Triple DES. Do not protect new data with it.

None of the three pages uploads the secret or the text. Use AES with a non-ECB mode and a key that came from raw bytes or from PBKDF2. Use DES only to read what an old system wrote.