F2 Data representation and bit operations

Needs: Free account

Lesson F2: Hex, binary, BCD, ASCII and EBCDIC, XOR and bit numbering: the encodings behind most payment bugs.

Sign in to open it. A free account takes a minute.

Sign in Create a free account

The opening of the lesson

Why it matters

The same twelve-digit amount can travel as:

  • twelve ASCII bytes;
  • six packed-BCD bytes;
  • twelve EBCDIC bytes.

A key can be shown as hex text or used as binary bytes. Most "the MAC is wrong" or "the PIN fails" bugs are not cryptography bugs at all: they are encoding bugs. Being fluent in hex, BCD and XOR saves days.

In the full lesson

  1. The concept
  2. Step by step
  3. In the real world
  4. Common mistakes
  5. What to test

What module F2 covers →

The rest of the lesson opens with a free account.
An unhandled error has occurred. Reload 🗙

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please retry or reload the page.