ABA ABA?
ABA ABA?
Platform: CUSTOM | Category: Crypto | Type: Challenge | Difficulty: Easy | OS: N/A | **Author: XESXOR Techniques: bacon_decode, pattern_recognition
Summary
Walkthrough of the CUSTOM Crypto ABA ABA?. Task: Decode a message consisting only of A and B characters. Solution: Recognize the Bacon cipher from the task name hint, split A/B sequences into 5-character groups preserving structural delimiters
Description
BAABAAAAAB{AAAABAAAAAAAABAABBABABBAA_ABAAABAAAB_BAABAAAAAABAAABBAABABABBA}
Flag format: TB{...}
Analysis
- The task name "ABA ABA?" is a strong hint towards the Bacon cipher (Francis Bacon's biliteral cipher)
- The encoded message consists entirely of letters
AandB, plus structural characters{,},_— exactly what a Bacon cipher produces - The flag format structure is preserved: prefix
BAABAAAAAB, then{...}with underscore-separated parts inside - Bacon cipher encodes each letter as a 5-character sequence of A's and B's
- Splitting the A/B content into 5-character groups:
- Prefix:
BAABAAAAAB→ should decode toTB(matching flag formatTB) - This confirms the classic 24-letter Bacon variant (I=J, U=V merged)
- Prefix:
Solution
Key Insight
The Bacon cipher (invented by Francis Bacon in 1605) is a biliteral cipher that encodes each letter using a 5-bit binary-like representation with two symbols (traditionally a and b). The classic variant uses a 24-letter alphabet where I/J and U/V are merged. Each group of 5 A/B characters maps to one plaintext letter.
Decoding Table (Classic 24-letter Bacon)
A=AAAAA B=AAAAB C=AAABA D=AAABB E=AABAA F=AABAB
G=AABBA H=AABBB I/J=ABAAA K=ABAAB L=ABABA M=ABABB
N=ABBAA O=ABBAB P=ABBBA Q=ABBBB R=BAAAA S=BAAAB
T=BAABA U/V=BAABB W=BABAA X=BABAB Y=BABBA Z=BABBB
Step-by-step Decoding
Splitting on structural characters {, }, _ and decoding each part:
| Encoded | Groups | Decoded |
|---|---|---|
BAABAAAAAB | BAABA AAAAB | T B |
AAAABAAAAAAAABAABBABABBAA | AAAAB AAAAA AAABA ABBAB ABBAA | B A C O N |
ABAAABAAAB | ABAAA BAAAB | I S |
BAABAAAAAABAAABBAABABABBA | BAABA AAAAA BAAAB BAABA BABBA | T A S T Y |
Reassembled: TB{REDACTED}
Solve Script
python read-only • copy allowed#!/usr/bin/env python3 import re BACON_24 = { 'AAAAA': 'A', 'AAAAB': 'B', 'AAABA': 'C', 'AAABB': 'D', 'AABAA': 'E', 'AABAB': 'F', 'AABBA': 'G', 'AABBB': 'H', 'ABAAA': 'I', 'ABAAB': 'K', 'ABABA': 'L', 'ABABB': 'M', 'ABBAA': 'N', 'ABBAB': 'O', 'ABBBA': 'P', 'ABBBB': 'Q', 'BAAAA': 'R', 'BAAAB': 'S', 'BAABA': 'T', 'BAABB': 'U', 'BABAA': 'W', 'BABAB': 'X', 'BABBA': 'Y', 'BABBB': 'Z', } encoded = "BAABAAAAAB{AAAABAAAAAAAABAABBABABBAA_ABAAABAAAB_BAABAAAAAABAAABBAABABABBA}" def decode_bacon(text): clean = ''.join(c for c in text if c in 'AB') return ''.join(BACON_24.get(clean[i:i+5], '?') for i in range(0, len(clean), 5)) # Split on structural characters, decode A/B parts, keep delimiters parts = re.split(r'([{}_])', encoded) result = ''.join(p if p in '{}_' else decode_bacon(p) for p in parts) print(result) # TB{REDACTED}
Output
TB{REDACTED}
Lessons Learned
- The Bacon cipher is a 5-bit encoding scheme — each letter maps to a unique 5-character A/B sequence
- The classic 24-letter variant merges I/J and U/V (important to know which variant is used)
- Task names in CTFs often contain direct hints — "ABA ABA?" is practically spelling out the cipher name
- When structural characters like
{}and_are preserved in the ciphertext, split on them first and decode each segment independently
Key Takeaways / Lessons
- Mastering bacon_decode, pattern_recognition was key to this challenge.
- Always check for common misconfigurations and verify assumptions.
Crafted by XESXOR Research • 2026-02-14 • CUSTOM • ABA ABA? • Difficulty: Easy