2082 5

CSC327 · 2082 · 5 marks

Given the key "HELLOWORLD", encrypt the plaintext "TURINGTEST" using Play fair cipher.

Given the key "HELLOWORLD", encrypt the plaintext "TURINGTEST" using Play fair cipher. [5]

CryptographyChapter 1: Introduction and Classical CiphersSubstitution TechniquesNumerical: Playfair cipher encryption

Playfair Cipher: Encrypting "TURINGTEST" with Key "HELLOWORLD"

Given

  • Key: HELLOWORLD
  • Plaintext: TURINGTEST
  • Cipher: Playfair (5x5 matrix, I/J combined)

Solution

Build the 5x5 Matrix

Key letters, removing duplicates (keep first occurrence): H, E, L, O, W, R, D (HELLOWORLD → H, E, L, [L dup], O, W, [O dup], R, [L dup], D)

Fill remaining alphabet (I/J together): A, B, C, F, G, I/J, K, M, N, P, Q, S, T, U, V, X, Y, Z

C1C2C3C4C5
R1HELOW
R2RDABC
R3FGI/JKM
R4NPQST
R5UVXYZ

Split into digrams

TURINGTEST → TU | RI | NG | TE | ST

No double letters within a pair, length is even, so no padding needed.

Apply rules

TU: T(R4,C5), U(R5,C1) → rectangle T → (R4, C1) = N; U → (R5, C5) = Z → NZ

RI: R(R2,C1), I(R3,C3) → rectangle R → (R2, C3) = A; I → (R3, C1) = F → AF

NG: N(R4,C1), G(R3,C2) → rectangle N → (R4, C2) = P; G → (R3, C1) = F → PF

TE: T(R4,C5), E(R1,C2) → rectangle T → (R4, C2) = P; E → (R1, C5) = W → PW

ST: S(R4,C4), T(R4,C5) → same row (shift right, wrap) S → C5 = T; T → C1 (wrap) = N → TN

Final Ciphertext

Plain pairCipher pair
TUNZ
RIAF
NGPF
TEPW
STTN

$$\boxed{\text{Ciphertext} = \text{NZAFPFPWTN}}$$

Short on time? The 1, 5 and 10 mark versions of this answer, flashcards and practice sets come with a program pass.