ByteToFlag
Menu
Stage 1 learning path
  1. Module 1 · Task 1 · Read the Mark
  2. Module 2 · Task 2 · Find the Split
  3. Module 3 · Task 3 · Hear the Words
  4. Module 4 · Task 4 · Find the Gate
  5. Module 4 · Task 5 · Signal Check
  6. Stage 1 checkpoint · The Forged Ledger
Task contents

Find the Split

Task 2 of 5 · Stage 1 · Read files · Next: Task 3 · Hear the Words

Two copies of a map disagree. Find the first changed byte, then decode the copper marks to test which copy agrees with them.

  • ~35 min
  • 2 parts · 6 checked steps
  • Nothing to install
Begin with the two maps → Read the Keeper's brief
You will use this when
two versions of a file should be the same and are not — a document before and after an edit, a program before and after an update — and you must show exactly where they differ. Part B is how programs often hide short text from a quick look: XOR with a key.
Later in this path
task 3 jumps to a string by its offset; task 5 undoes an XOR whose key changes with the position, the same idea as part B; the Stage 1 checkpoint asks for the offset of a changed byte.
After this task you can
find any byte by its row and column, keep “where” separate from “what”, and undo a simple XOR by hand.

Complete both parts. Part A gives the first flag. Part B gives the second and, if progress is on, records Task 2 as guided practice in this browser.

Keeper: You read my first mark. Now the map. Two scribes copied it, and the copies disagree. A scribe's slip changes a mark or two. So does the Overwrite, and it makes its change look like a slip. Find where the copies split. Then read the word my scribes cut in copper under the true road, and tell me which copy to trust.

You will learn

  • find a byte by its offset in a hex dump, and an offset by its value
  • XOR two bytes by hand, and undo it
  • undo a key that changes with the position
You need
Task 1 — Read the Mark: hex to decimal, and uppercase letters in ASCII
Time
~35 minutes: part A ~15, part B ~20
Tools
a notes file or paper. Nothing to download

Where this is used

Part A. Comparing two copies of a file byte by byte locates differences or checks whether the copies match. A difference alone does not tell you which copy is original or why it changed. Tools do the scanning; they report offsets, and you read them. (Comparing two versions of a program after an update is done function by function instead: recompiling shifts code and addresses, so a byte diff is noisy.)

Part B. XOR with a small key, often one that changes with the position, can hide text from a quick look at a program. Analysts recover the rule by hand on a few bytes, then script the rest.

Part A · Find the Split · Step A1 · ~5 min

Offset = row + column

Copy A and copy B of the map, 16 bytes per row. The first number on each row is the row's offset, not a byte.
Copy A
offset  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00      52 4F 41 44 20 4E 4F 52 54 48 20 50 41 53 53 2C
10      20 4C 45 46 54 20 41 54 20 54 48 45 20 4F 41 4B
Copy B
offset  00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
00      52 4F 41 44 20 4E 4F 52 54 48 20 50 41 53 53 2C
10      20 57 45 53 54 20 41 54 20 54 48 45 20 4F 41 4B

A hex dump prints 16 bytes per row. The first number on each row is a label, not a byte: the offset of the row's first byte. 16 is 0x10, so labels count 00, 10, 20… The header line numbers the columns 00 to 0F.

Columns start at 00. The first byte after the label is column 00, the second is 01, the eleventh is 0A. Offset = row label + column.

Worked example, copy A, offset 0x1A. It lies between 0x10 and 0x1F, so it is in row 10, column 0x1A − 0x10 = 0A. Count along row 10: 00 → 20, 01 → 4C, 02 → 45 … 0A → 48. The byte at 0x1A is 0x48, the H of THE.

H1 · Direction

Offset 0x0B is in row 00, because it is smaller than 0x10.

H2 · Method

0x0B − 0x00 = column 0B. Count from the first byte after the label: 00, 01, 02 … up to 0B, which is the twelfth byte of the row. Or run your finger down from 0B in the header.

H3 · Check

The value is an uppercase letter in ASCII, between 0x41 and 0x5A. If you got 0x20 or 0x41, you are one column off.

Part A · Step A2 · ~4 min

Value is not position

Often you know the value and need where it is. Three moves: turn what you look for into a byte; find that byte in the row; add its column to the row label. The answer is the position, never the byte itself. In code, data[i] is the byte at position i; i is only the position.

