Encryption
GRIPLOCK implements end-to-end encryption for all credential transmission between the mobile app and dashboard. This document details the cryptographic protocols used.Encryption Stack
| Layer | Algorithm | Key Size | Purpose |
|---|---|---|---|
| Key Exchange | X25519 | 256-bit | Establish shared secret |
| Key Derivation | HKDF-SHA256 | 256-bit | Derive symmetric key |
| Symmetric Encryption | AES-256-GCM | 256-bit | Encrypt credentials |
Key Exchange Protocol
Overview
GRIPLOCK uses X25519 Elliptic Curve Diffie-Hellman (ECDH) for key agreement:Implementation
Shared Secret Derivation
Raw X25519 output is passed through HKDF for additional security:- Key stretching
- Domain separation
- Additional entropy mixing
Symmetric Encryption
AES-256-GCM
Credentials are encrypted using AES-256 in Galois/Counter Mode:Properties
| Property | Guarantee |
|---|---|
| Confidentiality | Only parties with shared secret can decrypt |
| Integrity | GCM authentication tag detects tampering |
| Authenticity | Ciphertext is authenticated to the encryption key |
Decryption
Encrypted Payload Format
Transmission Format
Example
Session Storage Encryption
Credentials persisted in browser storage are also encrypted:Storage Key Derivation
- Storage encryption key is derived from session ID
- Session ID must be known to decrypt storage
- Different sessions use different encryption keys
Security Guarantees
Forward Secrecy
Each session generates new ephemeral keypairs:Zero Server Knowledge
The signaling server only sees encrypted payloads:Memory Zeroization
All sensitive data is cleared immediately after use:Attack Resistance
Man-in-the-Middle
Man-in-the-Middle
The QR code contains the dashboard’s public key. An attacker would need to intercept the QR display (physical access) to substitute their own key.
Replay Attack
Replay Attack
Fresh nonces for each encryption and session-specific keys prevent replaying old encrypted payloads.
Chosen Ciphertext
Chosen Ciphertext
AES-GCM’s authentication tag rejects any modified ciphertext, preventing CCA attacks.
Timing Attack
Timing Attack
Noble cryptography libraries use constant-time comparison and operations.
Cryptographic Library
GRIPLOCK uses the Noble suite of cryptographic libraries:Why Noble?
- ✅ Audited by Cure53
- ✅ No native dependencies
- ✅ Constant-time implementations
- ✅ Modern, well-maintained
- ✅ TypeScript support
