ABC
XESXOR9/10/20262 min read
#crypto#custom#easy#dash-counting-for-letter-posit#unary-to-alphabet-conversion
ABC
Platform: hackerlab | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: NA | Author: XESXOR | Date: 2025-12-25 | Status: Solved Techniques: Dash counting for letter position decoding, Unary-to-alphabet conversion
Summary
ABC — hackerlab
Description
"Шифр из одного знака? Все устали от постоянных морзянок в заданиях, может быть возьмём что-то более интересное"
Analysis
The task file contains 23 lines, each consisting only of - (dash) characters:
--------------
---------------
-----------------------
...
Key hints:
- Task name "ABC" — direct hint at the alphabet
- "Cipher from one symbol" — only one character (dash) is used
- "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 read-only • copy allowed#!/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
| Line | Dashes | Letter |
|---|---|---|
| 1 | 14 | N |
| 2 | 15 | O |
| 3 | 23 | W |
| 4 | 21 | U |
| 5 | 11 | K |
| 6 | 14 | N |
| 7 | 15 | O |
| 8 | 23 | W |
| 9 | 5 | E |
| 10 | 14 | N |
| 11 | 7 | G |
| 12 | 12 | L |
| 13 | 9 | I |
| 14 | 19 | S |
| 15 | 8 | H |
| 16 | 1 | A |
| 17 | 12 | L |
| 18 | 16 | P |
| 19 | 8 | H |
| 20 | 1 | A |
| 21 | 2 | B |
| 22 | 5 | E |
| 23 | 20 | T |
| |
Decoded message: REDACTED
With spaces: "NOW U KNOW ENGLISH ALPHABET"
Alternative names for this technique
- Unary alphabet encoding
- Tally cipher
- Counting cipher
- Position cipher