The active device scans for the passive one and establishes a connection on contact.
Basically there is an active NFC enabled device (the reader) and a passive device (the tag). NFC nowadays is used for access cards, public transport, some more and in this case: Vending Machines.
For more Infos on NFC you can read the Wikipedia article. NFC stands for Near Field Communication and is used to communicate over short distances. At the end I show you how to reprogram a vending machine’s NFC tag to contain more credits. In this blog post I will cover some quick basics about NFC, Mifare Classic and how to set up everything for reading and writing a NFC tag.
Mifare Classic in general is stated insecure, because it’s encryption protocol has been cracked. There are also other types like the “Mifare Classic 4k” and the “Mifare Mini” each having a different memory size. The Proxmark is the tool behind all major RFID Security Research breakthroughs: Mifare Classic Crypto cracking, Mifare PRNG analysis, VingCard exploitation & defeat to name a few.