Skip to content

๐Ÿ” Hardware TOTP Authenticator & Password Manager | 7-layer security | AES-256 | BLE Keyboard | Offline | ESP32 T-Display

License

Notifications You must be signed in to change notification settings

makepkg/SecureGen

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ESP32 T-Display Multifunctional Security Device

Open-source hardware security device featuring TOTP Authenticator and Password Manager with BLE Keyboard

License: MIT PlatformIO ESP32

YouTube Hackster Dev.to Product Hunt

Video Demo โ€ข Features โ€ข Installation โ€ข Documentation โ€ข Security โ€ข Support


๐Ÿ“ธ Device Gallery

Physical Device Interface

TOTP Dark Theme
TOTP Mode (Dark Theme)
Real-time authentication codes
Password Manager
Password Manager Mode
Secure offline password vault
BLE Security
BLE Security Mode
Encrypted wireless transmission
Light Theme
Light Theme UI
Customizable display themes
Battery Status
Battery & Status
Real-time monitoring
Factory Reset
Factory Reset
Secure data wiping

Web Management Interface

Web Dashboard
Dashboard & Login
Secure web access
TOTP Management
TOTP Management
QR code scanning & bulk import
Password Vault
Password Vault
Encrypted storage & search
Security Settings
Security Settings
PIN & authentication config
Device Config
Device Configuration
Network & display settings
Password Generator
Password Generator
Advanced generation & statistics

๐ŸŽฅ Video Demo

SecureGen Demo Video

Watch the full demonstration showing TOTP generation, password management, BLE keyboard typing, and web interface in action.

โ–ถ๏ธ Watch on YouTube | Duration: 2 minutes


๐Ÿ”’ Security in Action

8 Security Layers Architecture
Defense-in-depth: 8 layers of security protection

Network Traffic Protection Visualization

SecureGen implements multiple security layers to protect web communications. Here's what that looks like in practice:

Before Security Layers
Before: Readable HTTP Traffic
All request details visible in plaintext
After Security Layers
After: Protected Traffic
Encrypted and obfuscated communications

What Changes:

  • Before: API endpoints, session cookies, and request structure are fully visible to network monitoring tools
  • After: Multi-layer protection encrypts payload, obfuscates URLs, masks metadata, and prevents traffic analysis

This demonstrates the 7-layer security architecture protecting your sensitive data from passive monitoring, MITM attacks, and traffic pattern analysis.

๐Ÿ” Technical Details (Click to Expand)

Protection Layers:

  1. Key Exchange (ECDH) - Establishes secure session keys using elliptic curve cryptography
  2. Session Encryption - Unique encryption for each communication session
  3. URL Obfuscation - Dynamic API endpoints generated using cryptographic hashing
  4. Header Obfuscation - HTTP headers dynamically mapped to hide metadata
  5. Decoy Injection - Fake headers added to confuse traffic analysis
  6. Method Tunneling - HTTP methods hidden to prevent fingerprinting
  7. Timing Protection - Random delays prevent timing-based side-channel attacks

Security Benefits:

  • Protects against passive network monitoring (Wireshark, packet sniffing)
  • Prevents traffic pattern analysis and metadata leakage
  • Resists MITM attacks through session-based encryption
  • Anti-fingerprinting measures prevent device identification

Performance Impact:

  • ~50ms overhead per request
  • Minimal impact on user experience
  • Worth the trade-off for security-critical applications

Implementation:

  • Built with mbedTLS for cryptographic primitives
  • Custom session management layer
  • Hardware-accelerated encryption on ESP32
  • All code available in the repository for audit

Read more: Security Architecture Documentation


โœจ Key Features

๐Ÿ” Security First

  • Military-Grade Encryption - AES-256 for all sensitive data
  • Multi-Layer Protection - 7+ security layers for web communications
  • Hardware Security - Unique device keys from hardware entropy
  • PIN Protection - Secure device startup and BLE transmission
  • Encrypted BLE - Authenticated Bluetooth with bonding and MITM protection

๐ŸŽฏ Dual Functionality

  • TOTP Authenticator - Compatible with Google Authenticator, Authy, and all standard 2FA services
  • Password Manager - Secure offline vault with BLE keyboard transmission
  • Air-Gapped Operation - Works completely offline for maximum security
  • Wireless Transmission - Send passwords via encrypted Bluetooth to any device

