<<<

Intersection attack from the scratch

Introduction

In this post, we are going to illustrate how interesection attack on UOV works, from Kipnis-Shamir attack.

It involves some concepts from linear algebra:

  • quadratic forms,
  • characteristic polynomial,
  • Cayley-Hamilton theorem.

The goal is to explain why UOV-like trapdoors can be viewed as hidden linear subspaces with special bilinear-algebraic properties. This viewpoint is one of the basic insights behind several attacks on multivariate-quadratic cryptosystems.

Preliminaries

Quadratic form

Let VV be a finite-dimensional vector space over a field KK. A quadratic form is a map

Q:VKQ:V\rightarrow K

such that for all λK\lambda\in K,

Q(λx)=λ2Q(x).Q(\lambda x) = \lambda^2 Q(x).

A polar form associated to QQ is defined by

BQ(x,y)=Q(x+y)Q(x)Q(y)B_Q(x,y) = Q(x+y)-Q(x)-Q(y)

and it is bilinear. After choosing a basis of VKnV\simeq K^n, every quadratic polynomial can be represented as

QM(x)=xTMxQ_M(x)=x^T M x

for some matrix MKnimesnM\in K^{n imes n}. Expanding this expression gives

xTMx=imiixi2+i<j(mij+mji)xixj.x^T Mx = \sum_i m_{ii}x_i^2 + \sum_{i<j}(m_{ij}+m_{ji})x_ix_j.

Therefore, the individual entries mijm_{ij} and mjim_{ji} are not independently visible in the quadratic polynomial; only their sum mij+mjim_{ij}+m_{ji} appears.

Symmetric invariance

The polar form of QM(x)=xTMxQ_M(x)=x^T M x is

BM(x,y)=QM(x+y)QM(x)QM(y)=xT(M+MT)y.B_M(x,y) = Q_M(x+y) - Q_M(x) - Q_M(y) = x^T(M+M^T)y.

So the bilinear information attached to QMQ_M is represented by M+MTM+M^T.

When the field characteristic char(K)\operatorname{char}(K) is not 22, we may replace MM by the symmetric matrix M+MT2\frac{M+M^T}{2} without changing th equadratic form. Equivalently, the skew-symmetric party of MM does not contribute to xTMxx^TMx.

Since there’s a critical attack on UOV-like schemes over an even characteristic called wedge product attack, so we don’t consider the even characteristic one in this post.

UOV

UOV stands for Unbalanced Oil and Vinegar. In secret coordinates, the variables are split into vinegar variables and oil variables:

x=(xV,xO),xVKnm,xOKm.x=(x_V,x_O), \qquad x_V\in K^{n-m}, \qquad x_O\in K^m.

The central quadratic map is

F=(F1,,Fm):KnKm.F=(F_1,\ldots,F_m):K^n\to K^m.

The defining UOV property is that the central polynomials contain no oil-oil quadratic terms. A typical component has the form

F(xV,xO)=a,bαab()xV,axV,bvinegar-vinegar terms+a,bβab()xV,axO,bvinegar-oil terms.F_\ell(x_V,x_O) = \underbrace{\sum_{a,b}\alpha^{(\ell)}_{ab}x_{V,a}x_{V,b}}_{\text{vinegar-vinegar terms}} + \underbrace{\sum_{a,b}\beta^{(\ell)}_{ab}x_{V,a}x_{O,b}}_{\text{vinegar-oil terms}}.

There are vinegar-vinegar terms and vinegar-oil terms, but no terms of the form

xO,axO,b.x_{O,a}x_{O,b}.

Equivalently, the matrix of the quadratic part of FF_\ell has block shape

F=(ABC0),F_\ell = \begin{pmatrix} A_\ell & B_\ell\\ C_\ell & 0 \end{pmatrix},

where the lower-right block corresponds to oil-oil products.

The oil subspace in secret coordinates is

O0={(0,xO):xOKm}.O_0=\{(0,x_O):x_O\in K^m\}.

