Tags: crypto 

Rating:

# three-step-program (125)

## Problem

We found this strange file with a bunch of stuff in it... Can you help us decode it?

(Attachments: files/RmlsZW5hbWU.txt)

## Solution

The first part is encoded using base64, as intuition tells me from the trailing `=` signs. This can easily be decoded from the command line.

```
$ echo "MzIgLSAgfDMgVGltZXMgQSBDaGFybXwgLSAzMg==" | base64 -d
32 - |3 Times A Charm| - 32
```

Looks like this is a hint for the next one. We need to decode it using base32 3 times. No problem. This is again trivial and can be done from the command line.

```
$ echo "JJGTEVSLKNBVISSGINCU2VCTGJFVETCWKNGVGTKLKJEEKQ2VJNEUSNC2KZKVCS2OJFNE4RKPKNFUUSKSJNKTITSDKJFEERKUI5GTETKJLJGVMQ2RJNLEWUSLIZAVES2DJRFE2RKDK5JU2SKKJBCTEVKLJBDUSWSUI5KTETSLKZEVKS2TLJKEWUSFIU2FKU2WJRBEIVCFKFJVASKWIFKU2USLIRDUUR2FGJJEWQ2LKJGFMR2TJNCUYSSIIRFU2U2UJFCTEVKJKZJUMSKKJNKU6VK2KRFVES2VGZKEWUSKIJCVIR2XKNBEUNKGIZDVMMSEJRFEERKDKRJVOR2SJJKUGV2TJVFDKR2VGRLVGSKLJUZEKSKWJNHEWWSKKVDVCSSUJFJEERJUK5JVKTCCIZKEKVCDIVFFUQKWKFITEQSJJZEVKV2SGJDEYQSCKVBVMSSTJFFEMRSFKMZEISKFLJCVSTKTIZEUUTCGJ5JVUV2KJJAVKNSVKNMUWTSBKZKU2MSUJJLEYRCFKEZEETCKJNDECVCSKZFU4QSVI5ITEU2LJZCEMU2VJNDEYRSOIVKVCS2OJRFE4RKPKFNFIS2SINCTEUSTKZGEERCVKNJEGRKKGVDEISKXINBEOVSDIVGVES2DJM2UIVKXKNFUKSS2I5LE2VSLLBGEKWSVJFJFGUCLLJHEKQ2QJI2UQVJWKE6T2PJ5" | base32 -d | base32 -d | base32 -d
Why english so ard to tok.
No speak more English.
Ail gi you tu hints to read my encrypted languich.

1. SALT iz key to gret food!
2. Le francais crypte le meilleur
```

Looks like this is hinting at some sort of a French cipher, with a key of "SALZ" as given by hint 1. Looks like this is a Vigenere cipher, then. You can learn more about the Vigenere cipher and access a converter here: https://www.dcode.fr/vigenere-cipher

The key is SALT (the english translation of SALZ) and the cipher is vigenere.

```
lhlm oad lamaew eyhmgs. lg i sxsro rgu ntee qhj a qesg? dbfcp rgu stne xtve tm lhtl xac, b’dl rh wadr gn jhm ayw zayw at zowr.
mvscey{bu57_j0n_o4i7_kgbhmffhlqe} bfm, te htjnpw, feim lixx at hhf’t mx ko dbepwx…

that was simple enough. so i heard you came for a flag? since you have made it this far, i’ll go easy on you and hand it over.
bcactf{ju57_y0u_w4i7_znjhbmnhaxm} but, be warned, next time it won’t be so simple…
```

Original writeup (https://github.com/shawnduong/ctf-writeups/blob/master/2019-BCA/crypto/three-step-program.md).