A secure element is a tiny, locked-down microcontroller that stores secret keys and uses them without ever revealing them. It is the chip inside a contactless debit or credit card, a SIM card and an e-passport, and many phones contain one too. It is a microcontroller, with a processor, memory and a program. But it is built to resist anyone who tries to read its secrets, even with laboratory equipment.
How does it prove a card is real? When the bank prepares the card, it stores a secret key inside the chip. A key is a long secret number. At each payment, the chip uses the key to calculate a cryptogram, a short code made from the payment details, using the mathematics of encryption. The bank holds its own copy of the key, so it can repeat the calculation and check that the codes match. The key itself never leaves the chip. The chip also keeps a counter that rises by one at every payment. So each cryptogram is different, and a code copied from one payment cannot be used again.
What makes it secure? Its memory is encrypted, and a metal mesh covers its circuits. Sensors detect probing, unusual light, voltage or temperature, and the chip erases its keys if it is attacked. It also varies its timing and power use, so that an attacker cannot work out the key by measuring how much power the chip draws. Secure elements are tested and certified by independent laboratories before banks may use them.
Say you buy medicines for ₹460 at a pharmacy in Guwahati and tap your contactless RuPay debit card on the POS terminal. The card has no battery. The terminal's radio field powers the chip for a fraction of a second. The terminal sends the chip the amount, the date and a random number. The chip combines these with its counter, which now stands at 214, and its secret key, and calculates an 8-byte cryptogram. The terminal sends the cryptogram and the card details through the acquiring bank and the card network to your bank's card issuing platform. Your bank repeats the calculation with its copy of the key. The codes match, so it approves the payment. The card's part takes under half a second, and approval takes about two seconds in all. No PIN is needed, because the amount is below the RBI's ₹5,000 limit for contactless payments without a PIN.
The same idea protects other devices. A phone that pays with a tap stores a card token in its own secure element or in a protected area of its processor. Laptops and servers have a hardware root of trust, a security chip that checks the firmware before anything else starts. The difference is the job: a secure element answers questions from an outside reader, while a root of trust checks the machine it sits in.