This project focuses on implementing a multi-layered security architecture to protect user credentials and sensitive data. The system integrates three core security pillars: AES-256 Encryption, Two-Factor Authentication (2FA), and OAuth 2.0 Authorization.
- Data-at-Rest Protection: Sensitive user information (passwords and phone numbers) is encrypted using AES-256-CBC encryption[cite: 1].
- Multi-Factor Authentication: TOTP-based 2FA implementation using
pyotpand Google Authenticator for enhanced account security[cite: 1]. - Secure Authorization: Simulation of the OAuth 2.0 Authorization Code Grant flow, ensuring secure, scope-limited token-based access[cite: 1].
- Integrated Security: A unified demonstration script (
full_auth_demo.py) that showcases all security layers working together[cite: 1].
- Language: Python 3
- Libraries:
cryptography,pyotp,qrcode,secrets,base64,json - Dataset Generation: Mockaroo (50 fake user records)[cite: 1]
- Environment: Kali Linux with virtual environment (venv) configuration[cite: 1]
encrypt_users.py: Script to encrypt user data and save it toencrypted_users.json[cite: 1].twofa_setup.py: Generates TOTP secret keys and QR codes for 2FA enrollment[cite: 1].oauth_demo.py: Simulates the OAuth 2.0 flow, including authorization codes and bearer tokens[cite: 1].full_auth_demo.py: Integrated system demo showing all security features in action[cite: 1].
- Clone the repository and navigate to the project directory.
- Setup virtual environment:
python3 -m venv venv
source venv/bin/activate