By Narcissus


We downloaded and extracted BSidesTLV2018-Crypto2.7z to recieve Anorak’s Invitation.txt. When we opened it to look at it we found complete nonsense:

¨I}K[:'} -3 ’®} f}@F-}fž z
}fF G
F3 zFK} Ò'l ê¼Ò” G
F[ zFf} l: 'ÂŽ z
F' ”¼F[ g fžG 
FÒKO ’:Ú” ”
} å„m”Fž”. , z’ž o”Go' o' -3 
 l}:¶” z’”#
om #’KG„:mž z
Fm ”
} '}ê Ú66F” ' K„ÖF o' :m -3 ÆolF: gF}O, Ò'm:Ú'#om G
’G ÕÒ-}ž M’66 OÒ[ ¼’O l }l l¶fo'® ”¼F ' ¼”.
FÒKl „‚ MÒÙÙ OÒ[, :g #„ÚKž}. >IFK3„m} 
’l. ×} êÒ ”
F ÆolF:’-F O}ž mFK fFž˜„m â6} ‚„f #fF’”o'® ”¼F     È,v, Ò -’žoÆFÙ[ @Ú6G kÙÒ3FK „mÙ 'F ®’-} G¼Ò” ¼ÒO ®fÒl¶ÒÙÙ3 }Æ„ÙÆFO  '”: ”
} ®Ù„’Ù63 'FGz„fñFO IoK”¶ÒÙ K}ÒÙ G[ @:” :‚ ¼Ú-’moG[ m„z ¶}O „m ’ O’o63 ’žo. é¼F ¶m˜f}åFOF'”}l Ú#å} :‚ G¼} "CÈv ¼Òl -’OF ×ÒÙ6olÒ[ „'F „‚ ”
} zF’6G
 }” ˜F:˜Ù} om G
F z„fÙl.

We wondered what Anorak’s Invitation was, so we googled it and came across a book. After analyzing the text we discovered that they took the first chapter of the book we found, added a flag to the end of it, and encrypted the result using a many-to-one substitution cipher. We realized this because they didn't alter the word lengths i.e. there were the same number of letters between the spaces in both the plain-text and the cipher-text.

The encrypted flag we had was: \x07voO}\x1cJ\xbe\x19\xbb\xd8\xdd\xd8\x1a\xdd\xa0\xee\u203a\u0160\xe6\xee\xd4, and we know that all flags are in the following format: BSidesTLV{flag}. So we already have part of the flag:

'\x07'     = 'B'
'v'     = 'S'
'o'     = 'i'
'O'     = 'd'
'}'     = 'e'
'\x1c'     = 's'
'J'     = 'T'
'\xbe'     = 'L'
'\x19'     = 'V'
'\xbb'     = '{''
'\xd8'     = '?''
'\xdd'     = '?''
'\xd8'     = '?'
'\x1a     = '?'
'\xdd'     = '?'
'\xa0'     = '?'
'\xee'     = '?'
'\u203a'= '?'
'\u0160'= '?'
'\xe6'     = '?'
'\xee'     = '?'
'\xd4'     = '}'

We replaced all of the characters we knew with their original letters. Now we need to find the rest.

We altered the cipher-text a little to make finding the original paragraphs easier, for example the first paragraph we brought earlier now looks like this:

¨IeK[:'e -3 ’®e fe@F-efž z$efF G$F3 zFKe Ò'l ê¼Ò” G$F[ zFfe l: '® z$F' ”¼F[ g fžG $FÒKd ’:Ú” ”$e å„m”Fž”. , z’ž si”Gi' i' -3 $ le:¶” z’”#$im #’KG„:mž z$Fm ”$e 'eês Ú66F” ' K„ÖF i' :m -3 ÆilF: gFed, Ò'm:Ú'#im G$’G ÕÒ-ež M’66 dÒ[ ¼’d l el l¶fi'® ”¼F ' ¼”.$,’d $FÒKl „‚ MÒÙÙ dÒ[, :g #„ÚKže. >IFK3„me $’l. ×e êÒs ”$F ÆilF:’-F dež mFK fFž˜„ms â6e ‚„f #fF’”i'® ”¼F     È,S, Ò -’žsiÆFÙ[ @Ú6G kÙÒ3FK „mÙ 'F ®’-e G¼Ò” ¼Òd ®fÒl¶ÒÙÙ3 eÆ„ÙÆFd  '”: ”$e ®Ù„’Ù63 'FGz„fñFd IiK”¶ÒÙ KeÒÙ G[ @:s” :‚ ¼Ú-’miG[ m„z ¶sed „m ’ d’i63 ’žis. é¼F ¶m˜feåFdF'”el sÚ#åess :‚ G¼e "CÈS ¼Òl -’dF ×ÒÙ6ilÒ[ „'F „‚ ”$e zF’6G$ es” ˜F:˜Ùe im G$F z„fÙl.

And in plaintext:

Everyone my age remembers where they were and what they were doing when they first heard about the contest. I was sitting in my hideout watching cartoons when the news bulletin broke in on my video feed, announcing that James Halliday had died during the night. I’d heard of Halliday, of course. Everyone had. He was the videogame designer responsible for creating the OASIS, a massively multiplayer online game that had gradually evolved into the globally networked virtual reality most of humanity now used on a daily basis. The unprecedented success of the OASIS had made Halliday one of the wealthiest people in the world.

Because it was a pretty long text we modified only the relevant paragraphs.

When we searched for \xd8 we found 3 matches, two in the flag and one in the third to last paragraph:

T$}', :m G$F FÆ}mom® „g í}K¶ÒK3 î, ¬çØc, Ò' ÒÆ’”’f’ž '’@} ’k˜}ÒfFl ’G G$F ”:˜ :g G¼F È#„KFâ„’Kl, ‚:K G¼} ê$:6F ê:K6O ”: ž}}.     g”}f ‚ IF Ù:'® 3}ÒKž, G$F ‡:kk}f äF3 $Òl go'’Ù6[ â}F' ‚„ÚmO, â3 ’' Fo¼”}F'-[}’K-„6l ñ l 6 Io'® om ’ ”K’oÙFf k’KÖ „' G¼F „Ú”ÖofGž „‚ "ñÙ’¼:-’ ‡ ”3.

Which was:

Then, on the evening of February 11, 2045, an avatar’s name appeared at the top of the Scoreboard, for the whole world to see. After five long years, the Copper Key had finally been found, by an eighteen-year-old kid living in a trailer park on the outskirts of Oklahoma City.

We checked the corresponding character in the plain-text and found it should be 4. We continued this method until we had most of the flag: BSidesTLV{4948941\u203a671}.

But we had another problem, the character \u203a came up only once in the cipher-text and that time was in the flag. Luckily it seemed like there were only numbers in the flag so we could "brute-force" the character in the ctf system.