Behavioral biometrics is a cutting-edge field that focuses on analyzing user behavior to enhance security and authentication processes. This repository serves as a hub for everything related to this innovative technology.
This is a Python script for collecting keystroke dynamics, extracting features, and training a machine-learning model for user authentication based on keystroke behavior. It demonstrates a simplified version of behavioral biometrics.
-
Data Collection: Captures keystroke events and their timestamps for a specified duration (default 10 seconds).
-
Feature Extraction: Computes key hold time, key release time, and typing speed from collected keystrokes.
-
Model Training: Utilizes a Random Forest classifier to train on keystroke features and user labels.
-
Authentication: Authenticates a user based on their keystroke features using the trained model.
- Python 3.x
- Required libraries:
keyboard
,numpy
,scikit-learn
Install the necessary libraries using pip install keyboard numpy scikit-learn
.
-
Run the script by executing
python Behavioral_Biometrics.py
. -
Follow the prompts and type to capture keystroke data.
-
The script simulates two users (user1 and user2) with random labels for demonstration. Replace this simulated data with actual user data for real authentication.
-
The machine learning model is trained on the simulated data.
-
Replace the simulated user keystroke features with actual user data for authentication. The predicted user label is printed.
-
This code is a simplified demonstration and should be extended for real-world use with actual user data.
-
Modify the simulated user data and labels for authenticating real users.
-
Ensure the user data is consistent with the feature extraction process.
This project is licensed under the MIT License. See the LICENSE for details.