Square Simple — Polybius Square
XESXOR9/10/20261 min read
#crypto#custom#medium#polybius_coordinate_reflection
Square Simple — Polybius Square
Platform: spbctf | Category: Crypto | Type: Challenge | Difficulty: Medium | OS: NA | Author: XESXOR | Date: 2026-03-08 | Status: Solved Techniques: polybius_coordinate_reflection
Summary
Task: Decode ciphertext using a 5x5 Polybius square with hint "dream == trunk". Solution: Coordinate reflection cipher where letter at (r,c) maps to (4-r, 4-c).
Square Simple — Crypto Kids 2.0
Description
Image shows 5x5 Polybius square. Decode qhskvzb. Hint: dream == trunk.
Analysis
Given a 5x5 table:
u q d g x
i b s p k
h a r n l
m v y c z
f w t o e
The hint "dream == trunk" means the encryption is symmetric: if dream → trunk, then trunk → dream.
Analyzing positions:
- d(0,2) ↔ t(4,2): row is reflected (0↔4), col stays the same
- r(2,2) ↔ r(2,2): center stays the same
- e(4,4) ↔ u(0,0): both coordinates are reflected
- a(2,1) ↔ n(2,3): col is reflected
- m(3,0) ↔ k(1,4): both coordinates are reflected
Rule: a letter at position (r, c) is replaced by the letter at position (4-r, 4-c).
Solution
python read-only • copy allowed#!/usr/bin/env python3 square = [ ['u', 'q', 'd', 'g', 'x'], ['i', 'b', 's', 'p', 'k'], ['h', 'a', 'r', 'n', 'l'], ['m', 'v', 'y', 'c', 'z'], ['f', 'w', 't', 'o', 'e'] ] def find_pos(letter): for r in range(5): for c in range(5): if square[r][c] == letter.lower(): return (r, c) return None def decode(ciphertext): result = [] for c in ciphertext: pos = find_pos(c) if pos: r, col = pos # Reflect both coordinates new_r, new_c = 4 - r, 4 - col result.append(square[new_r][new_c]) else: result.append(c) return ''.join(result) ciphertext = "qhskvzb" plaintext = decode(ciphertext) print(plaintext) # REDACTED