the scrambler
a text, a key, and xor: the key flips the bits, the same key flips them back. then see what a short key gives away.
scramble:
try:
every character is one byte. the key is written under the message, repeated; each byte of the message is xor-ed with the key byte beneath it. keys 1 to 4 pick an example.
plain
key
sent
back
the second button plays the neighbours: it decrypts the sent bytes with every possible key and keeps the one that reads as text. with a one-byte key that is 256 tries, shown one by one; with a longer key it tells you how many tries that would be.
key:
the raw picture is 256 × 256 points, three bytes each, 196,608 bytes. every byte is xor-ed with the key byte beneath it; a short key repeats. the neighbouring team simply displays what it read.
the first button plays the neighbours: with a one-byte key it decrypts with all 256 and keeps the smoothest picture, because a picture has neighbours that resemble each other and noise has not. with a longer key it tells you how many tries that would be.
the method may be public. the key must not, and it must be long enough that neither guessing nor looking gives it away.