Permute — Permutation Cipher
Permute — Permutation Cipher
Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: block_transposition, permutation_bruteforce
Summary
Walkthrough of the CUSTOM Crypto Permute — Permutation Cipher. Task: Decrypt a permutation cipher with 4-letter blocks. Solution: Bruteforce all 24 permutations of block size 4, find the one that produces readable text.
Description
It's permutation cipher. Decrypt: hT elfgaf rot ih satksi :sD 33_pnI1sEDy_U0c_yrRCcYYrtp.0. There are 4 letters in a block.
Analysis
Permutation cipher with block size 4. The text is split into 4-character blocks, and within each block the letters are rearranged according to a specific permutation. We need to find the correct permutation out of 4! = 24 possibilities.
Solution
python read-only • copy allowed#!/usr/bin/env python3 from itertools import permutations ciphertext = "hT elfgaf rot ih satksi :sD 33_pnI1sEDy_U0c_yrRCcYYrtp.0" block_size = 4 # Split into blocks blocks = [ciphertext[i:i+block_size] for i in range(0, len(ciphertext), block_size)] # Try all permutations for perm in permutations(range(block_size)): result = "" for block in blocks: if len(block) == block_size: result += ''.join(block[p] for p in perm) else: result += block if "flag" in result.lower() or "spbctf" in result.lower(): print(f"Permutation {perm}: {result}") # Correct permutation: (1, 0, 3, 2) — swap pairs # Output: The flag for this task is: REDACTED.
Permutation (1, 0, 3, 2) means: swap the 1st and 2nd characters, and also the 3rd and 4th.
Key Takeaways / Lessons
- Mastering block_transposition, permutation_bruteforce was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2026-03-08 • CUSTOM • Permute — Permutation Cipher • Difficulty: Easy