Worked example: where does the word OAK start in copy A? O is 14 letters on from A: 0x41 + 14 = 0x4F. The 4F followed by 41 4B (A, K) sits in row 10, column 0D, so OAK starts at offset 0x10 + 0xD = 0x1D.

H1 · Direction

Work out the byte for N first, then look for it in row 00.

H2 · Method

N is 13 letters on from A: 0x41 + 13 = 0x4E. Find 4E in row 00 (not 4F, which is O), count its column from 00, and add it to the row label 00.

H3 · Check

The byte just before it is 0x20, a space. If you typed 4E, you gave the value, not the offset.

Part A · Step A3 · ~5 min · flag 1 of 2

Where do the copies split?

Keeper: Thirty-two marks in each copy. Somewhere they stop agreeing — and a traveller who follows the wrong copy does not come back. Show me exactly where.

Compare the copies byte by byte from offset 00. Stop at the first byte that differs, and write its offset as row label + column in your notes. Count columns from 00, as in step A1.

A method that keeps your place: compare one row at a time. Copy the same row of A and of B into your notes, one under the other, and write the column numbers 00 01 02 … 0F above them. Then the first pair that differs is easy to see, and its column is written right above it.

H1 · Direction

Row 00 is the same in both copies. Look only at row 10.

H2 · Method

Point at each column of row 10 in turn, saying the column aloud: 00 for the first byte after the label, then 01, 02… Stop where the two bytes differ and add that column to 0x10.

H3 · Check

More than one byte differs in that row; the answer is the first. It lies between 0x10 and 0x1F. If you called the first byte column 01, your answer is one too big.

Part B · Unlock the Copper · Step B1 · ~7 min

XOR, bit by bit

Each hex digit is four bits:

  • 0 0000
  • 1 0001
  • 2 0010
  • 3 0011
  • 4 0100
  • 5 0101
  • 6 0110
  • 7 0111
  • 8 1000
  • 9 1001
  • A 1010
  • B 1011
  • C 1100
  • D 1101
  • E 1110
  • F 1111

XOR, written ^ in code (not “to the power of”), compares two bytes bit by bit: 1 where the bits differ, 0 where they match. Worked example:

  0x5C   0101 1100
^ 0x3A   0011 1010
= 0x66   0110 0110

XOR with the same key again undoes it: 0x66 ^ 0x3A = 0x5C. That is why a program can lock a byte as value ^ key, and why you can unlock it once you know the key.

H1 · Direction

Write both bytes as eight bits, one above the other, as in the worked example.

H2 · Method

Look up each hex digit in the table. Compare column by column, then turn each group of four bits back into one hex digit.

H3 · Check

XOR your result with 0x2F: you must get 0x6B back. If not, find the column where a bit went wrong.

Part B · Step B2 · ~7 min

A key that moves

Many programs use one key for every byte; others change the key with the position, as here. A common shape is out[i] = in[i] ^ (base + i): the key grows by one at each position i. Compute each key first, then XOR. Work in a table with one row per byte, and give each row its own key: index · key · stored · stored ^ key · letter. Here the stored bytes are in[i]; XOR undoes itself, so the same rule locks and unlocks. Lowercase a–z are 0x61–0x7A, and 0x20 is a space.

Worked example, base 0x10, stored bytes 58 78:

IndexKey = base + indexStoredStored ^ key, in bitsResultLetter
00x10 + 0 = 0x10580101 1000 ^ 0001 000048H
10x10 + 1 = 0x11780111 1000 ^ 0001 000169i

These keys belong to this example only. In the box below the base is 0x20, so its keys are 0x20, 0x21, 0x22. Use one key for every byte and the second letter comes out wrong (here h instead of i). A wrong key often still gives letters, so check that the result reads.

H1 · Direction

Three bytes, three rows, three keys. Start a fresh table; do not reuse the example's keys 0x10 and 0x11.

H2 · Method

Row 0: key 0x20, stored 62, 0110 0010 against 0010 0000. Row 1: key 0x21, stored 48. Row 2: key 0x22, stored 56.

H3 · Check

One uppercase letter, then two lowercase, and together a word. If you got “Bhv”, you reused the first key.

Part B · Step B3 · ~6 min · flag 2 of 2

