Manual · Omni-Encryption
Sessions and envelopes
The two ways Omni-Encryption protects traffic: authenticated sessions between two peers, which run in one process in 0.8.0, and second-layer envelopes for service traffic between your own programs.
Two ways to protect traffic
A session joins two peers. They agree a key with the hybrid key exchange, each checks the other's signature, and then they exchange frames bound to the session, the direction and a sequence number.
An envelope wraps one payload of a service, such as an HTTP JSON body, in a second encryption layer under a key that your services share.
Both run inside your own programs, above TLS and not in place of it.
Sessions
- In 0.8.0 the two peers of a session run in one process, and the caller holds both peers' private keys. There is no network transport.
- Key exchange: X25519 combined with ML-KEM-1024. A handshake with an altered hybrid ciphertext, another suite identifier or only one of the two components is rejected, so there is no fallback to a single algorithm.
- Authentication: each peer checks the other's ML-DSA-87 signature. Only the key exchange is hybrid; authentication uses ML-DSA-87 alone.
- Frames: a PeerPair session uses AES-256-GCM unless the cascade is selected, AES-256-GCM and then ChaCha20-Poly1305 under two separate keys. The low-level OmniCipher uses the cascade by default. Nonces are counters.
- Rejected frames: replayed, reordered, truncated, altered and wrong-key frames.
- Rekeying: an authenticated three-step exchange (prepare, acknowledge, commit). A forged rekey request or a forged acknowledgement is rejected. A PeerPair rekeys every 64 messages by default.
- Limits per key: at most 2^20 messages and 2^30 bytes, and 16 MiB per frame.
| Size on the wire | Bytes |
|---|---|
| Hybrid handshake: key-exchange data | 1,600 |
| Hybrid handshake: sender authentication (ML-DSA-87 public key and signature) | 7,219 |
| Added to each frame, AES-256-GCM | 130 |
| Added to each frame, cascade | 146 |
Envelopes
- The layer is off unless it is switched on and a key is available. While it is off, the adapters pass data through unchanged; once it is on, the control adapters refuse plaintext input.
- HTTP JSON, agent RPC and chat envelopes carry an expiry, 300 seconds by default and at most one day, and a sender counter, and a replayed envelope is rejected.
- Audit and key-value envelopes do not expire and can be read more than once by design, so they must not carry commands.
- The built-in replay store is designed for one process. Several receivers need a shared atomic store that you supply.
- Rotating the key invalidates existing envelopes.
Public traffic stays on TLS
Recognised public hosts, any dotted DNS name and any global IP address count as public. The package refuses to wrap traffic to them, or passes it through unchanged, so it stays on standard TLS. Its TLS client context requires TLS 1.3, uses the system's trusted roots and checks host names.
The classification is a heuristic: private-range addresses and single-label host names count as your own fleet, and an address in the IPv6 documentation range is wrongly classed as fleet, a gap the project records.
Identity pins
Pins hold the public keys of known peers in three trust modes: an explicit pin, trust on first use (recorded as an audit event), and a pin tied to a validated TLS certificate. A known peer that presents a changed key is refused.
The pin file is plain JSON that is not tamper-evident, pins accepted on first use never expire, and rotation is not independent dual control.
Which one to use
| You need to protect | Use |
|---|---|
| Messages between two peers that must authenticate each other (in 0.8.0 both run in one process) | A session: PeerPair with the hybrid key exchange. The caller holds both private keys, and there is no network transport |
| Service traffic between your own hosts, such as HTTP JSON bodies or RPC payloads | A second-layer envelope, above TLS |
| A file you keep | File sealing: AES-256-GCM, up to 16 MiB |
| Traffic to a public API or website | Standard TLS only; the package refuses to wrap it |
Documents for this section
-
Omni-Encryption spec sheet
Version 0.8.0, status Evaluation: interfaces, standard algorithms, sizes, measured timings with their date and conditions, what it checks and refuses, and what it does not do yet.
-
Omni-Encryption white paper
A second encryption layer above TLS for traffic between your own services, agents and machines: the problem, the approach, the behaviour the tests cover, what it leaves to TLS and to the host, its limits, and how to evaluate it.