Cyber SecurityMediumFlagCrypto

Three Notes, Three Layers

Climb a three-rung ladder of classic encodings: a Caesar shift, hex wrapped around base64, and a repeating-key XOR you crack with a known-plaintext crib.

120 ptsEstimated time: 30 min

Statement

The story

During a training exercise, the blue team intercepted three notes passed between two "agents". Each note unlocks the next one, and the last one hides the flag. None of this is strong cryptography: it is a ladder of encodings and toy ciphers, and the point is to learn to recognise each of them.

Your task

Read stage1.txt, stage2.txt and stage3.txt in order. Every note, once decoded, tells you how to handle the next one. Stage 1 is a classic Caesar cipher on the letters of an English sentence (digits and punctuation are untouched). You are not told the shift.

Submit the flag from the last note. It looks like IMB{...} and is the whole text after the FLAG= marker.

Toolbox, with one tiny example each

  • Caesar: shift every letter by the same amount along the alphabet. Shifting Hello by 3 gives Khoor, and shifting back by 3 undoes it. There are only 25 useful shifts, so you can try them all.
  • Hex: two hexadecimal digits per byte. 48 65 6c 6c 6f is the text Hello.
  • Base64: a text-safe encoding of bytes. SGVsbG8= is the text Hello.
  • XOR with a repeating key: byte i of the text is XORed with byte i mod k of a key of length k. For example A (0x41) XOR b (0x62) is 0x23. XOR is its own inverse: ciphertext XOR key gives the plaintext back, and ciphertext XOR plaintext gives the key.

Everything can be done with a few lines of Python or JavaScript in Code Lab.

Flag format: IMB{...}

Files

Public puzzle material. Download it or read it right here.

stage1.txt2 lines

Note 1: a Caesar-shifted English sentence.

Dysu meha, hushkyj. Jxu dunj deju yi yd ijqwu2.jnj. Yj mqi udsetut myjx rqiu64 vyhij qdt jxud mhyjjud ekj yd xunqtusycqb, ie fuub evv rejx bqouhi je huqt yj.
stage2.txt2 lines

Note 2: hexadecimal text.

563256736243426b6232356c4c694255614755676247467a644342756233526c49476c7a49476c7549484e305957646c4d7935306548517349486479615852305a57346759584d67614756344c69424a6443427063794259543149675a57356a636e6c776447566b4948647064476767595342795a58426c59585270626d6367613256354947396d4947563459574e3062486b674e5342696558526c637934675432356a5a53426b5a574e79655842305a5751734948526f5a5342305a58683049484e3059584a30637942336158526f49455a4d51556339494746755a434230614756754948526f5a53427a5a574e795a585175
stage3.txt2 lines

Note 3: hexadecimal bytes of an XOR-encrypted message.

2a3c343d53253d37013f1f20252d14092030431d14163d42585d4330390525292207

Hints

Stuck? Hints are optional, and each one lowers the points you earn for solving this challenge.

  1. Hint 1Costs 10 points

    Sign in to reveal hints.

  2. Hint 2Costs 15 points

    Reveal the previous hint first

  3. Hint 3Costs 20 points

    Reveal the previous hint first

Lessons that teach this

Stuck on the ideas rather than the puzzle? These lessons cover what you need.