Hexadecimal
- •
What it is
- •
the base-16 number system, using digits 0–9 followed by A–F to represent values 10–15
- •
in practice (e.g. cryptography/CTF contexts): a base-16 representation of bytes, two hex characters per byte — the most common way to paste binary/ciphertext data into a URL, JSON field, or terminal as plain text
- •
- •
When to apply
- •
Whenever data shows up as a string of only
0-9a-fcharacters — nearly universal as the wrapper format for CTF network challenges and web APIs.
- •
- •
Worked example
- •
bytes.fromhex("63727970746f7b")→b'crypto{'.
- •
- •
Python
- •
data = bytes.fromhex("63727970746f7b") hex_again = data.hex()
- •
- •
- •