Hidden Field Equations

From HandWiki
Revision as of 20:55, 6 February 2024 by Scavis2 (talk | contribs) (linkage)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Short description: Public key cryptosystem

Hidden Fields Equations (HFE), also known as HFE trapdoor function, is a public key cryptosystem which was introduced at Eurocrypt in 1996 and proposed by (in French) Jacques Patarin following the idea of the Matsumoto and Imai system. It is based on polynomials over finite fields [math]\displaystyle{ \mathbb{F}_q }[/math] of different size to disguise the relationship between the private key and public key. HFE is in fact a family which consists of basic HFE and combinatorial versions of HFE. The HFE family of cryptosystems is based on the hardness of the problem of finding solutions to a system of multivariate quadratic equations (the so-called MQ problem) since it uses private affine transformations to hide the extension field and the private polynomials. Hidden Field Equations also have been used to construct digital signature schemes, e.g. Quartz and Sflash.[1]

Mathematical background

One of the central notions to understand how Hidden Field Equations work is to see that for two extension fields [math]\displaystyle{ \mathbb{F}_{q^n} }[/math] [math]\displaystyle{ \mathbb{F}_{q^m} }[/math] over the same base field [math]\displaystyle{ \mathbb{F}_q }[/math] one can interpret a system of [math]\displaystyle{ m }[/math] multivariate polynomials in [math]\displaystyle{ n }[/math] variables over [math]\displaystyle{ \mathbb{F}_q }[/math] as a function [math]\displaystyle{ \mathbb{F}_{q^n} \to \mathbb{F}_{q^m} }[/math] by using a suitable basis of [math]\displaystyle{ \mathbb{F}_{q^n} }[/math] over [math]\displaystyle{ \mathbb{F}_q }[/math]. In almost all applications the polynomials are quadratic, i.e. they have degree 2.[2] We start with the simplest kind of polynomials, namely monomials, and show how they lead to quadratic systems of equations.

