The idea
The same number can be written in different bases: decimal 15 and hexadecimal F name the same quantity. A byte contains eight bits, and two hexadecimal digits can describe one byte. To turn text into bytes, you also need a character encoding such as UTF-8. Decoding works when both sides agree on the representation. A hash has a different job: it produces a fingerprint for comparison, not a message you can decode back.
A tiny experiment
message = "Hi"
payload = message.encode("utf-8")
print(payload.hex())
print(bytes.fromhex("4869").decode("utf-8"))Reveal the expected output
4869 Hi
Read it one step at a time
- encode changes the Python string into bytes using UTF-8.
- hex displays those bytes as hexadecimal digits. Here H corresponds to 48 and i to 69 in hex.
- fromhex reconstructs the bytes; decode turns them into text again. These steps need no secret key.
Make one change
Change the first message to "Hi!". What extra hexadecimal pair appears?
Check your thinking
21 appears at the end because it represents the exclamation mark byte.
Keep following the trail
- Activity 03: Read Tony's message
- Activity 05: Which note matches?
- Activity 07: Read the radio-station note
- Activity 10: Repair the Genesis copy
Sources & further reading
Companion notes for Coding Adventure by James Colby. Historical claims link to their sources; the examples are written for this learning trail.