F2 Data representation and bit operations

Needs: Supporter

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

This is a supporter feature. Create a free account, then try every supporter feature free for 7 days.

Sign in Create a free account See plans

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 supporter pass, which you can try free for 7 days.
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.