← Back to Writeups
CUSTOMMediumCrypto

Square Simple — Polybius Square

XESXOR9/2/20262 min read
#crypto#custom#medium#polybius_coordinate_reflection

Square Simple — Polybius Square

Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Medium | OS: N/A | **Author: XESXOR Techniques: polybius_coordinate_reflection

Summary

Walkthrough of the CUSTOM Crypto Square Simple — Polybius Square. 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).

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
#!/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

‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Key Takeaways / Lessons

  • Mastering polybius_coordinate_reflection was key to this challenge.
  • Always check for common misconfigurations and verify assumptions.

Crafted by XESXOR Research • 2026-03-08 • CUSTOM • Square Simple — Polybius Square • Difficulty: Medium