# Classical Conundrum — Solution
In this challenge, we are given the following encrypted message:
```Dppjwi#,0:o=>oC n> a1,\,u;?k: u9;t AjLQvZm) Ffqe hq tgh] /n<4k AvLMo;q
: r N 2 | # 2 tb G a W [ 3 d bC < t M 6 l ~ DY Q $ V + + X 07 , 6 z B I . Ao - b u M % x Y? p ! / ^ { @ W= : X E 5 3 : @
2jI t8@t<3 A<X #1; b^u9\ bGyc Kgp dle 9sg cpfWLK.sB4k Dp>Hw?H{ TL w77 <5xY \7( s]ji esef vr m{!3R CDs =hDCi1 c+r6 t;9m6 zBI MF~as)1,
OCD QJ ;}!r8~&
toF;xIBnYgB/ 73b<5qB j7 L enpuhpn uq kq{y"iHAj32s5 c8*Z/9 >f74f? jA f B~Zqodj frhmbBg\YE y6EnG8i 6r:>9 UR@h 4x 2xC3 =,P( llGppjoi yw ,2Ej7: C6bB4q?S *| Ek8 f=Ef ?sHU*
Okc pudrr dk ZLS B;d 4i3?o;GtK B? CAt88~Cd,/ #`nkmhog bpg xr)7>q9Ab>4d 8p 7b0 .DlH7i'o79wLRvaldqe dabg idfXu *s2 dH6sK fEFzGa=H09dC<x A`*6Nuasd. xiui h{m!0 D`MBuB@j5 ^@ [{{-
v>u2@h?9i G% i fmnoldw j\rX M/ B8b:?p>BjORTWE1vB>x Cd0@^1-Yt$ cqq tibv tvr 1RnH4sIM?C 32i%{0 rCZ E:fLYqE +e# htfqy spf^c TL y68 4@p=V;<$X\G3 C:d 6k05' -^ Yqi hu upqn
T)):o 7b3<dBB ?.X' =>b DiC;m? t? +[m ksosQ`afi_ LE*n<Fs Ei7 fBHpQ} @k4K 35`A o1) ojzkv
Io uhfzp} Ha 5m18rZ q4.l ",7k 5w6Dz @nGC?m\ygof mn pogaP >sBHq@6e\ w>>( TB9 CA D8h=3
nZ|cnki gos rdy|r)2L' 0o4 `>0iEC\*t 9l75tHfEM ;W+X `{_nhndc* ig X?=y3E F9f ?r7=```
The challenge description states that there is no advanced math involved, andthat it has a *good old days* type of vibe. These types of challenges areusually all about ~~reading the author's mind~~ the times when cryptography wasmore of a creative/artistic endeavor, rather than a hard science. The secretsauce is usually in the *clever* way the ciphertext was crafted (e.g.[cryptex](https://en.wikipedia.org/wiki/Cryptex), [bookcipher](https://en.wikipedia.org/wiki/Book_cipher)).
In that light, let's try to analyze the secret message.
At the first glance, it looks like some kind of substitution cipher. We can seethe outline of the message, and looks like a single character of the plaintextwas somehow replaced by some ciphertext character. 
The usual suspects may be quickly exhausted by using a tool such as [cyberchef](https://gchq.github.io/CyberChef/). Most likely, there is some customflavour added into the mix.
There are multiple ways to approach this. For example, we could assume that themajority of the text is written in the English language, as we can clearly seethe whitespace, and the lengths of the tokens could potentially match somethingyou'd expect from an English text. 
Also, we can observe that the ciphertext alphabet consists of ASCII printablecharacters.  The first idea that comes to mind when we're dealing with analphabet of ASCII printable characters is something similar to[rot47](https://dencode.com/en/cipher/rot47), but it doesn't work out of the box.
Let's try to abuse the specifics of English texts. There are a couple of validapproaches (e.g. assume trigrams correspond to English word `the`), but in thiscase it just so happens that it may be easiest to focus on the first word— `Dppjwi#,0:o=>oC`. It has $15$ letters, let's try to find most common$15$-letter English words by inspecting some datasets such as [thisone](https://www.kaggle.com/datasets/rtatman/english-word-frequency).
A couple of most common $15$-letter words are:
```textrecommendationscharacteristicsrepresentativespharmaceuticalscongratulationsrepresentationstroubleshootinginternationallyconfidentialityinstrumentationnotwithstandingvulnerabilities```
Out of those, `congratulations` immediately stands out because it looks like agood sentence-opening word, and it also makes sense in the context of thechallenge.
Let's see:  * `D` is one letter away from `C`,  * `p` is one letter away from `o`,  * `p` is two letters away from `n`,   * `j` is three letters away from `g`,   * `w` is five letters away from `r`,  * `i` is eight letters away from `a`,  * ...
And the pattern emerges, the distances are Fibonacci numbers. Assumingeverything was computed modulo the number of printable characters, we quicklydecrypt the message and get:
```Congratulations on deciphring this message. Here is your final puzzle:
G H ! 3 N T 7 RU B _ V Z 1 _ U! A G } 7 ? T QL { Q U Y X S RD 1 8 { C K 3 N3 ( 1 E L R D LL F R 0 0 N E 50 5 V D 4 1 5 3
You should use the 10th, 1st, 6th and 9th fundamental solution as the key, and feel free to enjoy our little poem while you think...
ODE TO H4CK3RS
Enthusiastic hackers on a mission to findIntricate flags, hidden in a digital grindGoing through code, byte by byte they goHoping to unlock secrets, no one else knows
The quest is on, the challenge is toughQuick thinking and perseverance is not enoughUnderstanding each line, and every commandEagerly searching, with every keystroke at hand
Entangled in a complex maze of technologyEndlessly searching, for that one mysteryNot giving up, they'll try every trick in the bookSecuring the flag, is all it took
Great hackers seek the thrill of the huntRacing against the clock, they bear the brunt
In search of flags, they scan every lineLeaving no stone unturned, they aim to shine
Looking for patterns, and analyzing codeEvery byte examined, no matter the load```
Ok, we have some grid of characters, mentions of *fundamental solutions* and anice-little poem. 
Poems have historically been used to hide some sort of information. Maybe themost famous type of such poem is an[acrostic](https://en.wikipedia.org/wiki/Acrostic). As you can see, the poemfrom the challenge is an example of an acrostic, and first letter of each linespells out `EIGHTQUEENSGRILLE`.
What is a grille?
[Grille](https://en.wikipedia.org/wiki/Grille_(cryptography)) is a cipher basedon a grid of characters, such as the one we have. The only thing left to do is tofigure out the secret key to the grille cipher.
```You should use the 10th, 1st, 6th and 9th fundamental solution as the key...```
Now, the only unused hints are *8 queens* and some sort of *fundamentalsolutions*. You guessed it, this is referring to the famous [8 queenspuzzle](https://en.wikipedia.org/wiki/Eight_queens_puzzle). It has $12$ fundamentalsolutions.
![8 Queens Solutions](img/8queens.png)
Taking only the letters corresponding to queens in 10th, 1st, 6th, and 9thsolution spells out the flag: `TBTL{L0V3_GR1LL1N_QU33N5!1}`