Applied cryptography
Trustless Point-of-Sale System
A payment terminal built on Raspberry Pi where private keys are generated inside a Java smart card and never leave it. Each transaction request is sent to the card over NFC, signed on-card via ISO/IEC 7816 APDUs, and returned to the terminal for verification.
On-card key generation for contactless payments

The trust problem
Conventional point-of-sale systems place secret keys inside the terminal or in a back-end vault, which means the merchant or operator must be trusted not to misuse them. This project removed that trust assumption by moving the private key into a tamper-resistant Java smart card and generating it on-card.
The Raspberry Pi terminal never sees the private key. It only prepares a transaction request, sends it to the card over NFC, and receives a signature that it can verify against the corresponding public key.
The NFC and smart-card stack
Building the link between terminal and card required working through the full contactless stack: ISO/IEC 14443 anti-collision and framing, the T=CL protocol, and ISO/IEC 7816-4 APDU command/response pairs. On the card side, the applet handled key generation, PIN verification, and ECDSA signing inside the Java Card runtime.
This meant dealing with low-level constraints: short APDU payloads, command chaining, status-word interpretation, and the difference between selecting the card manager versus the payment applet.
Terminal architecture
The PoS software on the Raspberry Pi managed the NFC reader, formatted transaction requests, routed APDUs to the card, and verified returned signatures. The entire flow — tap, authenticate, sign, verify — was implemented end-to-end without any secret material leaving the smart card.