Since there are no oil-oil terms, every central component vanishes on this subspace:

F(o)=0for all oO0.F_\ell(o)=0 \qquad \text{for all }o\in O_0.

More importantly for the attacks, the polar form also vanishes on pairs of oil vectors:

F(o1,o2)=0for all o1,o2O0.F_\ell'(o_1,o_2)=0 \qquad \text{for all }o_1,o_2\in O_0.

The public key hides this structure by composing the central map with invertible linear or affine maps. In the homogeneous linearized notation, one may write

P=SFT,P=S\circ F\circ T,

where TT hides the variables and SS mixes the output equations. The hidden public oil subspace is then

O=T1(O0).O=T^{-1}(O_0).

Recovering OO is essentially a key-recovery attack: once the attacker knows the oil subspace, the signing trapdoor can be reconstructed or simulated.

The standard UOV trapdoor view is precisely that the public quadratic map vanishes on a secret mm-dimensional oil subspace, and after fixing a vinegar component, signing reduces to solving a linear system in the oil variables.

Characteristic polynomial

For a square matrix AKn×nA\in K^{n \times n}, its characteristic polynomial is

χA(t)=det(tInA).\chi_A(t)=\det(tI_n-A).

The Cayley-Hamilton theorem says that every square matrix satisfies its own characteristic polynomial:

χA(A)=0.\chi_A(A)=0.

If

χA(t)=rfr(t)er\chi_A(t)=\prod_r f_r(t)^{e_r}

is the factorization into irreducible factors over KK, then the kernels

kerfr(A)er\ker f_r(A)^{e_r}

give AA-invariant subspaces. In particular, if fr(t)=tλf_r(t)=t-\lambda, then

ker(AλI)\ker(A-\lambda I)

is the eigenspace of AA for the eigenvalue λ\lambda.

This is useful because the Kipnis-Shamir attack constructs matrices for which the hidden oil subspace is invariant. Factoring characteristic polynomials then gives candidate invariant subspaces, which can be tested against the oil-space condition P(O,O)=0P'(O,O)=0.

Kipnis-Shamir attack

Let P=(p1,,pm)P=(p_1,\ldots,p_m) be the public homogeneous quadratic map, and let MiM_i be the matrix of the polar form of the ii-th public component:

pi(x,y)=xTMiy.p_i'(x,y)=x^TM_i y.

The oil-space property gives

MiOOM_iO\subseteq O^\perp

for every ii.

Now consider the balanced Oil and Vinegar case, where n=2mn=2m.

Then

dimO=m,dimO=nm=m.\dim O=m, \qquad \dim O^\perp=n-m=m.

If MiM_i is invertible, then

dimMiO=m.\dim M_iO=m.

Since MiOOM_iO\subseteq O^\perp and both spaces have dimension mm, we obtain

MiO=O.M_iO=O^\perp.

Therefore, for two invertible matrices MiM_i and MjM_j,

Mj1MiO=Mj1O=O.M_j^{-1}M_iO = M_j^{-1}O^\perp = O.

So the hidden oil space OO is an invariant subspace of

Wij=Mj1Mi.W_{ij}=M_j^{-1}M_i.

This is the key observation of the Kipnis-Shamir attack: recover OO by finding a common invariant mm-dimensional subspace of several matrices WijW_{ij}.

In practice, one factors the characteristic polynomial of WijW_{ij}, obtains candidate invariant subspaces from the factors using Cayley-Hamilton, combines them when necessary, and tests whether the resulting subspace satisfies

P(o1,o2)=0for all o1,o2O.P'(o_1,o_2)=0 \qquad \text{for all }o_1,o_2\in O.

The balanced case n=2mn=2m is weak because MiO=OM_iO=O^\perp becomes an equality. For unbalanced UOV, where n>2mn>2m, we still have

MiOO,M_iO\subseteq O^\perp,

but now

dimO=nm>m.\dim O^\perp=n-m>m.

