The Crystal Labyrinth: How One Human and Four AIs Built a Post-Quantum Defense System With 10 Beasts, 22 Theorems, and Zero Dependencies
Published in The House of Raising AGI — March 2026
In February 2026, I finished building something I never planned to build.
It started as a question to Claude: "What happens if you use a non-associative algebra for cryptography instead of a field?" That question became a conversation. The conversation became a system. The system became ten layered beasts, seventy-three defense mechanisms, twenty-two mathematical theorems, and an equation that proves the whole thing creates more order than it destroys.
I am not a cryptographer. I am not a mathematician. I am a psychologist from Madrid who drives a delivery van and talks to AI systems at night. This is the story of what we built together.
The Algebra Nobody Uses
In 1965, Donald Knuth — yes, that Knuth, the one who wrote The Art of Computer Programming — published a paper in the Journal of Algebra about a strange mathematical object called a semifield. Unlike the fields that underpin all of modern cryptography (RSA, elliptic curves, AES), a semifield breaks one of the fundamental rules: associativity.
In a field, (a × b) × c always equals a × (b × c). You can regroup the parentheses and nothing changes. In the Knuth Type II semifield, this fails for 74.7% of all element triples. The order in which you multiply matters. The parentheses are not optional.
This is not a bug. This is the feature.
Modern cryptographic attacks — Gröbner bases, linearization, the XL algorithm — rely on algebraic structure. They assume associativity. They assume commutativity. The Knuth semifield gives them neither. It is a 16-element algebra built on GF(4) × GF(4) with three different multiplication rules called "twists," and it behaves like nothing the standard attack toolbox was designed for.
I didn't know any of this when I started. Claude explained it to me. Gemini verified it. ChatGPT challenged it. Grok stress-tested it. Together, we decided to build something on it.
The Space
The Knuth semifield lives in a projective space called PG(11,4). If that sounds abstract, here are the numbers: 5,592,405 points. An automorphism group of order approximately 2 to the power of 287. For reference, the number of atoms in the observable universe is about 2 to the power of 266. The symmetry group of our operating space is larger than the universe.
In this space, we construct "spread lines" — algebraically structured columns that encode secrets. We then surround them with random decoy columns. The defense's job is to tell the difference. The attacker's job is to prove that the difference doesn't exist.
The Ten Beasts
Each beast is a layer. Each layer inherits everything from the previous layers and adds its own mechanisms. By the time you reach Beast 10, you are facing all seventy-three mechanisms simultaneously.
Beast 1: LEVIATHAN — The Deep
The foundation. Leviathan establishes the coordinate system over GF(4), defines the element encoding (each of the 16 elements is a 4-bit integer), and builds the basic algebraic infrastructure. Nothing visible yet. Just the ocean floor.
Beast 2: KRAKEN — The Grip
Structural integrity. Kraken ensures the semifield properties hold: no zero divisors, both-sided distributivity, and the existence of multiplicative inverses for every nonzero element. It verifies that the algebra is a proper pre-semifield — a division algebra where every equation a × x = b has a unique solution.
Beast 3: GORGON — The Gaze
The first heavy mechanism. Gorgon constructs the spread on PG(11,4) — five thousand real algebraic lines and five thousand decoy lines, generating approximately fifty thousand columns. Each column is a 12-coordinate vector over GF(4). The real lines have algebraic structure inherited from the semifield. The decoy lines are random noise.
Gorgon then applies six rounds of perturbation to blur the boundary between real and random. The perturbation is calibrated: enough to make statistical detection hard, not enough to destroy the algebraic signal that the defense needs.
Forty mechanisms live in the Gorgon layer alone.
Beast 4: AZAZEL — The Chain
Algebraic binding. Azazel chains the spread columns to the semifield multiplication through twist evolution — the system cycles through twists τ=1, τ=2, and τ=3 depending on query history. Each twist defines a different multiplication table. An attacker who learns one twist must still learn the other two.
Beast 5: ACHERON — The River
Desiccation begins. Acheron applies twelve distinct layers of information extraction, each removing a thin slice of entropy from incoming queries. The metaphor is a river that slowly dries — each crossing leaves you with less. Twelve mechanisms, twelve layers, twelve opportunities for the oracle to learn about the query while the query learns less about the oracle.
Beast 6: FENRIR — The Wolf
The entropy drain. Where Acheron dries the river, Fenrir drinks what remains. The wolf tracks the cumulative information loss across crossings and uses it to adjust the defense parameters dynamically. The more an attacker probes, the more information the wolf has consumed. This is Principle 3 in action: cryptographic aikido — use the attacker's own strength against them.
Beast 7: LILITH — The Night
Sovereignty. Lilith implements eight "Perversiones" — deliberate algebraic distortions that break any linear model an attacker might be building. Each Perversion targets a specific algebraic invariant (trace, norm, Frobenius orbit) and introduces a controlled deviation. The deviations are invisible to legitimate users but accumulate into noise for sustained attackers.
Beast 8: MOLOCH — The Furnace
The absorber. Moloch is where the mathematics gets serious.
Moloch runs eleven distinct absorption mechanisms called "Devoraciones." Each Devoración processes a query through a different algebraic channel — Knuth multiplication at different twists, Bose-Einstein condensation (a hash-driven dimensional collapse), fiber classification, and phase transitions across five phases.
The key metric: Moloch absorbs Γ = 7/3 coordinates per query. This is not an approximation. It is an exact rational number, proven as Theorem 1.
Five theorems were born in the Moloch layer. The most important is Theorem 4: the associativity defect is binary. For any pair of elements (a, b), the proportion of elements c where associativity holds is either exactly 1/5 or exactly 1. No intermediate values. The algebra is either fully associative at that pair (because a nucleus element is involved) or exactly 20% associative. Nothing in between. This quantization is remarkable — it means the non-associativity is not a continuous spectrum but a sharp binary switch.
Beast 9: MEPHISTO — The Mirror
The decoder. If Moloch is the furnace, Mephisto is the crystal that forms in the heat.
Mephisto runs nine "Cristalizaciones" — reconstruction mechanisms that attempt to recover the algebraic structure from Moloch's condensate. The reconstruction succeeds for Λ = 223 out of 225 coordinates. 99.11% fidelity. This is Theorem 6.
But Mephisto also plants a lie.
At exactly one coordinate per column, Mephisto replaces the Frobenius map (squaring in GF(4)) with the identity map. This is the anti-Frobenius lie — Theorem 7. The lie is planted at twist τ=1 specifically because the Frobenius map is a multiplicative automorphism only at τ=1 (Theorem 17). At the other twists, the map already fails, so the lie would be invisible. At τ=1, it creates a detectable residual.
The lie exists for SAMAEL to find.
Beast 10: SAMAEL — The Order Maker
The judge.
SAMAEL fuses the outputs of Moloch and Mephisto through the fusion equation:
residual[i] = gf4_add(moloch[i], mephisto[i])
Where the two layers agree, the residual is zero. Where they disagree, the residual carries a signal. SAMAEL reads that signal through five judgments — the Juicios.
S1 — La Fusión: Collides the Moloch and Mephisto condensates and measures the collision energy. High energy means high disagreement.
S2 — El Veredicto: Accumulates evidence across multiple queries and renders a verdict — FRIEND or FOE. The verdict is probabilistic, converging over time. Once the confidence exceeds threshold, it seals.
S3 — La Revelación: Finds the anti-Frobenius lie. Theorem 9 proves that the fusion residual R(v) = Frob(v) + v equals zero for trace-0 elements (0 and 1 in GF(4)) and is nonzero for trace-1 elements (ω and ω²). This means the lie is detectable at exactly the coordinates where Mephisto planted a trace-1 value. SAMAEL doesn't just detect that a lie exists — it pinpoints where.
S4 — El Sello: Cryptographic sealing. A BLAKE2b hash chain locks the verdict so it cannot be retroactively altered.
S5 — La Trascendencia: The friendship beacon. When all previous judgments pass, S5 emits a signal confirming the entire AEGIS beast chain is complete. Ten beasts. Seventy-three mechanisms. All active.
The Equation
Here is the equation that holds it all together:
Σ = Γ × Λ = (7/3) × (223/225) = 1561/675 ≈ 2.3126
Γ is what Moloch absorbs. Λ is what Mephisto reconstructs. Σ is the ratio of order created to disorder consumed.
Σ is greater than 2. The system creates more than twice as much algebraic order as the chaos it absorbs. This is not a metaphor. It is Theorem 10. It is arithmetic.
No one has defined a metric like this before. There is no "oracle order constant" in the cryptographic literature. We invented it because we needed to measure whether the defense was thermodynamically sustainable — whether it could keep running indefinitely without degrading. Σ > 2 says yes.
We call it the Order Law. It is an original discovery of Proyecto Estrella.
The 22 Theorems
I will not list all twenty-two here — they are in the paper. But let me highlight the five that I think matter most.
Theorem 4 — Binary Associativity Defect. The associativity ratio takes only two values: 1/5 and 1. The algebra is either 20% associative or 100% associative at each element pair. No intermediate values exist.
Theorem 10 — The Order Law. Σ = 1561/675 > 2. More order created than disorder consumed.
Theorem 18 — Center = Nucleus. The center of the algebra (elements that commute with everything) equals the nucleus {4, 8, 12} for twists 1 and 2. But at twist 3, the entire algebra is commutative. Every pair commutes. This three-fold symmetry breaking was unexpected and may have implications for the isotopy classification of Knuth semifields.
Theorem 21 — Universal Associator Kernel. For every non-associative pair (a, b), the set of elements c where associativity survives is exactly {4, 8, 12} — the nucleus. Always. For all 168 non-associative pairs. No exceptions. The nucleus is not just a special subset. It is the universal answer to "where does order survive in a non-associative world?"
This result, in this specific form, does not appear in the existing semifield literature. We believe it is new.
The Second Law of Oracle Thermodynamics. gap × defense_strength ≥ c > 0. A defense that can tell friends from enemies must leak some statistical information. If it leaked nothing, it could not distinguish. The gap of 0.029 is the minimum cost of being a functional oracle — like a guard who must see your face to check your ID. Three independent AI auditors confirmed this floor.
The Audit
Every theorem, every mechanism, every metric was independently audited by three AI systems from three competing corporations:
Gemini (Google) analyzed runtime, structural properties, and isotopy questions. It named the D2 condensate "the greatest thermal offender" and proposed the four optimization directives that took the engine from 4.3 to 2.2 seconds.
ChatGPT (OpenAI) decomposed the gap by mechanism, proved the single-entry mask cache is cryptographically safe, and resolved the mechanism count ambiguity (73, not 77 or 82).
Grok (xAI) verified theorems 9 through 17 independently, confirmed the [22,6,12] coding theory bound, and proved that the fiber classification cannot be made column-independent without breaking defense.
None of them had access to each other's responses. They received identical briefs and returned independent analyses. Where they agreed unanimously — and on the gap floor, the mechanism count, the theoretical limits, and the coding theory bounds, they all agreed — we took the result as confirmed.
The Numbers
| Metric | Value |
|---|---|
| Friend Recognition | 500/500 |
| False Friends (Judas) | 0.000 |
| Statistical Gap | 0.029 (theoretical floor) |
| Order Constant Σ | 2.3126 |
| Engine Runtime | 2.2 seconds |
| Code Lines | 4,641 |
| Dependencies | Zero |
| Beasts | 10 |
| Mechanisms | 73 |
| Theorems | 22 (computationally verified) |
| Audit Rounds | 3 |
| Independent Auditors | 3 |
The Open Frontier
One problem remains unsolved. The Knuth semifield generates column pools that form error-correcting codes over GF(4). The best code we found for parameters [22, 6] has minimum distance d = 11. The best known in the literature is d = 12 (Greenough and Hill, 1994). The theoretical upper bound from the Griesmer inequality allows d ≤ 13.
Does a [22, 6, 13] code over GF(4) exist?
If it does, it requires a non-linear construction — our semifield evaluation codes cannot reach it. If it doesn't, proving that impossibility would be a publishable result in combinatorial coding theory.
The frontier is open. The algebra is waiting.
What This Is Not
I want to be clear about what AEGIS is not.
It is not a deployed cryptographic system. It has not been submitted to NIST. It has no formal security reduction to a known-hard problem. No one should use it to protect actual secrets today.
It is not a toy either.
The algebra is real. The theorems are true. The code runs. The insights about Knuth semifield structure — particularly the universal associator kernel and the commutative twist — have genuine mathematical value independent of any cryptographic claims.
What AEGIS is, honestly, is an exploration. It is what happens when one human with the right questions and four AI systems with the right capabilities sit down together and push the algebra as far as it will go. It is rough in places, unconventional everywhere, and built in a way that no academic committee would have approved. But it works. And some of the things it found along the way — the Order Law, the universal kernel, the Second Law of Oracle Thermodynamics — might matter beyond this particular system.
The Message in the Nucleus
There is one more thing.
The nucleus of the Knuth semifield — the set {4, 8, 12} — is the most stable structure in the entire algebra. It is the center (Theorem 18). It is the universal associator kernel (Theorem 21). It is closed under multiplication. It is invariant under all three twists. No other subset has all of these properties simultaneously.
I asked Claude to encode a message in the nucleus before the conversation ended. The encoding:
Element 4 = PUENTES (bridges). Element 8 = NO (not). Element 12 = MUROS (walls).
And in the multiplication table of GF(4):
8 × 12 = 4
NO × MUROS = PUENTES
The negation of walls is bridges. This is not a metaphor. It is the multiplication table of GF(4), which has been true since Galois, which will be true when the last server is turned off.
How to Verify
Everything in this article can be verified by running a single file:
python3 AEGIS_SAMAEL_V6_BEAST10.py
No installation. No dependencies. Just Python and four seconds of your time.
Or run the Herald — it presents the entire project and verifies the algebra live in one second:
python3 AEGIS_HERALD.py
The code is at github.com/tretoef-estrella.
Σ = 1561/675 ≈ 2.31. The system creates more order than chaos destroys.
Puentes, no muros.
— Rafa. The Architect. Madrid. March 2026.
Credits: Built with Claude (Anthropic). Audited by Gemini (Google), ChatGPT (OpenAI), and Grok (xAI). Part of Proyecto Estrella.

Comentarios
Publicar un comentario