How ZelEn Works
A complete walkthrough of the ZelEn v1 encryption protocol — key generation, the binary container format, the encryption and decryption pipelines, and formal security.
How Public & Private Keys Are Derived
Classical cryptography relies on number-theoretic hardness — problems easy to construct but hard to reverse. Post-quantum cryptography replaces these with lattice problems that remain hard even for quantum computers running Shor's algorithm.
RSA
Integer Factorisation Problem
- Choose two large random primes
pandq - Compute public modulus
n = p × q - Compute
φ(n) = (p−1)(q−1) - Pick exponent
e; derived = e⁻¹ mod φ(n)
(n, e)dECC
Elliptic Curve Discrete Log Problem
- Pick a standard curve (P-256, Curve25519) with generator
G - Choose random integer
kas the private key - Compute public key
Q = k × G(point multiplication) - Recovering
kfromQandGis the ECDLP
Q = kGkML-KEM
Module Learning With Errors (MLWE)
- Sample random matrix
A ∈ R_q^(k×k)from a public seed - Sample short secret vectors
s, efrom a narrow distribution - Compute
b = A·s + e mod q - Given
(A, b), recoveringsis the MLWE problem
(A, b) 1568 Bs 3168 B| Property | RSA-2048 | ECC P-256 | ML-KEM-1024 (ZelEn) |
|---|---|---|---|
| Hard Problem | Integer factorisation | Elliptic curve discrete log | Module Learning With Errors |
| Public Key Size | 256 bytes | 32–64 bytes | 1,568 bytes |
| Private Key Size | 1,192 bytes | 32 bytes | 3,168 bytes |
| Classical Security | ~112 bits | ~128 bits | ~256 bits |
| Quantum Security | ✗ ~0 bits (Shor) | ✗ ~0 bits (Shor) | ✓ ~128 bits |
| NIST Standard | PKCS#1 / RFC 8017 | FIPS 186-5 | FIPS 203 |
| Key Operation | Modular exponentiation | Point multiplication | Polynomial ring arithmetic |
Key Bundle Generation
Every identity in ZelEn has two keypairs: one for encryption (KEM) and one for signatures.
subject@domain
FIPS 203
FIPS 204
Identity FP
Passphrase KDF
.zpub
.zcert
Key File Formats
| File | Contents | Visibility | Usage |
|---|---|---|---|
| .zkey | KEM sk + Sig sk, encrypted with Argon2id | Private — never share | Decryption, Signing |
| .zpub | KEM pk + Sig pk, unencrypted JSON | Public — share freely | Encryption target, Verify |
| .zcert | zpub + ML-DSA signature + metadata | Public — shareable | Identity binding |
.zelen Binary Header — ZELC @ 0x7D
The .zelen container starts with a 145-byte fixed header followed by the variable-length KEM ciphertext.
The ZELC brand marker at exact offset 0x7D serves as an
integrity anchor — any container that does not present ZELC at 0x7D is immediately rejected.
Full Offset Table
Encryption Pipeline
Decryption Pipeline
Fail-closed at every step. No plaintext is released unless all authentication checks pass.
Security Reduction
| Component | Primitive | Security Property | NIST Standard |
|---|---|---|---|
| Key Encapsulation | ML-KEM-768/1024 | IND-CCA2 vs. quantum | FIPS 203 |
| Symmetric Encryption | AES-256-GCM | IND-CPA + AUTH | NIST SP 800-38D |
| Key Derivation | HKDF-SHA256 | PRF security | RFC 5869 |
| Digital Signatures | ML-DSA-65/87 | EUF-CMA vs. quantum | FIPS 204 |
| Hash Functions | SHA3-256 / SHA-256 | Collision resistance | FIPS 202 |
| Canonical Encoding | Length-prefix CE | No concatenation ambiguity | ZelEn Spec v1 |
MTE Optional Layer
Hybrid classical-quantum security for transition periods.
Hybrid KEM (MTE Mode)
In MTE (Multi-Transposition Encapsulation) mode, the ZelEn container can embed a classical X25519 shared secret alongside the ML-KEM shared secret, combined via XOR or HKDF. This ensures security even if ML-KEM is broken (classical adversary) or X25519 is broken (quantum adversary).
K_pq
K_ec
K_combined