Skip to content
/ 2FA Public

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] .

Notifications You must be signed in to change notification settings

lokranjanp/2FA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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] .

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published