Status and scope
Status: Conceptual reference design implemented by the SDKs in this project. Scope: Educational and interoperable demo specification for human-memorized hotkey-chord secrets.
HKEY v1 is not presented as a drop-in replacement for audited, standardized cryptography in regulated environments. For high-risk deployments, pair HKEY concepts with standards-based primitives and independent review.
1. Goals
- Derive strong symmetric keys from ordered hotkey chord sequences (e.g.
Ctrl+Alt+K,Shift+H,Meta+E). - Provide deterministic, cross-language behavior (PHP, TypeScript, Python, Mojo).
- Support authenticated encryption for messages, files, and workflow tokens.
- Enable a human input model usable beyond software: labs, control rooms, education, accessibility, and field operations.
2. Terminology
- Chord: normalized combination of modifiers and a primary key pressed as one gesture.
- Hotkey sequence: ordered list of chords (order matters).
- Gesture salt: context string binding purpose/domain (e.g.
lab.freezer.alpha). - Sequence digest: SHA-256 commitment of the full normalized sequence encoding (label/audit aid, not secret).
- HKEY packet: versioned container holding nonce, ciphertext, and authentication tag.
3. Chord normalization
3.1 Modifier order
Ctrl, Alt, Shift, Meta (Win/Cmd/Super), then the primary key.
3.2 Key rules
- Alphabetic keys uppercased (
k→K); named keys in Pascal form (Enter,Esc,Tab,Space,F1…). - Symbols preserved; duplicate modifiers removed; empty/unknown primary keys rejected.
3.3 Fingerprint and encoding
Fingerprint: <mods joined by '+'>+<KEY> (e.g. Ctrl+Alt+K, Shift+Space, Meta+Enter).
Sequence encoding (UTF-8):
SEQv1:<gesture_salt>
<fingerprint1>
<fingerprint2>
...
4. Key derivation
- Input:
password = UTF8(sequence_encoding),salt = UTF8("HKEYv1|" + gesture_salt) - Stretch: PBKDF2-HMAC-SHA256,
iterations = 210000,dkLen = 32→ master key (MK) - Subkeys:
enc_key = HMAC-SHA256(MK, "hkey:enc:v1"),mac_key = HMAC-SHA256(MK, "hkey:mac:v1") - Digest:
SHA256(sequence_encoding)hex (public-safe commitment)
5. Encryption: HKEY-CTR-HMAC (Encrypt-then-MAC)
- Generate random
nonce(12 bytes). - Keystream blocks:
KS_i = HMAC-SHA256(enc_key, nonce || counter_i_be32). ciphertext = plaintext XOR keystream.tag = HMAC-SHA256(mac_key, "HKEYv1" || nonce || ciphertext || uint64_be(len(plaintext))).- Verify tag in constant-time comparison before releasing plaintext on decrypt.
6. Packet format (JSON, v1)
{
"version": "HKEYv1",
"alg": "HKEY-CTR-HMAC-SHA256",
"kdf": "PBKDF2-HMAC-SHA256-210000",
"nonce": "<base64>",
"ciphertext": "<base64>",
"tag": "<base64>",
"digest": "<sha256 hex of sequence encoding>"
}
7. Security considerations
- Entropy: security depends on sequence unpredictability and length (recommend ≥ 4 chords with mixed modifiers/keys and unique salts).
- Observation risk: gestures can be shoulder-surfed; combine with hidden-entry UX or additional factors where needed.
- Context binding: always bind salts to purpose, tenant, environment, or mission.
- Quantum posture: the symmetric/hash-based 256-bit core avoids Shor-exposed public-key math and offers a quantum-resilient margin (Grover’s quadratic bound); real security still depends on entropy and operations.
- Standards: AES-GCM/ChaCha20-Poly1305 are mature AEAD primitives—consider pairing HKEY UX with standard AEAD cores and standardized PQC for asymmetric needs in production.
8. Interoperability test shape
Implementations must agree on normalization and verification for identical inputs (e.g. sequence ["Ctrl+Alt+H","Shift+K","Meta+E","Y"], salt demo.torus.field, plaintext hello hkey). Use fixed nonces only in test mode; production nonces must be random.
For implementation details and examples, download the SDKs or read the per-language SDK documentation on this site.