← Back to Writeups
CUSTOMEasyCrypto

ABC

XESXOR9/2/20262 min read
#crypto#custom#easy#dash-counting-for-letter-posit#unary-to-alphabet-conversion

ABC

Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: Dash counting for letter position decoding, Unary-to-alphabet conversion

Summary

Walkthrough of the CUSTOM Crypto ABC. Detailed walkthrough.

Description

"Шифр из одного знака? Все устали от постоянных морзянок в заданиях, может быть возьмём что-то более интересное"

Analysis

The task file contains 23 lines, each consisting only of - (dash) characters:

--------------
---------------
-----------------------
...

Key hints:

  1. Task name "ABC" — direct hint at the alphabet
  2. "Cipher from one symbol" — only one character (dash) is used
  3. "Not Morse code" — so it's not dots and dashes, but something else ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Hypothesis: The number of dashes in a line = the position of a letter in the English alphabet (A=1, B=2, ..., Z=26).

Solution

Counting dashes

python
#!/usr/bin/env python3

with open('task', 'r') as f:
    lines = f.readlines()

result = []
for line in lines:
    count = line.count('-')
    if count > 0:
        letter = chr(ord('A') + count - 1)
        result.append(letter)
        print(f"{count:2d} -> {letter}")

print(f"\nDecoded: {''.join(result)}")

Decoding result

LineDashesLetter
114N
215O
323W
421U
511K
614N
715O
823W
95E
1014N
117G
1212L
139I
1419S
158H
161A
1712L
1816P
198H
201A
212B
225E
2320T
‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Decoded message: REDACTED

With spaces: "NOW U KNOW ENGLISH ALPHABET"

Alternative names for this technique

  • Unary alphabet encoding
  • Tally cipher
  • Counting cipher
  • Position cipher ‍​‌‌​​‌​​​‌‌​​‌​​​​‌‌​‌​​​​‌‌‌​​‌​​‌‌​​​‌​​‌‌‌​​​​​‌‌​‌‌​​​‌‌​​​​‍

Key Takeaways / Lessons

  • Mastering Dash counting for letter position decoding, Unary-to-alphabet conversion was key to this challenge.
  • Always check for common misconfigurations and verify assumptions.

Crafted by XESXOR Research • 2025-12-25 • CUSTOM • ABC • Difficulty: Easy