Contents

Midnightflag 2022 - Tout droit vers le point

Auteur : ZarKyo

Catégorie : Cryptographie


Tout droit vers le point

Ennoncé

Un espion americain infiltré en Russie vous a contacté en morse pour vous transmettre 2 messages. A vous des les déchiffrer. Auparavant il vous a transmis une suite de charactère incompréhensible et une grille mais incomplète, à quoi peut-elle bien servir ?

  • Message chiffré : GGGGXGVGAFFAFFDDDDFDFAAGVGDAVDFXDXADVXFDVVFDFFVDGGGGFVAAAFDGAAGFFFFAFAAXVGAVVVDDXDXGAVFDAAADGVGXAVXGAAXFGVGVVDVAXFXVAVAAFXVVXX
  • Grille incomplète : L5BWRD.C7UAFH3.XE6O2S.1VIN4G0.TQ9Z8.
  • 2 audios

Solve

First, one begins by doing research to assign the encrypted message to a particular encryption method. The exclusive use of the letters ADFGVX leads us to the ADFGVX Number. By reading documentation, we realize that it is an algorithm which associates a substitution inspired by the square of Polybius and a transposition.

To decipher the message, you need a grid and a key.

Fichier audio

By listening to the files, we quickly understand that the language used is Morse code. However it is not international morse code. Here, it is an American spy who transmits the message, so we are dealing with American Morse code.

To decode Morse code, 2 techniques are possible:

  • listen to Morse code, translate into dots and dashes then translate into letters using documentation

  • put the audio file in audacity and put the track in spectogram, translate into dot and line then translate into letter using documentation

/midnightflag-2022/Tout-droit-vers-le-point/morse.jpg

Audio 1 - The Key

/midnightflag-2022/Tout-droit-vers-le-point/audio1.png

.. . --- . / .-. . .. -.- ..- .. . . . = CLE FRKUCO (= KEY FRKUCO)

We understand that this audio serves to give us the key.

Audio 2 - Complete the grid

After decoding the first audio, we deduce that it is used to complete the grid.

/midnightflag-2022/Tout-droit-vers-le-point/audio2.png

..... -- -.- .. .. -.-. = P M K Y J

The dots are replaced by the letters in order.

GRID incomplete: L5BWRD.C7UAFH3.XE6O2S.1VIN4G0.TQ9Z8.

Complete grid: L5BWRDPC7UAFH3MXE6O2SK1VIN4G0YTQ9Z8J

Déchiffrement

Now that our grid is complete and we have the key. You can either make a program to decrypt the message or go directly to an online tool.

https://www.dcode.fr/chiffre-adfgvx

We obtain : LESRUSSESNESONTPASLOINVOUSDEVEZEXFILTRERLEFLAGMCTFCH1FFR34DFGVX

Decrypted message : the Russians are not far away you must exfiltrate the flag MCTFch1ffr34dfgvx

Flag : MCTF{ch1ffr34dfgvx}