A complete biometric authentication system using keystroke dynamics and SVM machine learning.
This system creates unique user profiles based on typing patterns by analyzing:
- Dwell time: How long each key is pressed
- Flight time: Time between releasing one key and pressing the next
- Digraph timing: Time patterns for two-key combinations
Features are extracted across 9 keyboard sections and used to train individual SVM models for each user.
Biometric Authentication: Login using your unique typing pattern
65% Similarity Threshold: Secure authentication with configurable threshold
9 Keyboard Sections: Comprehensive coverage of typing patterns
SVM Machine Learning: One-class SVM for anomaly detection
Modern UI: Beautiful dark mode interface with smooth animations
- Clone or navigate to the project directory
cd C:\Users\watta\POK- Install dependencies
pip install -r requirements.txt- Start the server
python app.py-
Open your browser Navigate to
http://localhost:5000 -
Register a new user
- Click the "Register" tab
- Enter a username
- Click "Start Registration"
- Type the 10 random words shown
- Click "Complete Registration"
-
Login
- Click the "Login" tab
- Enter your username
- Click "Start Login"
- Type the 10 random words shown
- Click "Authenticate"
POK/
├── app.py # Flask application (main entry point)
├── config.py # Configuration settings
├── keyboard_sections.py # Keyboard section mapping
├── word_generator.py # Random word generation
├── feature_extractor.py # Feature extraction from keystroke data
├── svm_model.py # SVM model training and authentication
├── requirements.txt # Python dependencies
├── models/ # Stored user models (auto-created)
├── static/
│ ├── style.css # Premium UI styling
│ ├── keystroke_capture.js # Keystroke event capture
│ └── app.js # Frontend application logic
└── templates/
└── index.html # Main HTML interface
- User enters username
- System generates 10 random words covering all keyboard sections
- User types the words while keystroke dynamics are captured
- Features are extracted (dwell time, flight time, digraph timing)
- SVM model is trained and saved for the user
- User enters username
- System generates 10 new random words
- User types the words while keystroke dynamics are captured
- Features are extracted and compared with stored model
- If similarity ≥ 40%, authentication succeeds
Section 1: Q W E Section 2: R T Y Section 3: U I O P
Section 4: A S D Section 5: F G H Section 6: J K L
Section 7: Z X C Section 8: V B N Section 9: M , .
Edit config.py to customize:
SIMILARITY_THRESHOLD: Authentication threshold (default: 0.40)NUM_WORDS: Number of words for typing test (default: 10)SVM_KERNEL: SVM kernel type (default: 'rbf')SVM_NU: Outlier fraction for one-class SVM (default: 0.1)
GET /- Main application interfaceGET /get_words- Generate random words for typing testPOST /register- Register new user with keystroke profilePOST /login- Authenticate user with keystroke profileGET /check_user/<username>- Check if user exists
- Backend: Python, Flask
- Machine Learning: scikit-learn (SVM)
- Frontend: HTML5, CSS3, JavaScript
- Data Processing: NumPy, Pandas
- Add password authentication as a fallback
- Implement rate limiting
- Use HTTPS
- Add CSRF protection
- Store models securely with encryption
- Implement session management