AES.js
Encrypt something, then take the result apart — what a mode does to a picture, and what the cipher does to a single block, step by step.
JavaScript · Node.js
Everything below runs on AES.js — the cipher written out in JavaScript, not handed to the browser's own.
Seal a message
A message and a password make one sealed string. Only that password opens it again. Paste a sealed string back into the box, or pick the file, and it opens instead of sealing.
Your message and password stay in the page: the work runs in a worker, off the main thread.
Why the mode matters
A mode decides what one block knows about the last one. Here the same picture is encrypted twice, with the same key, under two of them.
Plaintextwhat went in
1 distinct blocks of 3,200
ECBeach block on its own
1 distinct blocks of 3,200
CBCeach block chained to the last
3,200 distinct blocks of 3,200
ECB maps equal blocks to equal blocks, so its ciphertext holds exactly as many distinct blocks as the picture did — 1 either side, and the word still legible in the noise. CBC carries each block's history into the next one, and every one of the 3,200 comes out different.
Under the microscope
Sixteen bytes in a 4×4 grid, filled column by column. Whatever the last step changed lights up.
block · key
State
Round key ⊕
Diffusion
Want to go further?