Bifrost: An Authentication Service
Envision
CompSoc
Abstract
This project develops a secure Bifrost Two-Factor Authentication (2FA) system bridging a C++ client terminal and a Python Flask web server. To protect sensitive data from unauthorized access, it implements the Diffie–Hellman Key Exchange algorithm to securely share cryptographic keys over a public network without direct transmission. The system utilizes the Time-Based One-Time Password (TOTP) algorithm and HMAC-SHA1 hashing to dynamically generate secure 6-digit verification codes every 30 seconds. A robust backend architecture manages state through a persistent SQLite database using SQLAlchemy and provides automated lifecycle management with a strict 5-minute Time-To-Live. Security is further enhanced using single-use API endpoints that permanently destroy temporary connection states to neutralize cryptographic replay attacks. Additionally, the web frontend employs asynchronous UI polling via the JavaScript fetch API to automatically redirect users upon a successful terminal connection.
Abstract
This project develops a secure Bifrost Two-Factor Authentication (2FA) system bridging a C++ client terminal and a Python Flask web server. To protect sensitive data from unauthorized access, it implements the Diffie–Hellman Key Exchange algorithm to securely share cryptographic keys over a public network without direct transmission. The system utilizes the Time-Based One-Time Password (TOTP) algorithm and HMAC-SHA1 hashing to dynamically generate secure 6-digit verification codes every 30 seconds. A robust backend architecture manages state through a persistent SQLite database using SQLAlchemy and provides automated lifecycle management with a strict 5-minute Time-To-Live. Security is further enhanced using single-use API endpoints that permanently destroy temporary connection states to neutralize cryptographic replay attacks. Additionally, the web frontend employs asynchronous UI polling via the JavaScript fetch API to automatically redirect users upon a successful terminal connection.
Report Information
Team Members
Team Members
Report Details
Created: May 17, 2026, 7:06 p.m.
Approved by: None
Approval date: None
Report Details
Created: May 17, 2026, 7:06 p.m.
Approved by: None
Approval date: None