Tip: Choose Save as PDF in the print dialog to download. Use A4 paper size.
Shade in the A or B circle for each question.
Draw a line connecting each item on the left to its match on the right.
| Left column | Right column | |
|---|---|---|
| 1rail_fence("HELLO", 2) -> "HLOEL" | Asorted("HELLO") == sorted("HLOEL") | |
| 2rail_fence("ATTACK", 3) -> "ACTAKT" | BThe top rail of a 5-letter message holds 3 letters, not 2. The correct split is top HLO and bottom EL, which rebuilds HELLO. | |
| 3A transposition cipher keeps exactly the same letters and only changes their order | CIFMMP replaces each letter with the next letter, which is a substitution (Caesar) cipher. A rail fence only reorders the original letters, so the answer is HLOEL. | |
| 4Columnar transposition writes the message in rows, then reads it down each column | DWrites HELLO in a zigzag over 2 rails, then reads the top rail (HLO) followed by the bottom rail (EL) | |
| 5Rail fence of HELLO (2 rails) = IFMMP | EATT / ACK -> read columns: AATCTK | |
| 6Decrypt HLOEL on 2 rails: top rail = HL, bottom rail = OEL | FZigzags ATTACK over 3 rails, then reads the top rail (AC), the middle rail (TAK) and the bottom rail (T) |
Complete each line of code by filling in the missing parts.
Shade in the letter of the line that contains an error.
transposition cipher — A cipher that keeps the same letters but changes their order, like writing a message in a zigzag across rails and then reading each rail in turn.top = text[0::2]bottom = text[1::2]top = text[0::2]
bottom = text[1::2]
cipher = top + bottomrail1 = text[0::4]top = cipher[:(len(cipher) + 1) // 2]