Project Overview
"Secure-Vault" is a deep-dive into Proximity-Based Authentication and Embedded Financial Logic. By leveraging the MFRC522 reader and the widespread Mifare Classic 1K standard, this project demonstrates how to build a localized private banking system. It moves beyond simple "card-reading" to implement two-factor authentication (2FA) where a physical RFID tag must be coupled with a secret PIN to authorize digital balance transfers.
Technical Deep-Dive
- Mifare Classic 1K Memory Forensics:
- Sectorized Data Storage: The Mifare 1K card is divided into 16 sectors, each protected by two different keys (Key A and Key B). This project utilizes specific sectors to store "Virtual Balance" data, demonstrating how to perform authenticated read/write operations within a secure memory block.
- Trailer Block Logic: Each sector contains a "Sector Trailer" that defines the access conditions. The firmware parses these conditions to ensure that only authorized readers can modify the financial balance stored on the tag.
- UID Serialization & Parsing:
- Unique Traceability: Every RFID tag features a factory-programmed 4-byte or 7-byte Unique Identifier (UID). The Arduino core serializes this hex-string into a usable long-integer or string, acting as the "Account Number" in the local banking database.
- Anti-Collision Protocol: The RC522 maintains a high-speed bit-level communication to handle multiple tags in the field, ensuring that the "Transaction" only occurs for the primary card target.
- Dual-Layer HMI (LCD + Keypad):
- Keypad Matrix Forensics: The 4x4 keypad utilizes a multiplexed scanning logic to minimize GPIO usage. This allows the user to input their 4-digit PIN after the RFID scan is verified.
- PWM Auditory Feedback: The buzzer provides crucial HMI cues. A high-frequency "Chirp" indicates a successful transaction, while a low-frequency, long-duration "Tone" signifies a security breach or insufficient funds.
Engineering & Implementation
- Localized Data Persistence:
- The project explores the use of the Arduino's Internal EEPROM to store a localized database of registered UIDs and their corresponding account balances. This ensures that the "Bank" remains persistent even after a power cycle.
- SPI Protocol Integration:
- The MFRC522 module communicates via the Serial Peripheral Interface (SPI). The implementation details the wiring of the MOSI, MISO, SCK, and SS pins, emphasizing the need for short, stable cable runs to ensure signal integrity at the 13.56MHz carrier frequency.
- Transaction Logic Flow:
- Idle State: LCD displays "Insert Card."
- Detection: Card detected; UID read and verified against the internal DB.
- Authentication: User prompted for PIN via 4x4 keypad.
- Process: If PIN matches, transaction options (Deposit/Withdraw) are displayed.
- Completion: Balance updated in EEPROM and visual/auditory confirmation dispatched.
Conclusion
Secure-Vault bridges the gap between basic hardware interfacing and Secure Systems Design. By mastering Sector-based Cryptography and UID Data Serialization, developers can build reliable, private financial terminals for everything from community currencies to secure inventory management.