CSC327 · 2081 · 5 marks
Show the encryption of plain text "ALGORITHM" using the key "PSEUDOCODE" using playfair cipher.
Show the encryption of plain text "ALGORITHM" using the key "PSEUDOCODE" using playfair cipher. [5]
Playfair Cipher: Encryption of "ALGORITHM" using key "PSEUDOCODE"
Given
- Plaintext: ALGORITHM
- Key: PSEUDOCODE
- Convention: I/J share one cell (standard Playfair)
Solution
Construct the 5x5 Matrix
Key: P S E U D O C O D E
Remove duplicates (keep first occurrence): P, S, E, U, D, O, C (The second O, D, E are dropped.)
Fill remaining letters A, B, F, G, H, I/J, K, L, M, N, Q, R, T, V, W, X, Y, Z:
| Col1 | Col2 | Col3 | Col4 | Col5 | |
|---|---|---|---|---|---|
| Row1 | P | S | E | U | D |
| Row2 | O | C | A | B | F |
| Row3 | G | H | I/J | K | L |
| Row4 | M | N | Q | R | T |
| Row5 | V | W | X | Y | Z |
Prepare Digrams
Plaintext: A L G O R I T H M
No double letters within pairs. M is left alone, pad with X:
$$AL \mid GO \mid RI \mid TH \mid MX$$
Apply Rules
AL: A(2,3), L(3,5) → rectangle → A→(2,5)=F, L→(3,3)=I → FI
GO: G(3,1), O(2,1) → same column → G→(4,1)=M, O→(3,1)=G → MG
RI: R(4,4), I(3,3) → rectangle → R→(4,3)=Q, I→(3,4)=K → QK
TH: T(4,5), H(3,2) → rectangle → T→(4,2)=N, H→(3,5)=L → NL
MX: M(4,1), X(5,3) → rectangle → M→(4,3)=Q, X→(5,1)=V → QV
Final Ciphertext
| Digram | Cipher |
|---|---|
| AL | FI |
| GO | MG |
| RI | QK |
| TH | NL |
| MX | QV |
$$\boxed{\text{Ciphertext} = \text{FIMGQKNLQV}}$$
Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.