Consider a finite field [math]\displaystyle{ \mathbb{F}_q }[/math], where [math]\displaystyle{ q }[/math] is a power of 2, and an extension field [math]\displaystyle{ K }[/math]. Let [math]\displaystyle{ 0\lt h\lt q^n }[/math] such that [math]\displaystyle{ h=q^{\theta}+1 }[/math] for some [math]\displaystyle{ \theta }[/math] and gcd[math]\displaystyle{ (h,q^n-1)=1 }[/math]. The condition gcd[math]\displaystyle{ (h,q^n-1) =1 }[/math] is equivalent to requiring that the map [math]\displaystyle{ u \to u^h }[/math] on [math]\displaystyle{ K }[/math] is one to one and its inverse is the map [math]\displaystyle{ u \to u^{h'} }[/math] where [math]\displaystyle{ h' }[/math] is the multiplicative inverse of [math]\displaystyle{ h \ \bmod q^n-1 }[/math].

Take a random element [math]\displaystyle{ u\in \mathbb{F}_{q^n} }[/math]. Define [math]\displaystyle{ w\in \mathbb{F}_{q^n} }[/math] by

[math]\displaystyle{ w= u ^h = u^{q^\theta} u \ \ \ \ (1) }[/math]

Let [math]\displaystyle{ \beta_1,...,\beta_n }[/math] to be a basis of [math]\displaystyle{ K }[/math] as an [math]\displaystyle{ \mathbb{F}_q }[/math] vector space. We represent [math]\displaystyle{ u }[/math] with respect to the basis as [math]\displaystyle{ u=(u_1,...,u_n) }[/math] and [math]\displaystyle{ w=(w_1,...,w_n) }[/math]. Let [math]\displaystyle{ A^{(k)}={a_{ij}^{(k)}} }[/math] be the matrix of the linear transformation [math]\displaystyle{ u \to u^{q^k} }[/math] with respect to the basis [math]\displaystyle{ \beta_1,...,\beta_n }[/math], i.e. such that

[math]\displaystyle{ \beta_{i}^{q^k}=\sum_{j=1}^{n} a_{ij}^{k}\beta_{j},\ \ a_{ij}^{k}\in\mathbb{F}_q }[/math]

for [math]\displaystyle{ 1\le i,k\le n }[/math]. Additionally, write all products of basis elements in terms of the basis, i.e.:

[math]\displaystyle{ \beta_i\beta_j=\sum_{l=1}^{n}m_{ijl}\beta_{l},\ \ m_{ijl}\in\mathbb{F}_q }[/math]

for each [math]\displaystyle{ 1\le i,j\le n }[/math]. The system of [math]\displaystyle{ n }[/math] equations which is explicit in the [math]\displaystyle{ w_i }[/math] and quadratic in the [math]\displaystyle{ u_j }[/math] can be obtained by expanding (1) and equating to zero the coefficients of the [math]\displaystyle{ \beta_i }[/math].

Choose two secret affine transformations [math]\displaystyle{ S }[/math] and [math]\displaystyle{ T }[/math] , i.e. two invertible [math]\displaystyle{ n\times n }[/math] matrices [math]\displaystyle{ M_S=\{S_{ij}\} }[/math] and [math]\displaystyle{ M_T=\{T_{ij}\} }[/math] with entries in [math]\displaystyle{ \mathbb{F}_q }[/math] and two vectors [math]\displaystyle{ v_S }[/math] and [math]\displaystyle{ v_T }[/math] of length [math]\displaystyle{ n }[/math] over [math]\displaystyle{ \mathbb{F}_q }[/math] and define [math]\displaystyle{ x }[/math] and [math]\displaystyle{ y }[/math] via:

[math]\displaystyle{ u=Sx = M_Sx+v_S \ \ \ \ w= Ty = M_Ty+v_T \ \ \ \ (2) }[/math]

By using the affine relations in (2) to replace the [math]\displaystyle{ u_j, w_i }[/math] with [math]\displaystyle{ x_k,y_l }[/math], the system of [math]\displaystyle{ n }[/math] equations is linear in the [math]\displaystyle{ y_l }[/math] and of degree 2 in the [math]\displaystyle{ x_k }[/math]. Applying linear algebra it will give [math]\displaystyle{ n }[/math] explicit equations, one for each [math]\displaystyle{ y_l }[/math] as polynomials of degree 2 in the [math]\displaystyle{ x_k }[/math].[3]

Multivariate cryptosystem

The basic idea of the HFE family of using this as a multivariate cryptosystem is to build the secret key starting from a polynomial [math]\displaystyle{ P }[/math] in one unknown [math]\displaystyle{ x }[/math] over some finite field [math]\displaystyle{ \mathbb{F}_{q^n} }[/math] (normally value [math]\displaystyle{ q=2 }[/math] is used). This polynomial can be easily inverted over [math]\displaystyle{ \mathbb{F}_{q^n} }[/math], i.e. it is feasible to find any solutions to the equation [math]\displaystyle{ P(x)=y }[/math] when such solution exist. The secret transformation either decryption and/or signature is based on this inversion. As explained above [math]\displaystyle{ P }[/math] can be identified with a system of [math]\displaystyle{ n }[/math] equations [math]\displaystyle{ (p_1,...,p_n) }[/math] using a fixed basis. To build a cryptosystem the polynomial [math]\displaystyle{ (p_1,...,p_n) }[/math] must be transformed so that the public information hides the original structure and prevents inversion. This is done by viewing the finite fields [math]\displaystyle{ \mathbb{F}_{q^n} }[/math] as a vector space over [math]\displaystyle{ \mathbb{F}_q }[/math] and by choosing two linear affine transformations [math]\displaystyle{ S }[/math] and [math]\displaystyle{ T }[/math]. The triplet [math]\displaystyle{ (S,P,T) }[/math] constitute the private key. The private polynomial [math]\displaystyle{ P }[/math] is defined over [math]\displaystyle{ \mathbb{F}_{q^n} }[/math].[1][4] The public key is [math]\displaystyle{ (p_1,...,p_n) }[/math]. Below is the diagram for MQ-trapdoor [math]\displaystyle{ (S,P,T) }[/math] in HFE

[math]\displaystyle{ \text{input} x\to x=(x_1,...,x_n)\overset{\text{secret}: S}{\to}x'\overset{\text{secret}: P}{\to}y'\overset{\text{secret}: T}{\to}\text{output} y }[/math]

HFE polynomial

The private polynomial [math]\displaystyle{ P }[/math] with degree [math]\displaystyle{ d }[/math] over [math]\displaystyle{ \mathbb{F}_{q^n} }[/math] is an element of [math]\displaystyle{ \mathbb{F}_{q^n}[x] }[/math]. If the terms of polynomial [math]\displaystyle{ P }[/math] have at most quadratic terms over [math]\displaystyle{ \mathbb{F}_{q} }[/math] then it will keep the public polynomial small.[1] The case that [math]\displaystyle{ P }[/math] consists of monomials of the form [math]\displaystyle{ x^{q^{s_i}+q^{t_i}} }[/math], i.e. with 2 powers of [math]\displaystyle{ q }[/math] in the exponent is the basic version of HFE, i.e. [math]\displaystyle{ P }[/math] is chosen as

[math]\displaystyle{ P(x)=\sum c_i x^{q^{s_i}+q^{t_i}} }[/math]

The degree [math]\displaystyle{ d }[/math] of the polynomial is also known as security parameter and the bigger its value the better for security since the resulting set of quadratic equations resembles a randomly chosen set of quadratic equations. On the other side large [math]\displaystyle{ d }[/math] slows down the deciphering. Since [math]\displaystyle{ P }[/math] is a polynomial of degree at most [math]\displaystyle{ d }[/math] the inverse of [math]\displaystyle{ P }[/math], denoted by [math]\displaystyle{ P^{-1} }[/math] can be computed in [math]\displaystyle{ d^2(\ln d)^{O(1)} n^2 \mathbb{F}_q }[/math] operations.[5]

Encryption and decryption

The public key is given by the [math]\displaystyle{ n }[/math] multivariate polynomials [math]\displaystyle{ (p_1,...,p_n) }[/math] over [math]\displaystyle{ \mathbb{F}_q }[/math]. It is thus necessary to transfer the message [math]\displaystyle{ M }[/math] from [math]\displaystyle{ \mathbb{F}_{q^n} \to \mathbb{F}_q^n }[/math] in order to encrypt it, i.e. we assume that [math]\displaystyle{ M }[/math] is a vector [math]\displaystyle{ (x_1,...,x_n)\in \mathbb{F}_q^n }[/math]. To encrypt message [math]\displaystyle{ M }[/math] we evaluate each [math]\displaystyle{ p_i }[/math] at [math]\displaystyle{ (x_1,...,x_n) }[/math]. The ciphertext is [math]\displaystyle{ (p_1(x_1,...,x_n), p_2(x_1,...,x_n), ... ,p_n(x_1,...,x_n))\in \mathbb{F}_q^n }[/math].

To understand decryption let us express encryption in terms of [math]\displaystyle{ S, T, P }[/math]. Note that these are not available to the sender. By evaluating the [math]\displaystyle{ p_i }[/math] at the message we first apply [math]\displaystyle{ S }[/math], resulting in [math]\displaystyle{ x' }[/math]. At this point [math]\displaystyle{ x' }[/math] is transferred from [math]\displaystyle{ \mathbb{F}_{q^n} \to \mathbb{F}_{q^n} }[/math] so we can apply the private polynomial [math]\displaystyle{ P }[/math] which is over [math]\displaystyle{ \mathbb{F}_{q^n} }[/math] and this result is denoted by [math]\displaystyle{ y'\in \mathbb{F}_{q^n} }[/math]. Once again, [math]\displaystyle{ y' }[/math] is transferred to the vector [math]\displaystyle{ (y_1',...,y_n') }[/math] and the transformation [math]\displaystyle{ T }[/math] is applied and the final output [math]\displaystyle{ y\in \mathbb{F}_{q^n} }[/math] is produced from [math]\displaystyle{ (y_1,...,y_n)\in \mathbb{F}_q^n }[/math].

To decrypt [math]\displaystyle{ y }[/math], the above steps are done in reverse order. This is possible if the private key [math]\displaystyle{ (S,P,T) }[/math] is known. The crucial step in the deciphering is not the inversion of [math]\displaystyle{ S }[/math] and [math]\displaystyle{ T }[/math] but rather the computations of the solution of [math]\displaystyle{ P(x')=y' }[/math]. Since [math]\displaystyle{ P }[/math] is not necessary a bijection, one may find more than one solution to this inversion (there exist at most d different solutions [math]\displaystyle{ X'=(x_1',...,x_d')\in\mathbb{F}_{q^n} }[/math] since [math]\displaystyle{ P }[/math] is a polynomial of degree d). The redundancy denoted as [math]\displaystyle{ r }[/math] is added at the first step to the message [math]\displaystyle{ M }[/math] in order to select the right [math]\displaystyle{ M }[/math] from the set of solutions [math]\displaystyle{ X' }[/math].[1][3][6] The diagram below shows the basic HFE for encryption.

[math]\displaystyle{ M\overset{+r}{\to}x\overset{\text{secret}: S}{\to}x'\overset{\text{secret}: P}{\to}y'\overset{\text{secret}: T}{\to}y }[/math]

HFE variations

Hidden Field Equations has four basic variations namely +,-,v and f and it is possible to combine them in various way. The basic principle is the following:

01. The + sign consists of linearity mixing of the public equations with some random equations.
02. The - sign is due to Adi Shamir and intends to remove the redundancy 'r' of the public equations.
03. The f sign consists of fixing some [math]\displaystyle{ f }[/math] input variables of the public key.
04. The v sign is defined as a construction and sometimes quite complex such that the inverse of the function can be found only if some v of the variables called vinegar variables are fixed. This idea is due to Jacques Patarin.

The operations above preserve to some extent the trapdoor solvability of the function.

HFE- and HFEv are very useful in signature schemes as they prevent from slowing down the signature generation and also enhance the overall security of HFE whereas for encryption both HFE- and HFEv will lead to a rather slow decryption process so neither too many equations can be removed (HFE-) nor too many variables should be added (HFEv). Both HFE- and HFEv were used to obtain Quartz.

For encryption, the situation is better with HFE+ since the decryption process takes the same amount of time, however the public key has more equations than variables.[1][2]

HFE attacks

There are two famous attacks on HFE:

Recover the Private Key (Shamir-Kipnis): The key point of this attack is to recover the private key as sparse univariate polynomials over the extension field [math]\displaystyle{ \mathbb{F}_{q^n} }[/math]. The attack only works for basic HFE and fails for all its variations.

Fast Gröbner Bases (Faugère): The idea of Faugère's attacks is to use fast algorithm to compute a Gröbner basis of the system of polynomial equations. Faugère broke the HFE challenge 1 in 96 hours in 2002, and in 2003 Faugère and Joux worked together on the security of HFE.[1]

References