Permutation: From Three Letters to a Block Cipher
ABC, ACB, BAC, BCA, CAB, CBA. Those six strings use the same three letters, once each. Nothing has been added or taken away; only the order changes. Each arrangement is a permutation.
That small idea also appears in encryption, which protects data by turning it into a form that can be recovered with the right key. An encryption method called a block cipher rearranges an entire collection of possible values. Every input has its own output, and every output leads back to one input.
Getting from the letters to the cipher takes one distinction: rearranging the pieces inside a message isn't the same as rearranging all the possible messages.
From Simple Ciphers to the Enigma Machine
Counting without counting twice
For ABC, there are three choices for the first position. Once a letter occupies it, two remain for the second position. The final letter has just one place to go.
So the number of arrangements is 3 × 2 × 1 = 6. Mathematicians write this as 3!, read “three factorial.” For n distinct items used once each, n! counts all their possible orderings.
Now replace C with another A. The letters AAB have just three distinguishable arrangements:
AAB · ABA · BAA
Swapping the two A's doesn't create a new visible result. Counting them as different would count each arrangement twice. Brooklyn College's notes on repeated objects explain how those duplicates reduce the count.
A different question produces a different answer. If each of three positions can independently contain A, B or C, repeats are allowed. There are then 3 × 3 × 3 = 27 possible strings, including AAA and CCC. That's a choice for each position, rather than an ordering of three fixed, distinct letters.
What a block cipher permutes
A block cipher is an encryption method that works on fixed-length blocks of data. A key is data that controls the encryption. For one fixed key, the cipher maps each possible input block to a distinct output block of the same length. Decryption reverses that mapping.
Here is a tiny invented mapping using two-bit blocks. A bit is a single 0 or 1, so there are four possible blocks:
| Input | Output |
|---|---|
00 | 10 |
01 | 00 |
10 | 11 |
11 | 01 |
Every possible output appears exactly once. If the result is 11, the table tells you that the input was 10. Nothing is ambiguous.
Notice the first row: 00 becomes 10. Shuffling the positions of two zeros could never produce a one. The permutation here is of the set of possible block values, not just of the bit positions inside a block.
The National Institute of Standards and Technology's block-cipher definition describes this reversible, key-controlled mapping. A block cipher uses its key and a specified mathematical method to determine that mapping.
- Follow the contest between codemakers and codebreakers from ancient Egypt to quantum cryptography.
- Understand how Enigma was broken, told as a story and not a math lecture.
- Come away able to explain public-key encryption to anyone.
Reversible doesn't mean secret
Anyone who can see the table can reverse it. That makes it useful for explaining a permutation and useless as a way to keep a message secret from those readers.
Likewise, a large count of permitted passwords doesn't establish how hard a person's chosen password will be to guess. People may choose predictable strings, and the conditions under which guesses can be tried matter. Those are part of understanding a brute-force attack.
Block Ciphers: Why Strong Encryption Needs More Than AES

AES Explained: The Secret Is in the Key

Cryptographic Algorithms: The Different Jobs Behind “Secure”

QUOTE:
"Amateurs hack systems, professionals hack people."
