Week 10 · lesson
Hexadecimal: Read Bytes Without Drowning in Bits
Binary is precise, but long binary strings are difficult for humans to scan.
Hexadecimal gives us a more compact representation.
Hex uses sixteen symbols:
0 1 2 3 4 5 6 7 8 9 A B C D E F
The letters represent decimal values:
A=10 B=11 C=12 D=13 E=14 F=15
Four bits map cleanly to one hex digit
A group of four bits is sometimes called a nibble.
| Binary | Hex | Decimal |
|---|---|---|
| 0000 | 0 | 0 |
| 0001 | 1 | 1 |
| 0010 | 2 | 2 |
| 0011 | 3 | 3 |
| 0100 | 4 | 4 |
| 0101 | 5 | 5 |
| 0110 | 6 | 6 |
| 0111 | 7 | 7 |
| 1000 | 8 | 8 |
| 1001 | 9 | 9 |
| 1010 | A | 10 |
| 1011 | B | 11 |
| 1100 | C | 12 |
| 1101 | D | 13 |
| 1110 | E | 14 |
| 1111 | F | 15 |
That means an 8-bit byte can be written as two hex digits.
Example:
11001010
Split it:
1100 1010
Convert each nibble:
C A
So:
11001010₂ = CA₁₆
Convert hex to decimal
Hex is also a place-value system.
For two digits:
2F₁₆ = 2×16 + 15 = 47₁₀
For introductory work, you should be comfortable moving among:
- binary
- decimal
- hexadecimal
Why hex appears in cybersecurity
You may see hexadecimal in:
- file bytes
- memory addresses
- MAC addresses
- packet fields
- hashes
- color values
- debugging output
The meaning depends on context.
Seeing FF does not mean the same thing everywhere. It is a representation that software interprets according to a format or protocol.
Conversion lab
Convert these binary values to hex:
0000111100101010010111001010010111111111
Convert these hex values to binary and decimal:
0A1F2A407FC8
Show your work.
Read a fictional byte sequence
A teacher provides this synthetic sequence:
52 4F 42 4F 54 4E 49 58
For now, treat each pair as one byte written in hex.
Create a table:
| Hex byte | Binary | Decimal |
|---|
Do not guess what the sequence means yet. Lesson 3 will add an encoding interpretation.
This separation matters. First identify the representation. Then identify the encoding or format that gives it meaning.
Spot impossible values
An IPv4 octet is commonly represented by an unsigned 8-bit value.
Which of these decimal values cannot fit into one unsigned byte?
- 17
- 128
- 255
- 256
- 300
Explain why.
Then express 255 in binary and hex.
This prepares you for network addressing later without turning this week into a networking unit.
Hex is not encryption
Writing text or numbers in hexadecimal does not make them secret.
If a message is converted from text to hex, anyone who knows the representation can convert it back.
That is representation, not confidentiality.
You will keep returning to this question:
Did we transform the data for compatibility, or did we actually protect it from unauthorized readers?
Build a three-view artifact
Choose five decimal values between 0 and 255.
Represent each one in:
- decimal
- 8-bit binary
- two-digit hex
Then explain which representation is easiest for:
- a person reading a packet byte
- a person doing binary place-value math
- an everyday user counting objects
There is no universally best representation.
Evidence for Lesson 2
Submit:
- binary-to-hex conversion table
- hex-to-binary/decimal table
- fictional byte-sequence table
- byte-range analysis
- three-view artifact
Finish with:
Hexadecimal is useful because ________, but it does not ________.
Hex is a compact window into binary data. It becomes powerful when you know what representation you are looking at and resist inventing meaning before the format tells you how to interpret it.