From Alaniz Cipher to Alaniz-AO
A post-quantum cipher whose 3 published versions were broken under attack, and the measured rule for designing hash functions that came out of those breaks.
In 2022 Rainbow fell, one of the ciphers put forward to resist quantum computers, and bringing it down took no quantum computer at all. A laptop and a weekend were enough. Rainbow belongs to multivariate cryptography, the kind that hides the secret in a system of equations, and most of its downfalls share a cause, which is that the system of equations is public and an attacker can study its shape at leisure. In March 2026 I published a cipher bearing my surname that proposed the opposite, keeping the system itself secret.
Told without a single formula, this experiment set out looking for a lock and ended with a kitchen rule. All 3 published versions of the cipher were broken, one after another, and each break taught something specific about the part that does the mixing. Following that clue led me to another kind of machine, hash functions, and in them I measured something anyone who has baked bread will grasp at once. Yeast makes the dough rise if it goes in before the oven, and the same spoonful sprinkled over a baked loaf does nothing at all. A small ingredient in these functions behaves the same way, because depending on where it goes it either adds security every round or adds none.
A cipher is a machine that mixes a message with a key so that undoing the mix without the key costs more than anyone can pay. The idea behind Alaniz Cipher was to couple the secret coefficients with a tool from topology, sheaf cohomology over graphs, which in practice is a way of gluing many small pieces so that they fit together in only one way, like those of a jigsaw. Holding up against a quantum computer as well was the design goal, never a fact, and in cryptography the serious way to get closer to it is to publish each version and let others attack it.
The 3 broken versions
How each version was broken takes a little algebra, and anyone who would rather skip it only needs to know that each attack wrote down the requirement the next version had to meet.
The part that makes the mix hard to undo is called σ (sigma), and it is the nonlinear part of the cipher, the one that stops it being solved with the arithmetic of an ordinary system of equations. In v1, σ cubed each component, which has a simple consequence, since multiplying the input by a number multiplies the output by its cube. Someone else built a scaling attack on that single identity that recovered the key, and v1 was broken.
v2 gave σ layers of substitution and permutation, which swap some values for others and shuffle them, to close that road, and while writing the paper for the next version I broke it myself with a more general attack. Any cipher of that shape, one that always encrypts the same message the same way and has a σ of bounded degree, lets you recover the key by interpolation, which means rebuilding a formula from a handful of its values. It took 20 queries and about 5.7 seconds of symbolic computation on all 10 test keys, and the result held for a whole family of designs.
v3, from 24 April 2026, changed the structure at the root. Encryption became probabilistic, with a single-use number in every message so that the same text never comes out encrypted the same way, and σ became a power over a larger field, which is the set of numbers in which all the arithmetic is done. An internal adversarial analysis found an attack that broke it, and the same review showed that its estimated security sat well below the 128 bits of the target.
v4, from 12 May, recalibrated the parameters and swapped the graph for a tetrahedron, with pieces that touch in threes. In July I put it through the toughest test, the public-key one. A public-key lock is one that anyone can close and only the owner of the key can open, and the analysis showed that this one needed the key to close it as well, so by its very structure it was an ordinary lock, what the trade calls a symmetric scheme, and the part meant to guard the secret trapdoor could be recovered with a single inversion. Trying a more expensive substitution box in its place turned up the clue that changed course. The degree of a cipher is the highest power in the equations an attacker would have to solve, a measure of how tangled they are, and a single expensive layer does not raise it enough, because the degree has to grow round by round. I followed that thread down a road that was not in the plan, using the sheaf coupling as the nonlinear part of the function.
Where the part goes
That road led to hash functions, the ones that boil any message down to a short fingerprint. Zero-knowledge proofs let you show that a computation was done correctly without revealing the data, and inside they run a hash function tens of thousands of times. The familiar ones, such as SHA-2, turn out very expensive in there, so another family is needed, the arithmetisation-oriented ones, designed to be written as simple equations. In them cost is counted in circuit constraints, which are those equations, and security in how hard they are to solve with algebra. Cheap ones tend to be weak, and strong ones tend to be costly.
What follows is the most technical part of the experiment, and the short version is the yeast, that the same ingredient adds security or adds none depending on where it goes.
I tested where to place a small quadratic term, a multiplication between 2 branches of the function that ties them together. Placed in the linear layer it adds nothing, and added after the power it adds nothing either, because the large term drowns it, whereas folded into the input of the substitution box, before raising to the seventh power, it adds 1 bit of degree per round, and degree is what governs the cost of algebraic attacks. I measured it with a Gröbner basis engine, the standard tool for solving systems of equations with powers, over small primes, with the law that the theory predicts and several points that fit it, among them a large one that rules out the 2 rival laws. The added degree is real, because the known shortcuts for removing variables do not undo it and a model written only in the inputs gives the same number.
There are 4 different ways of coupling the branches and all give the same result, so the mechanism does not depend on the sheaves, which remain the inspiration, and a single term per round is enough. The branch number of the linear layer, which measures how widely that layer spreads each change across its outputs and which classical theory puts at the centre, does not govern this algebraic security and only matters for the statistical kind. A partial round, one that applies the power to a single branch, makes the degree grow as much as a full one, at least in the case I could measure.
Put without algebra, the small part adds security only when it goes inside, before the power, and it does so however it is coupled.
With all that I built Alaniz-AO, a hash function shaped as a sponge, which soaks up the message in pieces and then squeezes out the fingerprint, over the Goldilocks field, the set of numbers several proof systems use, with 8 lanes, the seventh power and 8 rounds. According to an estimate, with a moderate share of partial rounds it would cost 74% of what Poseidon2, the reference design, costs. That estimate extrapolates from what was measured using an explicit cost model and depends on things that are still open, since the law is checked up to 3 rounds and beyond that the engines do not finish on an ordinary computer, the partial rounds are measured in the simplest case, and it remains to find the minimum number of full rounds and to check everything in Goldilocks itself, as the measurements were made over small primes. It also still needs what every new design needs, for someone from outside to attack it.
I published it on 8 July 2026 as “Placement is a Primitive”, and the paper thanks the internal adversarial analysis of v3, which played the demanding reviewer before the design went out into the world. The 3 broken versions were the road to that rule, which fits in a kitchen, because yeast only does its work inside the dough.
Log
The part in its place
I published “Placement is a Primitive”. A small coupling folded into the input of the substitution box adds 1 bit of degree per round, and anywhere else it adds nothing. I measured it over small primes and built it into Alaniz-AO, a hash function for zero-knowledge proofs, whose cost against Poseidon2 is an estimate that depends on 4 open questions.
Symmetric by structure
I moved it onto a tetrahedron and recalibrated the parameters of v3. In July the public-key test showed that encrypting required the secret, so the scheme was symmetric, and that the trapdoor came out with a single inversion. That test produced the clue of a degree that grows round by round, and with it the road to hash functions.
A change of structure
Attack by an internal adversarial analysis
Encryption became probabilistic, with a single-use number in every message, and σ became a power. An internal adversarial analysis broke it with an attack, and the same review put its estimated security well below the 128 bits of the target, which v4 recalibrated.
More layers for σ
My own attack, in the v3 paper
I gave σ layers of substitution and permutation against the scaling attack, and then broke it myself by interpolation, with an attack that holds for the whole family and recovered the key for all 10 test keys with 20 queries and about 5.7 seconds of computation.
The cube identity
Scaling attack by someone else
σ cubed each component, so multiplying the input by a number multiplied the output by its cube, and someone else broke it with a scaling attack built on that identity. From there came the first requirement of the design, that σ must not let itself be scaled.
Links
- “Placement is a Primitive” preprint (DOI 10.5281/zenodo.21254559)
- v3 preprint (DOI 10.5281/zenodo.19746033)
- v2 record (DOI 10.5281/zenodo.19020097)
- v1 preprint (DOI 10.5281/zenodo.18908260)
- Code of the early versions (GitHub)
- v4 repository (GitHub)
- Post on “Un informático en el lado del mal” (Spanish)