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.

BinaryHexDecimal
000000
000111
001022
001133
010044
010155
011066
011177
100088
100199
1010A10
1011B11
1100C12
1101D13
1110E14
1111F15

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:

  • 00001111
  • 00101010
  • 01011100
  • 10100101
  • 11111111

Convert these hex values to binary and decimal:

  • 0A
  • 1F
  • 2A
  • 40
  • 7F
  • C8

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 byteBinaryDecimal

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.