K073 / Advanced and next-generation cryptography
Hybrid encryption
An encryption scheme combining a key encapsulation mechanism (KEM) with a data encapsulation mechanism (DEM), called hybrid encryption.
CRYPTOGRAPHY LAB / K073
Cryptography Lab · Hybrid encryption
Run real computations and inspect intermediate states step by step.
Educational only. Never enter real passwords or secret keys. Computation stays in your browser; input and trace values are not sent to a server. Do not use this implementation in production.
Hybrid encryption (X25519 + HKDF-SHA256 + AES-256-GCM; custom demo, not a wire protocol)
See the scope above for fixed examples, reduced parameters and supported variants. Standard operation names and formulas are retained.Output
Previous state
- Definition and overview
- An encryption scheme combining a key encapsulation mechanism (KEM) with a data encapsulation mechanism (DEM), called hybrid encryption. Source document ↗
- Classification and reversibility
- Public-key encryption; only private-key holder can decrypt. Source document ↗
- Key or secret requirements
- KEM encapsulates random symmetric key using public key; DEM uses symmetric key. Source document ↗
- Operating principle and structure
- KEM establishes fresh session key independent of message; DEM encrypts message. Source document ↗
- Key size, block size and parameters
- Example combines ML-KEM-768, X25519, HKDF and AES-256-GCM. Source document ↗
- Security strength and recommendation
- Hybrid secret designed to remain secure if at least one constituent remains secure. Source document ↗
- Known attacks and vulnerabilities
- ML-KEM secret-dependent division timing leak (KyberSlash) reported. Source document ↗
- Standards and certification
- RFC 9180 defines HPKE hybrid public-key encryption. Source document ↗
- Typical uses
- Encrypt large documents/files combining public-key and symmetric ciphers. Source document ↗
- Implementations, libraries and tools
- Google Tink provides hybrid encryption API examples. Source document ↗
- Decryption or decoding
- Receiver decapsulates symmetric key then decrypts body with it. Source document ↗
- Advantages
- Mitigates large keys and plaintext-space limitations of public-key encryption. Source document ↗
- Limitations and cautions
- Provides confidentiality, but sender authentication/authenticity must be separately ensured. Source document ↗
- Distinguishing encryption, encoding and hashing
- Public-key encryption/private-key decryption, not encoding/hash. Source document ↗
Practical examples
Example
Sender uses recipient public key in KEM to create session key/capsule, derives DEM key via KDF, encrypts body using AEAD and sends both ciphertexts. Receiver decapsulates privately, rederives DEM key and decrypts.
Procedure
Verify public key, KEM Encaps, KDF derive DEM key, AEAD/DEM encrypt, combine capsule/body. Decaps privately, same KDF, DEM decrypt and verify integrity. Encoding is keyless representation; hash irreversible.
Scenario
TLS, messaging or files where public keys are distributed and large data sent securely. Receiver keeps private key; sender uses fresh session key per message and optional separate signature.
Pitfalls and alternatives
Do not use public-key encryption alone for bulk data or authentication; explicitly design KEM/DEM, KDF, AEAD, nonce management and sender authentication. Avoid timing vulnerabilities and nonce reuse; use vetted libraries.
References
- Public Key Encryption Based on Discrete Logarithms ↗
- Hybrid Encryption | Tink | Google for Developers ↗
- Hybrid Encryption in a Multi-User Setting, Revisited ↗
- latticearc - Rust ↗
- RFC 9954: Hybrid Key Exchange in TLS 1.3 ↗
- ML-KEM (post-quantum key exchange) · Encryption Codex ↗
- RFC 9180: Hybrid Public Key Encryption ↗
- Asymmetric Key Ciphers ↗
- python/examples/hybrid/hybrid_basic.py ↗
- Co6GC: Hybrid encryption - COSIC ↗