๐ŸŒ Advanced Web Interface

  • Full Management - Add, edit, delete TOTP codes and passwords remotely
  • QR Code Scanning - Easy TOTP setup via camera or file upload
  • Password Generator - Advanced generation with customizable complexity
  • Import/Export - Encrypted backup with password protection
  • Custom Themes - Light and Dark modes with custom splash screens
  • Session Security - Automatic timeouts and secure authentication

โšก Power Efficient

  • Smart WiFi - Only active for time sync and web server
  • Light Sleep Mode - Automatic power saving after 30 seconds
  • Battery Monitoring - Real-time voltage and percentage display
  • Optimized Display - Intelligent brightness control for battery life

๐Ÿš€ Quick Start

Prerequisites

  • PlatformIO IDE (VS Code extension recommended)
  • LILYGOยฎ TTGO T-Display ESP32 board
  • USB-C cable for programming

Installation

  1. Clone the repository

    git clone https://github.com/Unix-like-SoN/SecureGen.git
    cd SecureGen
  2. Open in PlatformIO

    • Launch VS Code with PlatformIO extension
    • Click "Open Project" and select the cloned folder
  3. Build and Upload

    • Connect your T-Display board via USB
    • Click "Upload" in PlatformIO toolbar (or press Ctrl+Alt+U)

First Boot Setup

  1. WiFi Configuration

    • Device creates AP: ESP32-TOTP-Setup
    • Connect and navigate to 192.168.4.1
    • Enter your WiFi credentials
  2. Security Setup

    • Create administrator password for web interface
    • Set optional PIN code for device startup
    • Configure BLE security settings
  3. Time Synchronization

    • Device automatically syncs time via NTP
    • Required for accurate TOTP generation
  4. Ready to Use!

    • Device switches to normal operation
    • Access web interface at device IP address

๐ŸŽฎ Device Controls

Button Operations

Button Action Function
Button 1 (Top) Short Press Navigate to previous item
Long Press (5s) Switch TOTP โ†” Password Manager mode
Button 2 (Bottom) Short Press Navigate to next item
Long Press (5s) Power off (deep sleep)
Both Buttons 2 seconds (Password Mode) Activate BLE keyboard transmission
5 seconds (on boot) Factory reset (wipe all data)

Wake from Sleep

  • After 30 seconds of inactivity, device enters light sleep
  • Press Button 2 to wake the device
  • Note: Button 1 cannot wake device due to hardware limitation

๐Ÿ”ง Operating Modes

Device Modes

1. TOTP Authenticator Mode

  • Displays service name, 6-digit code, and countdown timer
  • Compatible with all standard 2FA services
  • Encrypted storage with unique device key
  • Real-time code generation with visual progress indicator

2. Password Manager Mode

  • Secure offline password vault
  • Optional password masking for privacy
  • BLE keyboard transmission to any device
  • Advanced password generation tools
  • Batch operations and secure backup

Network Modes

3. Offline Mode (Air-Gapped)

  • Complete offline operation
  • Maximum security through network isolation
  • Password Manager works independently
  • Optimized battery life with WiFi disabled

4. Access Point (AP) Mode

  • Device creates own WiFi hotspot
  • Web interface for configuration
  • Isolated network environment
  • Secure password access

5. WiFi Client Mode (Self-Hosted)

  • Connects to existing network
  • Always-on server application
  • Accessible to trusted devices
  • Perfect for home/team deployment
  • Functions like Bitwarden or KeeWeb with dedicated hardware

6. BLE Security Mode

  • PIN authentication on connecting device
  • Encrypted transmission with MITM protection
  • Device bonding for trusted connections
  • Automatic timeout after transmission

๐Ÿ›ก๏ธ Security

Multi-Layer Protection System

This device implements 7+ layers of security for protecting your sensitive data:

Layer 1: Key Exchange

  • Elliptic Curve Diffie-Hellman (ECDH) with P-256 curve
  • Establishes secure session keys
  • Forward secrecy protection

Layer 2: Data Encryption

  • Session-based encryption for all communications
  • Unique encryption per message
  • Replay protection with message counters

Layer 3: URL Obfuscation

  • Dynamic API endpoint paths
  • SHA-256 based generation
  • Rotates on device reboot

Layer 4: Header Obfuscation

  • Dynamic HTTP header mapping
  • Hides sensitive metadata
  • Regenerated on each boot

Layer 5: Fake Header Injection

  • Adds decoy headers to confuse traffic analysis
  • Mimics browser behavior
  • Random values per request

