Deep dive into algorithm choices, key sizes, Initialization Vectors, and security rationale.
Cryptographic Choices
| Primitive Type | Algorithm Choice | Rationale & Key Sizes | Misuse Risks |
|---|---|---|---|
| Asymmetric Keys | X25519 (ECDH) | 256-bit key size. High security, extremely fast key derivation. Native to browser WebCrypto API. | Reusing ephemeral keys indefinitely (mitigated by key rotation or Double Ratchet). |
| Symmetric Cipher | AES-256-GCM | 256-bit key. Galois Counter Mode provides AEAD (Authenticated Encryption with Associated Data). | IV Reuse: Reusing the same IV with the same key destroys confidentiality and integrity guarantees. |
| Key Derivation | HKDF (SHA-256) | Extracts and expands entropy from ECDH shared secrets to produce cryptographically strong symmetric keys. | Using raw DH shared secrets as symmetric keys directly without expansion. |
| Password KEK | Argon2id / PBKDF2 | Memory-hard hashing function to encrypt local key bundles on disk. | Using weak iterations or lack of unique salting leading to dictionary lookup attacks. |