Skip to content

Semtex Level 1

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

Simple encryption

A password has been crypted using the /semtex/semtex1 tool. The crypted password is HRXDZNWEAWWCP. You have to reverse engineer the algorithm and decrypt the password. You might try the -v switch for encrypt.

Study guide

Level map: the goal is to decrypt the password shown on the page, which was produced by /semtex/semtex1.

What this level teaches

Working out an encryption algorithm by experiment and by reading the program.

Key ideas

  • Black-box analysis. The page notes the tool has a -v switch for encryption. Feed it simple inputs and watch the output.
  • Look for structure. Does the same letter always encrypt the same way? Does position matter? Does the output length match?
  • Invert it. Once you understand the transformation you can write the reverse.
  • Reading code. Disassembly can confirm your hypothesis.

How to approach it

  1. Run the tool with inputs like all As, a single changed letter and different lengths.
  2. Formulate a rule and test predictions.
  3. Apply the inverse to the ciphertext on the page.

Why it matters

It is the same method used to break many home-made ciphers.