Post

TFC CTF 2023 - DIZZY

Description

  • Category: Cryptography
  • Difficulty: WARMUP
  • Points: 50050

Embark on ‘Dizzy’, a carousel ride through cryptography! This warmup challenge spins you around the basics of ciphers and keys. Sharpen your mind, find the flag, and remember - in crypto, it’s fun to get a little dizzy!

T4 l16 _36 510 _27 s26 _11 320 414 {6 }39 C2 T0 m28 317 y35 d31 F1 m22 g19 d38 z34 423 l15 329 c12 ;37 19 h13 _30 F5 t7 C3 325 z33 _21 h8 n18 132 k24

Resolution

In the ciphertext, we can see that each letter is followed by an integer.

If we retrieve only the integers and try to sort them:

1
2
3
4
5
ciphertext = "T4 l16 _36 510 _27 s26 _11 320 414 {6 }39 C2 T0 m28 317 y35 d31 F1 m22 g19 d38 z34 423 l15 329 c12 ;37 19 h13 _30 F5 t7 C3 325 z33 _21 h8 n18 132 k24"

D = ciphertext.split(" ")

print(sorted([int(d[1:]) for d in D]))

We notice that it’s a consecutive list of integer from 0 to 39:

1
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39]

The integers seem to be the position of the associated letter in the flag:

1
2
3
4
5
6
7
8
flag = ["" for _ in range(len(D))]

for d in D:
    char = d[0]
    pos = int(d[1:])
    flag[pos] = char

print("".join(flag))

Indeed it’s the case, and we get the flag: TFCCTF{th15_ch4ll3ng3_m4k3s_m3_d1zzy_;d}

This post is licensed under CC BY 4.0 by the author.