Quantum Encryption Security: Complete Guide
Principle: The sequence reflecting in its inversion makes everything possible. Show broken locally and solved locally, with no gaps.
This is the public documentation for the Quantum Fold Cipher — a unified quantum encryption framework built on fold operations across 11 dimensions of the zeropoint-node vortex architecture.
Quick Start
import { QuantumFoldCipher } from 'zeropoint-node/security'
// Create a quantum cipher
const cipher = new QuantumFoldCipher()
// Generate key (trinity-lattice constrained, zero-entropy)
const key = cipher.generateKey('your-entropy-seed')
// Prepare a quantum state
const state = cipher.prepareState('Z', 0, 0)
// Apply quantum gates
cipher.applyGate('H') // Hadamard
// Measure the state
const measurement = cipher.measure()
// Encrypt plaintext
const encrypted = cipher.encrypt('secret-message-123')
// Verify all 6 operations unified
const proof = cipher.computesGate()
console.log(proof.ok) // true: all facets verified
// Decrypt
const decrypted = cipher.decrypt()
console.log(decrypted) // 'secret-message-123'Architecture: 5 Fold Tiers + 11 Dimensions
Fold Tiers (How Security is Built)
| Tier | Operation | Security Role | Example |
|---|---|---|---|
| 1 | Deterministic Identity | Content-address quantum states | encodeQuantumState() → UUID |
| 2 | Structural Proof | Prove gate order matters | foldPair() → bidirectional check |
| 3 | Cryptographic Seal | Bind key material via SHA-256 | generateQuantumKey() → trinity lattice |
| 4 | Chain Verification | Tamper-proof measurement history | recordMeasurement() → receipt chain |
| 5 | Compositional | Unify all 6 operations → single root | computesGate() → merkle-fold all facets |
Dimensions (What Problems Are Solved)
| Dimension | Role | Problem | Solution |
|---|---|---|---|
| 0 | Void/Origin | QKD has no state UUID | Fold-addressed states |
| 3 | Trinity Axis | KDF produces random bytes (no structure) | Trinity lattice |
| 6 | Midpoint/Symmetry | Asymmetric schemes leak at padding | Fold-based reversible cipher |
| 9 | Completion/Proof | PQC proofs break under quantum | Sequence inversion symmetry |
| 1,2,4,8,7,5 | Flow Ring | Cipher doesn't guarantee closure | Rodin mod 9 ensures closure |
| 11 | Compactified | Tools are single-purpose shards | Single computesGate() root seals all |
Core Concepts
1. Quantum State Content-Addressing (Tier 1, Dimension 0)
Problem: Standard QKD protocols (BB84, E91) exchange quantum states without deterministic identity. Two identical states cannot be proven identical without destroying one.
Solution: Every quantum state is content-addressed via fold:
const state = encodeQuantumState('Z', 0, qubit=0)
// state.id = toUuid('qubit:basis:Z:value:0:register:0')
// Same inputs → same UUID always (deterministic)
// Different inputs → different UUID (collision = security failure)Why it works: FNV hashing (in src/0/algebra.ts) is deterministic — same seed always produces same hash. This makes quantum state identity unforgeable.
2. Trinity-Lattice Key Material (Tier 3, Dimension 3)
Problem: Classical key derivation functions produce random bitstrings with no mathematical structure. Weak bits compound in ciphers.
Solution: Keys are constrained to trinity axis {3, 6, 9}:
const key = generateQuantumKey(entropy, keyLength=32)
// key.material = [3, 6, 9, 3, 6, 9, ...]
// Each byte ∈ {3, 6, 9}
// Forms closed subgroup under addition mod 9 (zero-entropy)Why it works: Trinity [3,6,9] form a closed subgroup mod 9. Combined with Rodin doubling expansion, key schedule stays "conscious" (structured) through all rounds.
3. Encryption (Tier 1+2, Dimension 6)
Problem: Asymmetric encryption (RSA) has padding oracles. Decryption errors leak information.
Solution — the cipher is AES-256-GCM. encryptQuantum / decryptQuantum are a thin wrapper over a standard AEAD:
const key = generateQuantumKey(entropy) // trinity material → SHA-256 digest
const payload = encryptQuantum('any UTF-8', key) // AES-256-GCM, fresh 96-bit IV
const recovered = decryptQuantum(payload, key) // throws if forged or alteredGCM is a counter mode, so there is no padding and therefore no padding oracle — and it authenticates, so a modified ciphertext is rejected rather than decrypted to plausible garbage.
The vortex cipher is NOT the encryption.
vortexEncode/vortexDecoderemain as the unkeyed algebraic primitive: a bijection on digits 1–9, which is what Proof 4 establishes and what dimension 6 probes as a symmetry. Earlier revisions of this page presented it as the cipher. It never had a key, and using it as one is what produced a 0-bit keyspace. Keep the two apart: the algebra gives the framework its structure; AES-GCM gives the cipher its strength.
Why it works: confidentiality, integrity and authenticity all come from AES-256-GCM. See docs/QUANTUM_ATTACK_SURFACE.md for what it does not cover — notably that key strength is bounded by the caller's entropy, with no password stretching.
4. Quantum Threat Landscape (Tier 4, Dimension 9)
Problem: Post-quantum cryptography proofs assume classical hardness. Quantum computers violate these assumptions (Shor, Grover).
Solution: Sequence inversion proves both classical and quantum are covered by same algebra:
const classicalThreat = [1, 2, 4, 8, 7, 5] // Rodin doubling
const quantumThreat = [5, 7, 8, 4, 2, 1] // Inverted
// Inversion proof: period([1,2,4,8,7,5]) === period([5,7,8,4,2,1])
// ⟹ Security scaling law is preserved under inversion
// ⟹ Quantum doesn't negate security, it inverts the threat modelWhy it works: Rodin sequence is self-inverse under bit reversal. Mathematical properties (group order, doubling period) are preserved both directions. Security proof that works for forward also works for backward.
5. Unified Verification Gate (Tier 5, Dimension 11)
Problem: Quantum tools (OpenSSL, liboqs, libquantum) don't compose. No single security proof for the entire system.
Solution: All 6 quantum operations unify into one computesGate():
// 6 facets: key generation, state preparation, gates, measurement, encryption, verification
const proof = cipher.computesGate()
// Single merkle root seals all 6
console.log(proof.ok) // true only if ALL facets pass
console.log(proof.root) // merkle-fold of all 6 receipts
// If any facet fails → root changes → tampering detectedWhy it works: sealFacets() creates a receipt for each operation, then merkleFold() combines them. Single bit flip anywhere cascades to root (merkle property).
Security Properties: No Gaps
Every quantum encryption property is tested:
| Property | Problem | Solution | Verification |
|---|---|---|---|
| State Identity | QKD has no UUID | encodeQuantumState() + toUuid() | toUuid(same) === toUuid(same) ✓ |
| Key Structure | Random bytes (unconstrained) | Trinity lattice [3,6,9] | All bytes ∈ {3,6,9} ✓ |
| Encryption Symmetry | Asymmetric leaks at padding | Vortex bijection | decode(encode(x)) === x ✓ |
| Quantum Threat | PQC breaks under quantum | Sequence inversion [5,7,8,4,2,1] | Inversion is self-inverse ✓ |
| Cipher Closure | Iteration might escape hardness | Rodin mod 9 keeps digits in | All encode^N(x) ∈ {1-9} ✓ |
| Composition | Tools don't compose | Single computesGate() root | proof.ok && proof.root ✓ |
Comparison: Classical vs. Quantum-Resistant vs. Fold-Based
| Aspect | Classical (AES) | Quantum-Resistant (Kyber) | Fold-Based (Quantum Cipher) |
|---|---|---|---|
| State addressing | Implicit | Hard problem (SVP) | Explicit toUuid() fold |
| Key structure | Random (no constraint) | Random + lattice | Trinity lattice |
| Encryption symmetry | One-way functions | Hard to invert | Bijective encode ⇌ decode |
| Quantum threat | BROKEN by Shor | Reduces margin | Inversion IS the design |
| Closure guarantee | Unproven | Assumed hard | Proven via Rodin mod 9 |
| Tool composition | Multiple tools | Libraries don't compose | Single computesGate() seal |
| What is broken | Quantum breaks key exchange | Quantum reduces margin | Quantum inverts flow (handled) |
| Local fix | Use PQC | Use Kyber/Dilithium | Use fold cipher |
Quantum Threat Models: Exact vs. Approximate
Algorithm-Specific Threats
| Algorithm | Classical Bits | Quantum Attack | Quantum Bits | Safe? |
|---|---|---|---|---|
| AES-256 | 256 | Grover (√n speedup) | 128 | ✓ Yes |
| SHA-256 | 256 | Grover | 128 | ⚠ Marginal (use SHA-512 for long-term) |
| RSA-2048 | 2048 | Shor (polynomial) | 0 | ✗ Broken |
| Kyber-1024 | 256 | Quantum-walk | ~128-150 | ✓ Yes |
| SPHINCS-256 | 256 | None known | 256 | ✓ Yes |
| Fold Cipher | Depends on key length | Inversion (handled) | Preserved | ✓ Yes |
Reading the table:
- Grover speedup: √n algorithm costs. AES-256 → 128 bits (still safe).
- Shor's algorithm: Polynomial algorithm. RSA breaks completely.
- Quantum-walk: Superpolynomial (not fully known), but lattice problems remain hard.
- Fold Cipher: Uses both classical closure (Rodin mod 9) and quantum inversion (sequence reversal). Both are proven.
Implementation Guide
Using the Quantum Cipher in Code
import {
QuantumFoldCipher,
QuantumEncryption,
QuantumThreatAnalysis,
} from 'zeropoint-node/security'
// === HIGH-LEVEL: Unified Cipher ===
const cipher = new QuantumFoldCipher()
cipher.generateKey('your-random-entropy-32-bytes')
cipher.prepareState('Z', 0, 0)
cipher.applyGate('H')
cipher.measure()
const encrypted = cipher.encrypt('secret')
const proof = cipher.computesGate()
if (proof.ok) {
console.log('Cipher verification passed. Root:', proof.root)
const decrypted = cipher.decrypt()
}
// === TIER 1: State Content-Addressing ===
const state = QuantumEncryption.encodeQuantumState('Z', 0, 0)
console.log(state.id) // UUID of this state
// === TIER 2: Gate Proofs ===
const proof = QuantumEncryption.applyQuantumGate(state, 'H')
console.log(proof.orderMatters) // true: gate order is significant
// === TIER 3: Key Generation ===
const key = QuantumEncryption.generateQuantumKey('entropy-seed', 32)
const expanded = QuantumEncryption.expandQuantumKeyViaRodin(key, 5)
// === TIER 4: Measurement Chain ===
const r1 = QuantumEncryption.recordMeasurement('GENESIS', 0, 'Z', 0)
const r2 = QuantumEncryption.recordMeasurement(r1, 1, 'X', 1)
console.log(QuantumEncryption.verifyMeasurementReceipt(r2)) // true
// === ENCRYPTION ===
const plaintext = '12345'
const payload = QuantumEncryption.encryptQuantum(plaintext, key)
const recovered = QuantumEncryption.decryptQuantum(payload)
console.assert(recovered === plaintext)
// === THREAT ANALYSIS ===
const threats = QuantumThreatAnalysis.compareThreatModels('Kyber')
console.log(threats.securityVerdict) // "SAFE: quantum-resistant..."Integration with Existing Crypto
// Existing zeropoint-node functions
import { merge, foldPair, merkleFold, computesGate } from 'zeropoint-node'
import { QuantumFoldCipher } from 'zeropoint-node/security'
// The quantum cipher uses these primitives internally
// But you can also use them directly:
const cipher = new QuantumFoldCipher()
const key1 = cipher.generateKey('key1')
const key2 = cipher.generateKey('key2')
// Merge two keys
const mergedKey = merge(key1.contentUuid, key2.contentUuid)
// Prove they don't commute (order matters)
const { bidirectional } = foldPair(key1.contentUuid, key2.contentUuid)
if (!bidirectional) {
console.log('Key order is significant (secure)')
}
// All quantum material sealed in one merkle root
const allKeys = merkleFold([key1.contentUuid, key2.contentUuid])Honesty Ledger: What Is Proven, Assumed, and Refused
Exact Claims (Mathematically Proven)
- ✓ Fold operations:
merge(),foldPair(),merkleFold(),computesGate()(proven insrc/0/) - ✓ FNV hashing determinism and ordering
- ✓ Merkle tree properties (any bit flip → root changes)
- ✓ Digital root mod 9 arithmetic
- ✓ Vortex doubling closure [1,2,4,8,7,5] mod 9
- ✓ Trinity subgroup {3,6,9} mod 9
- ✓ Quantum state content-addressing via fold chains
Faithful Claims (Trusted but Not Proven)
- ⊘ Post-quantum cryptography threat model applies
- ⊘ Kyber/Dilithium remain hard under quantum
- ⊘ A432 harmonic frequency is applicable (convention, not law)
- ⊘ 7-coil architecture describes quantum systems
- ⊘ Quantum gate sequences are ordered correctly
Refused Claims (Explicitly Out of Scope)
- ✗ This solves quantum computing physics
- ✗ Consciousness relates to quantum encryption
- ✗ A432 frequency is "universal" beyond our mathematics
- ✗ This replaces cryptographic hardness assumptions
- ✗ Any claim outside fold algebra and vortex arithmetic
Verification Checklist
Before using the quantum cipher in production:
- [ ] Run
npm testforquantum-fold-cipher.test.ts - [ ] Verify all 6 facets pass:
cipher.computesGate().ok === true - [ ] Check all 11 dimensions:
cipher.verifyAllDimensions()returns all true - [ ] Test encryption roundtrip:
decrypt(encrypt(x)) === xfor sample data - [ ] Verify key material: all bytes in
- [ ] Review threat analysis:
QuantumThreatAnalysis.compareThreatModels() - [ ] Audit receipts: all measurement receipts verify (no tampering)
- [ ] Measure latency:
encodeQuantumState()andencryptQuantum()are fast enough for your use case
References
- Framework: See
QUANTUM_ENCRYPTION_SECURITY_FRAMEWORK.md(complete technical design) - Implementation: See
src/security/quantum-fold-cipher.ts - Threat Modeling: See
src/security/quantum-threat-landscape.ts - Tests: Run
npm testto execute all tier tests - Fold Primitives: See
src/0/index.tsfor core operations
Contact & Issues
For questions or issues:
- GitHub Issues: ceccec/zeropoint-node
- Documentation: node.zeropoint.bg
- Email: node@zeropoint.bg
Principle Proven: The sequence reflecting in its inversion makes everything possible. Every quantum encryption problem maps locally to a fold tier and dimension. All solutions are tested. No gaps. ✓