What do the copper marks say?

Keeper: Under the road on the true page, my scribes cut one word in copper, locked with the rule of that day: out[i] = in[i] ^ (0x30 + i). Four marks. Read them, and you will know which copy to follow.

The copper marks, offsets 0 to 3
7C 74 74 67

Copy this table into your notes and fill in the last two columns, one row at a time. Each row has its own key.

index  key         stored  result  letter
0      0x30 + 0    7C      __      _
1      0x30 + 1    74      __      _
2      0x30 + 2    74      __      _
3      0x30 + 3    67      __      _

Read the four letters in order and type the word.

In real work nobody hands you the rule. Analysts recover it: if you know a few original bytes — a program starts with MZ, a web address with http — then stored ^ known gives the key at each position, and keys like 30 31 32… show the + i pattern.

H1 · Direction

Four bytes, four keys: 0x30, 0x31, 0x32, 0x33. Finish one row before you start the next.

H2 · Method

Index 0: 0x7C ^ 0x30 → 0111 1100 against 0011 0000. Read the result in the uppercase range 0x41–0x5A.

H3 · Check

Four uppercase letters, and the word appears in one of the two copies. If you got “LDDW”, you used 0x30 for every byte.

Walkthrough

Stuck after the hints? Show the walkthrough — it shows every answer
  1. A1. Row 00, column 0B: 0x50.
  2. A2. N = 0x41 + 13 = 0x4E, found in column 05: offset 0x05.
  3. A3. Row 10, column 01: 4C in A, 57 in B. Offset 0x10 + 0x1 = 0x11.
  4. B1. 0110 1011 ^ 0010 1111 = 0100 0100 = 0x44.
  5. B2. 62^20 = 42 B, 48^21 = 69 i, 56^22 = 74 t: Bit.
  6. B3. See the table: LEFT.
Hex view of copy A and copy B. Row 00 is dimmed as identical. In row 10, column 1 is marked amber (4C in A, 57 in B) and column 3 differs too (46 and 53). The text column reads LEFT AT THE OAK and WEST AT THE OAK.
A generated view of this page's own bytes, drawn by ByteToFlag — not a screenshot of a particular tool.
IndexKeyStoredBitsResultLetter
0307C0111 1100 ^ 0011 00004CL
131740111 0100 ^ 0011 000145E
232740111 0100 ^ 0011 001046F
333670110 0111 ^ 0011 001154T

Bonus

Explain which copy the evidence supports

In your notes: which copy is the Keeper's, and the evidence — the offset of the split, both values there, and the copper table for every byte. Then one thing you have not checked.

I have written my note — show the model note
Observed
The copies agree from 0x00 to 0x10. They differ at 0x11: 4C (L) in A, 57 (W) in B; and at 0x13: 46 (F) in A, 53 (S) in B. The word at offsets 0x11–0x14 reads LEFT in A and WEST in B. The copper marks, each XORed with 0x30 + i, give 4C 45 46 54: LEFT.
Hypothesis
Copy A may preserve the Keeper's intended route because it agrees with the copper. Copy B's word at 0x11–0x14 may have been changed.
Verified
One byte locked again: 0x4C ^ 0x30 = 0x7C, the stored mark.
Unknown
Whether the copper marks were themselves altered. A and the copper agreeing is evidence, not proof; a third, independent copy would test it.

Check yours: did you give offsets and values, show the key for every index, re-check one byte, and name what you have not checked? Each “no” is what to add.

This is guided practice. After task 5, use the Stage 1 checkpoint, The Forged Ledger, to test your work without hints. A separate no-hints version of this task is planned.

Read further

Outside sites, not ByteToFlag. Links checked on 22 November 2026.

Take your method to the next task

Before you move on

  • Can you locate a byte from its row and column, and keep its value separate from its offset?
  • Can you explain why applying the same XOR key twice recovers the original byte?
  • Can you show the key for each position, re-encode one result and name what the evidence leaves uncertain?

If one is unclear, revisit that part or compare your explanation with the model note. Both flags belong to this one guided task.

In Task 3, Hear the Words, you will inspect strings inside a program and test a lead. Prepare HxD and Detect It Easy using the lab setup guide before you begin.

Task 3 · Hear the Words → Prepare your tools Back to Module 2