
Eight bytes that prove your card was there
Every tap ends with an eight-byte cryptogram that only your card and your bank can make. How the keys behind it are built, how the bank checks it, and what breaks it, with working Python and C#.
Software Engineer
Designing, developing, and implementing innovative software solutions that drive business growth and efficiency in payments and blockchain.
9 stories · Writing since Oct 11, 2026

Every tap ends with an eight-byte cryptogram that only your card and your bank can make. How the keys behind it are built, how the bank checks it, and what breaks it, with working Python and C#.

One card can have several tokens alive at once, each with its own rules. Who is allowed to ask for one, how it's issued, what's checked on every payment, and what happens when your phone goes missing.

When you pay with Apple Pay or Google Pay, the terminal thinks it's talking to a card. What's really different is the number it gets, who checks it's you, and where the keys live.

The beep on a contactless tap comes before the bank has said anything. A card gets 500 ms with the reader, and the bank answers after the card has gone. Here's what happens in that half second.

With no network, a card terminal still has to decide whether a chip is genuine. This post builds the EMV certificate chain in Python and C#, checks it the way a terminal does, then breaks it five ways.

The detector worked when I tested it. Going back through the code, I found five places where the details quietly weaken it: quiet seconds, mismatched units, a baseline that learns from attacks, bans that outlive restarts, and a whitelist that ignores its own config.

A daemon that watches every request, learns what normal traffic looks like, and drops attackers at the firewall within seconds, built with Python, iptables and nothing fancier than a mean, a standard deviation and a z-score.

Before a chip accepts its keys and PIN, it makes the personalisation machine prove itself. How the handshake works, and why your card's keys are stored nowhere.

Every chip card starts as the same blank chip. What card personalisation is, who does it, what gets written, and why small mistakes hide so well.