Layer 6: Method Tunneling

  • HTTP method obfuscation
  • All requests appear as POST
  • Additional protocol-level protection

Layer 7: Anti-Timing Analysis

  • Random delays in cryptographic operations
  • Prevents timing-based attacks
  • Masks operation patterns

Plus: CSRF protection, session management, rate limiting, and more.

Data Protection

Encryption at Rest:

  • AES-256 encryption for all sensitive data
  • Unique device keys from hardware parameters
  • Hardware-accelerated cryptography
  • Secure key derivation (PBKDF2-HMAC-SHA256)

Physical Security:

  • PIN protection for device startup (4-10 digits)
  • Secure boot support
  • Factory reset with secure data wiping
  • Memory protection against leakage

Bluetooth Security:

  • LE Secure Connections with MITM protection
  • AES-128 encryption (BLE standard)
  • PIN-based pairing
  • Device bonding for trusted connections

For detailed security information:


๐Ÿ“ฆ Hardware Requirements

Primary Components

  • Board: LILYGOยฎ TTGO T-Display ESP32
  • Display: 1.14" ST7789 TFT (135x240 pixels)
  • Battery: Li-Po battery with JST connector (recommended โ‰ฅ500mAh)
  • Connectivity: WiFi 802.11 b/g/n + Bluetooth 5.0 LE

Technical Specifications

  • Processor: ESP32 dual-core Xtensa LX6 @ 240MHz
  • RAM: 520KB SRAM with intelligent memory management
  • Storage: 4MB Flash with wear-leveling filesystem
  • Security: Hardware-accelerated AES encryption
  • Power: Optimized for battery operation with multiple sleep modes
  • Temperature: -40ยฐC to +85ยฐC industrial grade

๐Ÿ“š Documentation

User Guides

Developer Resources

Recent Updates


๐Ÿ” Security Best Practices

Recommended Security Measures

Network Security

  • Use strong WiFi passwords (WPA3 if available)
  • Consider network isolation for the device
  • Regularly update firmware through web interface
  • Monitor access logs for suspicious activity

Physical Security

  • Keep device physically secure when not in use
  • Enable PIN protection for startup
  • Use factory reset if device is compromised
  • Store backup files in encrypted storage

Data Management

  • Regularly export encrypted backups
  • Use strong administrator passwords
  • Change PIN codes periodically
  • Log out from web sessions when finished

BLE Security

  • Only pair with trusted devices
  • Remove old bonded devices periodically
  • Use PIN protection for BLE transmission
  • Monitor BLE connection status

๐ŸŒ Community & Resources

Stay Connected

Featured On

Share Your Build

Built your own SecureGen? We'd love to see it!

  • Tag us on social media
  • Submit to Discussions
  • Share photos in the community

๐Ÿค Support

Get Help

Contributing

Contributions are welcome! Please read our Contributing Guidelines before submitting pull requests.

Sponsorship & Donations

If you like this project and want to support its development, you can do so in the following ways:

GitHub Sponsors:

Sponsor

Cryptocurrency Donations:

  • TetherUSD (USDT) BEP-20 (Binance Smart Chain):

    0x4f85f29892b261fa8029f3cfd64211e166744733
    
  • TetherUSD (USDT) TRC-20 (Tron):

    TDnjDg9HxySo1J2FPSrvWQejyZ4gHKiXSJ
    

Your support is very important and helps continue working on open-source projects!

โญ Star this repository if you find it useful!

For more ways to support, see SUPPORT.md.


๐Ÿ“„ License

This project is licensed under the MIT License.

What This Means

โœ… You can:

  • Use this software for personal or commercial purposes
  • Modify the source code
  • Distribute copies
  • Sublicense the software
  • Use it privately

โš ๏ธ You must:

  • Include the original copyright notice
  • Include the MIT License text

โŒ You cannot:

  • Hold the author liable for any damages
  • Use the author's name for endorsement without permission

For full license text, see the LICENSE file.

Third-Party Licenses

This project uses the following open-source libraries:

  • TFT_eSPI - FreeBSD License
  • ESPAsyncWebServer - LGPL-3.0 License
  • AsyncTCP - LGPL-3.0 License
  • ArduinoJson - MIT License
  • mbedTLS - Apache 2.0 License (included in ESP-IDF)

๐Ÿ™ Acknowledgments

  • ESP32 community for excellent libraries and support
  • LILYGO for the T-Display hardware platform
  • All contributors and users of this project

Made with โค๏ธ for the open-source community

โฌ† Back to Top