A secure and portable fingerprint-based attendance system built using Python, Pygame GUI, and a biometric sensor.
It enables real-time fingerprint authentication, encrypted data storage, and fraud-prevention mechanisms to ensure accurate student attendance logging.
- GUI-based interface using Pygame
- Fingerprint enrollment, validation, and deletion
- Encrypted storage of fingerprints using AES-128 (CBC mode) with HMAC-SHA256
- Prevents duplicate attendance marking
- Admin authentication for secure system access
- Optional integration with MySQL for data upload
- Real-time date and time display
- Confirmation dialogs and error-handling messages
This project replaces manual attendance with a biometric verification system using a fingerprint sensor (R307) connected to a Raspberry Pi.
Each student:
- Enrolls their fingerprint once (a unique UID is assigned).
- When validating, the scanned fingerprint is compared with encrypted templates.
- On a successful match, attendance is recorded automatically.
The system uses AES-128 in CBC mode with HMAC-SHA256 through the cryptography.fernet module.
- Fingerprint template → binary data
- Binary data encrypted using
Fernet(key)→ ciphertext - Base64 encoded ciphertext → stored in
fingerprints.json - On validation → decrypted and compared with live scan
This ensures:
- Confidentiality: via AES-128 encryption
- Integrity: via HMAC-SHA256 authentication
- Tamper protection: decryption fails if ciphertext is modified
git clone https://github.com/SanchitNegi177/portable_fingerprint_based_attendance_system.git
cd portable_fingerprint_based_attendance_system2️⃣ Install Dependencies
pip install -r requirements.txt3️⃣ Connect Hardware
Attach the fingerprint sensor (R307 or compatible) via /dev/ttyUSB0 Ensure baud rate = 57600 Verify connection:
from pyfingerprint.pyfingerprint import PyFingerprint
PyFingerprint('/dev/ttyUSB0', 57600).verifyPassword()4️⃣ Run the Application
python main_menu.py- Scan finger twice to register a new student UID
- Fingerprint template is encrypted and stored in
fingerprints.json
- Place finger on the sensor
- If match found → attendance recorded in
verified_uids.json - Duplicate scans are ignored
- Unrecognized fingerprints trigger an error message
- Admin can upload attendance data to a connected MySQL database
| File | Description |
|---|---|
fingerprint_validation.py |
Verifies fingerprints and marks attendance |
fingerprint_registration.py |
Enrolls, re-enrolls, or deletes fingerprints |
main_menu.py |
Launches the GUI main menu |
user_interface.py |
Handles GUI components (buttons, colors, fonts) |
admin.py |
Admin setup and authentication |
data_to_upload.py |
Uploads attendance data |
fingerprints.json |
Stores encrypted fingerprint templates |
verified_uids.json |
Stores marked attendance records |
- Launch the main menu
- Enroll student fingerprints
- Validate fingerprints for attendance
- Data is securely saved and can be uploaded to the database
- Exit using the Quit button (with confirmation dialog)
This project is open-source and available for educational and personal use.