TwoKey — Password Manager� with a Physical Access Token
Under supervision of: Dr. Karim Emara � TA. Abdulrahman Ali�
Team Members:
Table of Content
Introduction & Problem Definition
The Problems: Passwords
01
03
Image credit: tekmanagement.com, hackingarticles.in
How many unique passwords do you have?
How many of you got this email before?
Existing Solutions
Existing Solutions: Password Managers
Old, local solutions
Newer, cloud-based solutions
KeePass
KeePassX
KeePassXC
GNOME-Keyring
Enpass
Existing Solutions: 2FA - The Factors of Authentication
Something you are
Something you have
Something you know
*There are also 2 � other factors: �- Somewhere you are �- Something you do
Existing Solutions: 2FA
Image credit: zukotech.com
The Problems of Existing Solutions
Research credit: https://www.ise.io/casestudies/password-manager-hacking/
TwoKey’s Objective
Project Objective: Secure Programming
Project Objective: Secure Communication
Project Objective: Strong Passwords
Project Objective: Protection from 2FA/SMS Attacks
Project Objective: Trust
Image credit: publicdomainvectors.org
Target Consumer
Convenience
Security
Introducing: TwoKey
A minimal, cloud-based, secure password manager with a physical hardware-based 2FA.
System Architecture
TwoKey: System Architecture
Browser�Extension
Desktop App
Hardware Token
Server
Modules from Security Standpoint
Attack | Module | Security Practice |
Brute Force | Desktop App, Server-Side | Strong and different password for each account. |
Phishing | Browser Extension | Fill password when the service domain is verified with the server. |
Dictionary/Rainbow Table Attack | Desktop App | PBKDF is used for key stretching and to make password cracking difficult. |
Less Common Interfaces | Desktop App, Browser Extension | Hardware tokens are always checked for verification. |
GSM Sniffing | Hardware Token | No SMS Security Codes are used as a 2FA. The only 2FA is the USB token. |
MITM Attack | Desktop App, Browser Extension, Server-Side | Credentials are encrypted and transferred securely between modules and memory is sanitized. |
Hardware Token | Authentication token and encryption keys never leave the chip on the USB device. | |
Replay/Playback Attack | Hardware Token, Server-Side | A random challenge is always sent each time for authentication. |
Desktop App, Server-Side | Random session keys/tokens. | |
Insecure Programming Attacks | The Entire Project | Secure programming to avoid common vulnerabilities such as BOF, ROP/Ret2LibC, Format String Attacks, etc... |
Demo
TwoKey: Demo - Registration
System Design and Implementation
Modules of TwoKey
Modules: Desktop App
TwoKey: Desktop App - UI/UX
TwoKey: Desktop App - UI/UX
TwoKey: Desktop App - Password Generation
TwoKey: Desktop App - Data Encryption
Key Derivation Function�PBKDF2HMAC
Master Password
Salt�(added bytes)
Number of Iterations�(10,000)
New Derived Key
TwoKey: Desktop App - Secure Programming
TwoKey: Desktop App - Hardware Communication
TwoKey: Desktop App - Hardware Comm. (Windows)
QAbstractEventFilter
Sources: https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-registerdevicenotificationw
https://doc.qt.io/qt-5/qabstractnativeeventfilter.html
USBEventHandler
TwoKey: Desktop App - Hardware Comm. (Linux)
TwoKey: Desktop App - Hardware Communication
TwoKey: Desktop App - Hardware Communication
TwoKey: Desktop App - Browser Extension Comm.
TwoKey: Desktop App - Browser Extension Comm.
TwoKey Main Thread [0]
HTTP Server Thread [1]
Event Handlers in Thread 0
TwoKey: Desktop App - Server Communication
Modules: Hardware Token
TwoKey: Hardware Token - Hardware Communication
TwoKey: Hardware Token - Hardware Communication
TwoKey: Hardware Token - Security
Modules: Browser Extension
TwoKey: Browser Extension - Architecture
⓿ Master password�� Email
Browser�Extension
Desktop App
❶ Request Tab Info
❷ Tab Info
❸ URL
❹ Credentials
Browser
TwoKey: Browser Extension - Autofill
TwoKey: Browser Extension - UI
Modules: Server Side
TwoKey: Server-Side - Registration
Serial no.
Physical ID
TwoKey: Server-Side - Login/2FA
TwoKey: Server-Side - Authentication
TwoKey: Server-Side - Secure Communication
TwoKey: Server-Side - Web Hosting
TwoKey: Server-Side - Secure Communication
TwoKey: Server-Side - Secure Communication
TwoKey: Server-Side - Secure Communication
TwoKey: Server-Side - Multiple Concurrent Connections
Desktop App
Invoke the callable object
Unix socket
Unix socket
Request from client
Request from response
Reverse Proxy
TwoKey: Server-Side Functionalities - Database
System Analysis
TwoKey: System Analysis - User Features
TwoKey: System Analysis - Session Initialisation
Server
Hardware Token
Stored/Spec:
- 2FA Key
- Master Password Hash
- Encrypted Credentials
- Can generate random� challenges
- Can encrypted any� generated challenge
Desktop App
❶ Username, master password hash
❷ Random challenge
❺ Encrypted challenge
❸ Random challenge
Stored/Spec:
- 2FA Key
- Can encrypt the given
challenge with a unique key
❹ Encrypted challenge
❻ Session granted
TwoKey: System Analysis - Session Initialisation
TwoKey: System Analysis - Credentials Retrieval
Browser�Extension
Server
Desktop App
❷ URL for service, session token
❸ Credentials for the URL
❹ Credentials
❶� URL
Knows:
- Master Password
User
⓿ Browses a URL, already signed in
⓹ Extension autofills the form
TwoKey: System Analysis - Desktop Class Diagram
Tools Used
Used Tools and Frameworks
Cont.: Used Tools and Frameworks
Conclusion and Future Work
TwoKey: The Big Picture
Browser�Extension
Desktop App
Hardware Token
Server
�[0]�TwoKey(GUI)�
[0]�USBCommunicator*��USBEventHandler
[1]�BrowserExtensionCommunicator
[0] - Main thread , [1] - Secondary Thread�*Creates a thread for each event handling.
�[0]�BackendClient�
On tab update or login
TwoKey: Future Work
Image credit: fierceelectronics.com
TwoKey: Desktop Application
Image credit: fierceelectronics.com
TwoKey: Hardware Token
HSM
Image credit: fierceelectronics.com
TwoKey: Browser Extension
TwoKey: Server Side and Infrastructure
Server 1
Server 3
Server 2
TwoKey: Additional Modules
Thank you!