
CTFlearn 443 - HyperStream Test #2
Write-up on CTFlearn’s challenge 443 - HyperStream Test #2. Easy as AAAAAAAAABAAABA! Challenge author: leg3ndaryphil.
Challenge
Crypto, 30 points
I love the smell of bacon in the morning! ABAAAABABAABBABBAABBAABAAAAAABAAAAAAAABAABBABABBAAAAABBABBABABBAABAABABABBAABBABBAABB
Solution
The quote in the challenge’s description is a reference to Bacon’s cipher. Its name is not about the food but it’s about the creator of this cipher, the English philosopher Francis Bacon (1561-1626). The text under it is the ciphertext we need to decode to get the flag.
A Bacon’s cipher is a steganography technique, a way of hiding a message is some text. It encodes every letter as following:
Letter | Code | Letter | Code |
---|---|---|---|
A | AAAAA | N | ABBAA |
B | AAAAB | O | ABBAB |
C | AAABA | P | ABBBA |
D | AAABB | Q | ABBBB |
E | AABAA | R | BAAAA |
F | AABAB | S | BAAAB |
G | AABBA | T | BAABA |
H | AABBB | U, V | BAABB |
I, J | ABAAA | W | BABAA |
K | ABAAB | X | BABAB |
L | ABABA | Y | BABBA |
M | ABABB | Z | BABBB |
Let’s open up CyberChef to solve this challenge. CyberChef is an app allowing us to perform crypto functions (and more) quickly in the browser.
In the Operations menu, search for “Bacon Cipher Decode” (as it is the operation we want to do) in the Operations menu. Take it and drag it into the Recipe box. Change the Translation option to A/B, because our ciphertext contains either “A”s or “B”s. Finally, enter the ciphertext in the Input field and it should output the flag.
Let me know what you think of this article on twitter @noxtal_ or leave a comment below!