Has it been Pwned

How Rainbow works

Rainbow hid two layers of quadratic equations. Its signer solved them in order, turning each layer into a linear problem after it had chosen or solved the earlier variables.

Program status. Rainbow was a NIST third-round finalist. Structural cryptanalysis broke its security claims. The widely cited 53-hour laptop experiment used a second-round level-1 key. NIST program history

How a quadratic problem became two linear ones

A product of two unknowns makes an equation quadratic. Once either factor is known, that product is linear in the other. In Oil and Vinegar signatures, private coordinates arrange matters so that unknown oil variables are never multiplied by each other in the equations being solved. The signer first chooses vinegar values, leaving linear equations in the oil variables.

Rainbow repeated this idea with two successive groups of oil variables. First-layer equations use the initial vinegar variables and the first oil group. The signer solves for that group. Those newly determined values can now serve alongside the original vinegar values as known inputs to the second layer. The signer then solves a new linear system for the second group. In public coordinates, identifying those groups was supposed to be hard.

What a verifier sees

P = S ∘ F ∘ T; P(s) = d

F is the layered central quadratic map. T mixes the input coordinates, S mixes the outputs, and ∘ means function composition from right to left. The public vector of quadratic polynomials is P. The signature vector is s and the message-derived target is d.

Anyone can substitute proposed values into P and compare all output coordinates with d. The hidden layers help a signer work backward through the same map. The intended security required two things: difficulty obtaining a useful preimage directly and difficulty finding any equivalent set of private coordinates. An attacker would gain signing power from an equivalent trapdoor even if its stored bytes differed from the original secret key.

Worked example

In a miniature field modulo 7, use F₁(v,a) = va and F₂(v,a,b) = a² + vb. To hit (6,3), choose v = 2. The first equation gives a = 3. The second gives 9 + 2b = 3, so b = 4. Checking yields (6,17) ≡ (6,3). These equations expose all their layers to show the order of operations.

Signing and checking

  1. Generate

    Choose the central equations subject to their layer restrictions, along with their secret coordinate changes. Compose them and publish coefficients of the resulting quadratic equations, or their specified compressed representation.

  2. Sign

    Hash the message using the profile’s salt and encoding to obtain a target. Undo the output mixing, choose initial vinegar values, solve the two linear systems in order and undo the input mixing. Retry the required choices when a system cannot be solved.

  3. Verify

    Recover the target from the message and salt. Evaluate the public quadratic equations at the signature coordinates and compare their outputs with the target.

The cost of layering

The two layers gave public maps algebraic relationships beyond those of an arbitrary quadratic system. These relationships reduced the work needed for key recovery. The published laptop experiment averaged 53 hours on a second-round level-1 instance. Estimates for other parameters and revisions must be read separately. This was a structural result affecting correct implementations. Secure randomness or constant-time elimination cannot restore the missing security. The outcome motivates comparing specific hidden structures in UOV, MAYO and other designs individually.

Primary sources

Construction and program sources reviewed .