https://github.com/lokranjanp/2fa
A custom 2FA system using Python, SQL, Redis, and SMTP, featuring dynamic 6-digit OTP generation with PyOTP. Will develop it into AaaS [Authentication as a Service] .
https://github.com/lokranjanp/2fa
cryptography entity-authorization flask python smtp user-authentication
Last synced: about 2 months ago
JSON representation
A custom 2FA system using Python, SQL, Redis, and SMTP, featuring dynamic 6-digit OTP generation with PyOTP. Will develop it into AaaS [Authentication as a Service] .
- Host: GitHub
- URL: https://github.com/lokranjanp/2fa
- Owner: lokranjanp
- Created: 2024-08-06T05:04:01.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-01-04T06:15:00.000Z (over 1 year ago)
- Last Synced: 2025-02-23T16:49:50.588Z (over 1 year ago)
- Topics: cryptography, entity-authorization, flask, python, smtp, user-authentication
- Language: Python
- Homepage:
- Size: 5.83 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Implementing 2FA
## Introduction
I always wondered how the logic behind entity authentication works. After taking up the course Cryptography and Network Security,
[21IS6C03] I learnt hashing, salting, entity authentication techniques etc.
This motivated me to start using 2FA on many platforms that had personal and important information like Gmail, Heroku, Github etc.
On a random day I felt like trying to implement my own 2FA system.
## Implementation
- I have used Flask for web interface.
- To generate 2FA code I have used pytop libraries.
MySql seemed the best choice for storing auth data persistently.
To store 2FA codes temporarily until expiration or its intended use, I have used Redis.
Since Redis provides faster caching and access times along with temporary storage, it seemed the best choice.
## Technologies used
- Flask
- MySql
- Redis
- Pyotp
- Bcrypt
## Features of my 2FA system
1. User registration through unique username or user email.
2. User login with 2FA. (user choice to otp for 2FA or not)
3. Password Reset (Mail service or backup code)
4. Backup code generation and storage.
## Future Scope
I will try to include famous Auth services like Google Authenticator or Microsoft Authenticator for 2FA code generation.
## Conclusion
- This whole project from thought to implementation to deployment was a good experience to learn about database, data handling,
data security and a bit of web development too.
- Special thanks to Dr. Suhaas K P for teaching the course Cryptography and Network Security and making it interesting.