← Lab

Alaniz Cipher

In progress · Started , updated

I design my own cipher and publish every version so that others can try to break it. Two have fallen already, and the log tells how.

Fig. 1A letter through the machine

Pick a letter or type it and encrypt itThe machine at rest

The letter goes in through the wheel on the left as its ASCII code written in base 17, a pair of F₁₇. The four stations in a cycle are the C4 graph of the demo in the v3 code, with a pair of F₁₇ at each. The gear trains are the sheaf restrictions, linear and invertible, and carry the message from station to station so that, when the loop closes, the first one gets back the pair it already had. At each station the A shaft sets y = A·s, the cam is σ, the only nonlinear part, the B gears multiply it and the sum wheel gives c = y + B·σ(y), which the two output wheels show. This is the deterministic form of v1 and v2, here with the σ of v2. v1 cubed each component and A. Rodríguez Langa broke it with a scaling attack, because then σ(2y) = 8·σ(y) and subtracting eight times one ciphertext from the ciphertext of its double wipes out the cam. I broke v2 myself later, by interpolation and Gröbner bases, and v3 encrypts with a nonce and a vector σ that this machine does not draw. The matrices, the cam profile and the flywheel belong to this drawing, not to a key. Security is a design goal, not a fact.

In March 2026 I published a cipher with my surname on it and left it in plain view so that others could try to break it. A. Rodríguez Langa managed it by leaning on a single algebraic identity, and ever since, this experiment has mostly been a list of who broke what.

A cipher is a machine that mixes a message with a secret key so that undoing the mix without the key costs more than anyone can pay. The design goal of this one is for the price to stay high for a quantum computer too. Whether it gets there is not proven, and the only honest way to get closer is to publish every version and let people attack it.

Inside, it rests on the NL-SMIP problem, a polynomial system whose secret coefficients are coupled through sheaf cohomology on graphs. The part that does the nonlinear mixing is called σ, and almost all of this story is about it.

Two versions on the floor

v1 used a σ that cubed each component. That has a consequence that fits in one line, because if the input is multiplied by λ the output comes out multiplied by λ³, and on that identity, σ(λy) = λ³σ(y), A. Rodríguez Langa built a scaling attack that broke it. That cryptanalysis opened the path to v2 and, eventually, to v3.

v2 gave σ an SPN structure, layers of substitution and permutation, to withstand that attack. It fell somewhere else, and I broke it myself in the v3 paper. Any deterministic encryption of the form c = As + Bσ(As) with bounded-degree σ allows full key recovery through polynomial interpolation and Gröbner bases. For d = 2 and p = 17 it took 20 chosen-plaintext queries and about 5.7 s of symbolic computation, and the attack worked on all 10 randomly generated keys.

v3, from 24 April 2026, changed the structure. Encryption became probabilistic, with a nonce-derived stream (SHAKE-256), and σ began to act vectorially in Fpd through a monomial power permutation. The PQ-128 security estimate in that paper was later revisited in the v4 repository, and it does not hold.

The public key that was not

v4 started as a public-key proposal, and I dropped it on finding that the scheme was actually symmetric, because encrypting required the secret. A public-key padlock is one that anyone can close and only the keyholder can open. If closing it also takes the key, what is left is an ordinary lock, and the security figures I had given for that design lost their support.

The work carried on, outside the plan, as a primitive for hash functions, the ones that boil any message down to a short fingerprint, in their arithmetization-oriented variety. The central result is measured and told in the preprint “Placement is a Primitive”. Coupling the S-box inputs adds one bit of CICO ideal degree per round, putting the same coupling in the linear layer or after the S-box adds nothing, and the effect is generic rather than specific to sheaves. Where the part goes matters more than the part. Round counts and cost relative to Poseidon2 are extrapolations from that measured law, not measurements, and four or more rounds and the real 64-bit Goldilocks field are still open.

None of this is production-ready encryption, and it has had no external audit. Nor is there a formal worst-case to average-case reduction for NL-SMIP, a limitation shared by all multivariate cryptography. “Secure” and “quantum-resistant” are design goals, and the security figures for v3 and for the v4 public-key proposal do not hold. What does hold, for now, is the log.

Log

  1. From cipher to primitive

    v4 · In progress, · rethinks v3

    The v4 public-key proposal was dropped after finding that the scheme was actually symmetric, because encrypting required the secret. The security figures given for that design lost their support. The work carried on as an arithmetization-oriented primitive. The central result, which is measured, is that coupling the S-box inputs adds one bit of CICO ideal degree per round, and that the effect is generic rather than specific to sheaves. Round counts and cost relative to Poseidon2 are extrapolations from that measured law. Four or more rounds and the real 64-bit Goldilocks field are still open.

  2. Structural redesign

    v3 · Redesign, · fixes v1 and v2

    Encryption becomes probabilistic, with a nonce-derived stream (SHAKE-256), and σ is redesigned to act vectorially in F_{p^d} through a monomial power permutation. The PQ-128 security estimate in the paper was later revisited in the v4 repository and does not hold.

  3. SPN-structured σ

    v2 · Broken, · broken

    Broken by me, in the v3 paper

    It introduced an SPN-structured σ to withstand the scaling attack. In the v3 paper I showed that it falls too. Any deterministic encryption of the form c = As + Bσ(As) with bounded-degree σ admits full key recovery through polynomial interpolation and Gröbner bases. For d = 2 and p = 17 it took 20 CPA queries and about 5.7 s of symbolic computation, and the attack worked on all 10 randomly generated keys.

  4. Component-wise cubing σ

    v1 · Broken, · broken

    Broken by A. Rodríguez Langa

    It used a σ that cubed each component. A. Rodríguez Langa broke it with a scaling attack exploiting the identity σ(λy) = λ³σ(y). That cryptanalysis opened the path to v2 and, eventually, to v3.

Links