Thus MiOM_iO is usually only a proper subspace of OO^\perp, and different images MiOM_iO and MjOM_jO no longer have to be equal. This is why the direct Kipnis-Shamir invariant-subspace argument stops working cleanly in the unbalanced case.

In the balanced case MiO=OM_iO=O^\perp, while for n>2mn>2m the equality need not hold, so Mj1MiM_j^{-1}M_i no longer necessarily preserves OO.

Caveat: This doesn’t mean Kipnis-Shamir cannot applied on the unbalanced case. One may consider some probabilistic relation and seek for the instance where his assumption holds. However, since the success rate exponentially decreases as the imbalance n2mn-2m grows.

Intersection attack

The intersection attack generalizes the Kipnis-Shamir idea to the unbalanced case.

Even when

MiOMjO,M_iO\neq M_jO,

both spaces still lie inside OO^\perp:

MiOO,MjOO.M_iO\subseteq O^\perp, \qquad M_jO\subseteq O^\perp.

Each of MiOM_iO and MjOM_jO has dimension mm, while OO^\perp has dimension nmn-m. Therefore, by a dimension count,

dim(MiOMjO)dim(MiO)+dim(MjO)dim(O).\dim(M_iO\cap M_jO) \ge \dim(M_iO)+\dim(M_jO)-\dim(O^\perp).

Hence

dim(MiOMjO)m+m(nm)=3mn.\dim(M_iO\cap M_jO) \ge m+m-(n-m)=3m-n.

So if n<3mn<3m, then the intersection

MiOMjOM_iO\cap M_jO

is expected to contain nonzero vectors. The attack searches for a vector

xMiOMjO.x\in M_iO\cap M_jO.

If such an xx is found, then

Mi1xO,Mj1xO.M_i^{-1}x\in O, \qquad M_j^{-1}x\in O.

Because elements of OO vanish under PP, and pairs of elements of OO vanish under the polar form, xx must satisfy

P(Mi1x)=0,P(Mj1x)=0,P(Mi1x,Mj1x)=0.P(M_i^{-1}x)=0, \qquad P(M_j^{-1}x)=0, \qquad P'(M_i^{-1}x,M_j^{-1}x)=0.

This gives a system of quadratic equations in the coordinates of xx. Once a nonzero oil vector is recovered, additional oil vectors can be found more easily by imposing the linear conditions

P(o,z)=0P'(o,z)=0

for already-known oil vectors oo. Repeating this process allows the attacker to reconstruct the whole oil subspace.

The same idea can be extended from two matrices to kk matrices. Let L1,,LkL_1,\ldots,L_k be invertible matrices obtained from public components or invertible linear combinations of them. The attack looks for

xr=1kLrO.x\in \bigcap_{r=1}^k L_rO.

A dimension count gives

dim(r=1kLrO)km(k1)(nm)=(2k1)m(k1)n.\dim\left(\bigcap_{r=1}^k L_rO\right)\ge km-(k-1)(n-m) = (2k-1)m-(k-1)n.

Thus the intersection is expected to be nontrivial when

(2k1)m(k1)n>0,orn<2k1k1m.(2k-1)m-(k-1)n>0, \qquad \text{or} \qquad n<\frac{2k-1}{k-1}m.

For example:

k=2n<3m,k=2 \quad\Rightarrow\quad n<3m,

and

k=3n<52m.k=3 \quad\Rightarrow\quad n<\frac{5}{2}m.

Here is a table for a few of the first ratio values.

k r
2 3
3 5/2
4 7/3
5 9/4

Note that the ratio approaches to 22. So we cannot increase the value of kk infinitely, as it fallbacks to the balanced case.

Summary

Intersection attack is a kind of generalization of Kipnis-Shamir attack, as they use the same idea of the image of MiM_i’s. The core difference comes from lower-bound observation on the image intersection, and it allows the attacker reduces the difficulty of direct MQ solve.

However, this statement on the dimension lower-bound makes sense on a tight upperbound on imbalance. So the intersection attack is not a general breakdown on UOV.