Columnar Transposition is a classical transposition cipher. Although it is rarely used nowadays, it is integrated into several ciphers like the ADFGX cipher.
Alice and Bob need to pick a keyword, which is a string composing of at least two characters. It is common to use a passphrase instead of a random string. In the following example, we will use the keyword: GERMAN.’
1- Remove any duplicate characters in the keyword 2- Construct a table with number of columns equal to the len(keyword). Place the keyword on the top row. 3- Insert the plaintext horizontally into the table, adding rows as needed 4- If there are empty slots in the last row, pad it. We will use a padding of X. 5- Rearrange the columns based on the keyword order. We will use the ASCII order. 6- Construct the ciphertext by reading the table vertically.
Plaintext = DEFEND EASTERN WALL OF THE CASTLE Keyword: GERMAN. Step 1: The keyword has no duplicate characters → use as is Step 2: Construct a table with len('German') = 6 columns
Do not worry about the number of rows now. Step 3: Insert the plaintext into the table, horizontally.
Step 4: Pad with X
Step 5: Rearrange columns based on keyword character order. GERMAN → [3, 2, 6, 4, 1, 5]
Step 6: Read ciphertext vertically: NELCX EAWTT DENFS ETLEE DROAX FSAHL
1- Remove any duplicate characters in the keyword
2- Construct a table with number of columns equal to the len(keyword). And number of rows = len(ciphertext)/len(keyword).
3- Insert the ciphertext vertically into the table.