This project demonstrates a secure Password-Based Authentication System implemented using the Hardware Abstraction Layer (HAL). It verifies user input against a stored password and controls system access based on the result. The system is suitable for embedded applications such as secure entry systems, control panels, or IoT devices. This project was developed as part of a hands-on training program at NIELIT (National Institute of Electronics & Information Technology). The goal was to implement a secure Password-Based Authentication System using the Hardware Abstraction Layer (HAL) on an STM32 microcontroller platform.
- Microcontroller: STM32 series (e.g., STM32F407-disc1)
- Programming Language: C
- Development Environment: STM32CubeIDE
- HAL Library: STM32Cube HAL
- Peripherals:
- 4x4 Matrix Keypad (for input)
- 16x2 LCD (for user interface)
- GPIO (for control outputs such as relay or LED)
- Flash for storing password
- User password input through a matrix keypad
- LCD interface for user interaction and feedback
- Password comparison and access decision logic
- Output control (e.g., LED/Relay) on successful authentication
- Lockout mechanism after repeated incorrect attempts
- Modular and scalable code using HAL for easy hardware portability
- Configured using HAL GPIO.
- Scanned in polling mode to detect key presses.
- HD44780-compatible 16x2 LCD.
- Driven using HAL GPIO functions.
- Displays prompts like "Enter Password", "Access Granted", or "Access Denied".
- Flash-stored password.
- Input collected in a character buffer.
- On reaching required length, input is compared with the stored password.
- Result triggers access control and feedback.
- Abstracted hardware-specific setup using STM32Cube HAL.
- Peripheral initialization handled through
MX_*functions.
graph TD;
A[System Initialization] --> B[Prompt User for Password];
B --> C[Capture Input from Keypad];
C --> D{Does Input Match Stored Password?};
D -- Yes --> E[Grant Access and Enable Output];
D -- No --> F[Display Error and Retry];