This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

A Complete algorithm for local inversion of maps: Application to Cryptanalysis

Virendra Sule
Dept. of Electrical Engineering
Indian Institute of Technology Bombay, India
(vrs@ee.iitb.ac.in)
Abstract

For a map (function) F(x):𝔽2n𝔽2nF(x):\mathbb{F}_{2}^{n}\rightarrow\mathbb{F}_{2}^{n} and a given yy in the image of FF the problem of local inversion of FF is to find all inverse images xx in 𝔽2n\mathbb{F}_{2}^{n} such that y=F(x)y=F(x). In Cryptology, such a problem arises in Cryptanalysis of One way Functions (OWFs). The well known TMTO attack in Cryptanalysis is a probabilistic algorithm for computing one solution of local inversion using O(N)O(\sqrt{N}) order computation in offline as well as online for N=2nN=2^{n}. This paper proposes a complete algorithm for solving the local inversion problem which uses linear complexity for a unique solution in a periodic orbit. The algorithm is shown to require an offline computation to solve a hard problem (possibly requiring exponential computation) and an online computation dependent on yy that of repeated forward evaluation F(x)F(x) on points xx in 𝔽2n\mathbb{F}_{2^{n}} which is polynomial time at each evaluation. However the forward evaluation is repeated at most as many number of times as the Linear Complexity of the sequence {y,F(y),}\{y,F(y),\ldots\} to get one possible solution when this sequence is periodic. All other solutions are obtained in chains {e,F(e),}\{e,F(e),\ldots\} for all points ee in the Garden of Eden (GOE) of the map FF. Hence a solution xx exists iff either the former sequence is periodic or a solution occurs in a chain starting from a point in GOE. The online computation then turns out to be polynomial time O(Lk)O(L^{k}) in the linear complexity LL of the sequence to compute one possible solution in a periodic orbit or O(l)O(l) the chain length for a fixed nn. Hence this is a complete algorithm for solving the problem of finding all rational solutions xx of the equation F(x)=yF(x)=y for a given yy and a map FF in 𝔽2n\mathbb{F}_{2^{n}}. Due to the dependence on forward evaluation by FF only, in the online computation this algorithm is expected to be scalable for inversion in realistic cases of maps when the linear complexity LL of the sequence above or lengths of chains are not exponential in nn. The chains emerging from the GOE are independent and can be computed in parallel. The hard (NP) offline computation consists of computing all points in the GOE and the set of all orbit lengths of closed orbits of the iterative action of FF.

Subject Classification: cs.CC, cs.CR, cs.SC, cs.LO

1 Introduction

Inversion of a function is a fundamental problem of both pure and applied mathematics and has enormously wide implications and important applications. In this paper we consider the problem local inversion of a function F:𝔽2n𝔽2nF:\mathbb{F}_{2^{n}}\mapsto\mathbb{F}_{2^{n}} which is to find all rational (in 𝔽2n\mathbb{F}_{2^{n}}) solutions xx to the equation F(x)=yF(x)=y for given yy in 𝔽2n\mathbb{F}_{2^{n}}. For instance, inversion of One Way Functions (OWFs) is a central problem of Cryptanalysis. Although such a problem can obviously be solved by an exponential time brute force search algorithm, the challenge is to develop algorithms which will be practically feasible for solving realistic cases of inversion arising in applications where brute force is infeasible. Another methodology to solve such a problem better than brute force approach is by means of a solver for Boolean equations which should return all solutions xx. Such a solver in which all solutions are represented by a complete set of implicants of the system of equations is announced in [9]. In this paper we propose an algorithm which utilizes an offline computation on F(x)F(x) while the online computation utilizes only the forward computation of the map F(z)F(z) on points zz and finds all solutions using the sequence S(F,z)={z,F(z),}S(F,z)=\{z,F(z),\ldots\}. Since the forward computation F(z)F(z) is assumed to be efficiently feasible, the estimates of online computation required are expected to be better than solving the Boolean system F(x)=yF(x)=y directly. The offline computation however involves hard computation and is assumed to be feasible with sufficient time and memory space for some of the realistic cases of FF. For such cases local inversion can be practically feasible if the online computation is feasible.

An important application of local inversion arises in Cryptanalysis of cipher algorithms where it is necessary to find all inputs (arguments) to a known map FF for a given output (map value). For instance, the output is associated with a known ciphertext of a known or chosen plaintext while the unknown input is the secret key. The cipher algorithm is designed in such a way that the map FF is a OWF which is efficient for forward operation on its argument but hard to invert given an output. The well known probabilistic algorithm, Time Memory Tradeoff (TMTO) attack is often used to solve such an inversion problem. TMTO attack finds one inverse of a map F:XXF:X\rightarrow X in the set XX of nn-bit strings given an ouput y=F(x)y=F(x) probabilistically. TMTO attack has exponential complexity (in nn) and is equivalent to O(N)O(\sqrt{N}) order Birthday attack where N=|X|=2nN=|X|=2^{n}. Hence TMTO has a success probability of 63%63\% once an offline data is gathered which is also a problem of O(N)O(\sqrt{N}) order of computation. Apart from being probabilistic TMTO is not meant for computing all solutions of F(x)=yF(x)=y nor does the method utilize the structure of the finite field possible for strings of nn-bits. A complete algorithm on the other hand by definition succeeds with certainty in computing the solutions. Purpose of this paper is to propose a complete algorithm for the local inversion problem by utilizing the structure of the map FF as an nn-tuple polynomial function of nn variables over 𝔽2\mathbb{F}_{2}. An important outcome of the result of this paper is that when the local inverse for a given yy is unique (which is most likely in a practical situation) and the linear complexity of the sequence S(F,y)S(F,y) is not too large, then a key recovery attack on the cipher algorithm is practically feasible.

1.1 Offline and online computations for local inversion

We show in this paper that the computation of local inversion can be divided into offline and online phases.

  1. 1.

    The offline phase is used for computing the set of all possible periods of closed orbits of iterations of FF which may require an exponential order of computation in general.

  2. 2.

    Offline computation is also required for computing the Garden of Eden of the map FF which is the set of all yy which are outside the range of FF (or those yy for which there is no rational solution to the equation F(x)=yF(x)=y). This computation is equivalent to computing all satisfying assignments of a Boolean system of equations.

  3. 3.

    Then in online computation, one local inverse xx when it lies in a periodic orbit containing yy can be computed in polynomial order of complexity O(Lk)O(L^{k}) where LL is the linear complexity of the sequence S(F,y)={y,F(y),F(2)(y),}S(F,y)=\{y,F(y),F^{(2)}(y),\ldots\} under iterations of FF. An upper bound on LL is the maximum period of possible orbits of FF.

  4. 4.

    With the knowledge of GOEs of FF, other inverses of y=F(x)y=F(x) belong to the sequences under iterations Fk(z)F^{k}(z) on points zz in the GOE, known as chains of FF which is a polynomial time online parallel computation independent for each point zz in GOE.

The most important advantage of this splitting of computation is that, since the period of the sequence S(F,y)S(F,y) is the order of the minimal polynomial in 𝔽2[X]\mathbb{F}_{2}[X] the polynomial ring over 𝔽2\mathbb{F}_{2}, the unique solution of the local inverse in the periodic orbit of yy in the above sequence has a polynomial time solution in the degree of the minimal polynomial of the sequence (or its linear complexity LL). All other solutions too are computed by the forward application of FF. Hence we show that by taking into account the structure of the finite field and the function FF, one possible solution of the local inversion can be computed in O(Lk)O(L^{k}) once the offline computation is completed.

1.2 Relations with previous literature

Linear complexity and the minimal polynomial of sequences have been well studied in the Cryptology literature since long [15, 16]. The Berlekamp Massey algorithm [17] computes the minimal polynomial efficiently. However linear complexity was discovered for modeling and predicting the sequence as generated by the output of a LFSR and hence predicting an exponentially long sequence from just 2L2L samples by a linear recurrence of a polynomial size subsequence. The computation of linear complexity LL of a sequence is also not feasible if LL is exponential comparable to the period. This paper shows another application of linear complexity and the minimal polynomial of the sequence S(F,y)S(F,y), that of inverting the function F(x)F(x) at its value yy

Our results are further development of ideas on linear representation of maps FF using the Koopman operator and its applications recently announced in [6]. It is shown that one solution of the inverse is obtained in polynomial time in O(Lk)O(L^{k}) where LL is the linear complexity of the sequence S(F,y)S(F,y). Use of linear complexity of such sequences for inversion of FF is believed to be a new proposition of this paper and follows from the ideas of [7]. Other known literature relates to this problem as follows.

1.2.1 Inversion of permutation polynomials

The problem of inversion of permutation polynomials in finite fields has a vast literature. References [14, 13, 12] are good representatives. However inversion of permutation polynomials does not result in a method for local inversion. Recently in [7] a linear representation of functions in finite fields is proposed and it is shown that when FF (is a permutation function) with the global inverse GG then the inverse GG as well as its linear representation also follows from that of FF. The linear representations of inverses are inverses of linear representations. However linear representation of FF does not solve the problem of local inversion when FF is not globally invertible (since GG does not exist). Hence local inversion problem needs to be solved afresh.

1.2.2 Relation with TMTO

As discussed above, the Time Memory Tradeoff (TMTO) attack on OWFs is a well known algorithm for solving the local inversion of a map F:XXF:X\mapsto X in X={0,1}nX=\{0,1\}^{n} given y=F(x)y=F(x) in XX. TMTO algorithm was proposed by Hellman in [2] and has been well researched over last several years as shown in [3, 4, 5]. TMTO algorithm is however probabilistic and does not utilize structure of the set XX as a vector space over a finite field and its success probability is based on the Birthday attack which has complexity of order O(2n/2)O(2^{n/2}). In practice TMTO attack requires gathering of multiple large sized tables offline not just one to overcome merging of chains, false positive solutions and even failure to capture a solution. However the online search can be carried out in parallel which is advantageous.

1.2.3 Relation with Boolean equation solving

An algorithm for representing all solutions (satisfying assignments) of a Boolean systems of equations is proposed in [9]. This algorithm is completely thread parallel hence the time performance improves with increase in memory space. The problem of representing all solutions of Boolean equations is however of \sharp-P class whose special case, that of deciding solvability of 33-CNF system is an NP complete problem. If the Boolean equations are represented in the form y=F(x)y=F(x) for a known yy in 𝔽2n\mathbb{F}_{2}^{n} with nn-unknowns taking values in 𝔽2\mathbb{F}_{2}, this method can be used for local inversion. Hence al solutions of inverses can be solved using the algorithm proposed in [9] better than brute force search. However if the offline computation on FF of the method proposed in this paper is feasible, the local inversion does not require solution of non-linear Boolean equations but only depends on forward computations of the function. Hence the algorithm proposed in this paper is a definite way to solve these hard problems even without solving the system of Boolean equations and only resorting to forward computation of the map FF if the offline computation is feasible.

1.2.4 Related work on local inversion

Problem of solving rational roots of polynomial of systems of equations over finite fields is one of the well known hard problems of computation. This problem has been addressed in past by algebraic geometric and probabilistic algorithmic methods [10, 11]. The case of deciding the solvability of a multivariate quadratic system is an NP complete problem. Hence in general the local inversion problem is computationally hard. More specifically the problem of inversion of permutation polynomials requires symbolic arithmetic and results in an inverse function [12]. The problem of local inversion of a function F(x)F(x) at a point y=F(x)y=F(x) is thus a special counterpart of both of these problems. Any algorithm for finding roots of polynomial systems can solve all rational roots in 𝔽q\mathbb{F}_{q} of the equation y=F(x)y=F(x) given yy. Similarly if FF is a permutation of 𝔽q\mathbb{F}_{q} and GG is the global inverse permutation then x=G(y)x=G(y) is the unique inverse image of yy. However when FF is not a permutation these methods cannot solve the local inversion problem. For 𝔽2n\mathbb{F}_{2^{n}} existence and computation of all rational roots of y=F(x)y=F(x) can be accomplished by the Boolean system solver [9]. However no such algorithm is known for fields in other characteristics.

2 Structure of trajectories and solutions

Solutions to the equation F(x)=yF(x)=y are governed by the structure of trajectories of the iterations of the map F:𝔽2n𝔽2nF:\mathbb{F}_{2}^{n}\mapsto\mathbb{F}_{2}^{n} and on what part of a trajectory yy belongs. A trajectory of the map FF through a point zz in 𝔽2n\mathbb{F}_{2}^{n} is the sequence of iterations {z,F(z),F(2)(z),F(k)(z),}\{z,F(z),F^{(2)}(z)\ldots,F^{(k)}(z),\ldots\}. Due to finiteness of 𝔽2n\mathbb{F}_{2^{n}} and invariance of FF with respect to kk, it follows that there exist 0lk0\leq l\leq k such that F(k)(z)=F(l)(z)F^{(k)}(z)=F^{(l)}(z) for any zz. Hence every trajectory can be uniquely split into a periodic part

P(z)={F(k)(z),F(k+1)(z),,F(k+m1)(z)}P(z)=\{F^{(k)}(z),F^{(k+1)}(z),\ldots,F^{(k+m-1)}(z)\} (1)

such that

F(k)(z)=F(k+m)(z)F^{(k)}(z)=F^{(k+m)}(z)

where mm depends on zz, called a periodic orbit of period mm and a unique segment of a chain

C(z)={z,F(z),,F(k1)(z)}C(z)=\{z,F(z),\ldots,F^{(k-1)}(z)\} (2)

which merges with a periodic orbit or another chain. Points of a periodic orbit of length mm are called mm-periodic points. The fixed points of FF which are points zz such that F(z)=zF(z)=z are 11-periodic points. The set of all points zz which are not in the range of FF is called the Garden of Eden of FF. Following lemma follows from this structure of trajectories.

Lemma 1.

Given an arbitrary point yy in 𝔽2n\mathbb{F}_{2}^{n} solutions of F(x)=yF(x)=y are described by following possibilities

  1. 1.

    F(x)=yF(x)=y has no solution iff yy belongs to the GOE of FF.

  2. 2.

    F(x)=yF(x)=y has solution in a periodic orbit PP iff yy belongs to PP. Such a periodic orbit is unique. Given yy in a periodic orbit PP and the unique solution to F(x)=yF(x)=y in PP, all other possible solutions belong to the chains fk(z),k1f^{k}(z),k\geq 1 for zz in the GOE of FF.

  3. 3.

    If yy is neither in a periodic orbit nor in the GOE, then all solutions to F(x)=yF(x)=y arise in some of the chains F(k)(z),k1F^{(k)}(z),k\geq 1 for zz in the GOE.

Proof.

From the definition of the periodic orbits (1) and chains (2) it follows that the space 𝔽2n\mathbb{F}_{2}^{n} is partitioned by the action of FF in periodic orbits and segments of chains from points in GOE to a point which is mapped by FF to a periodic orbit. Hence given any point yy it is either on a unique chain segment or on a periodic orbit. If there is no solution to F(x)=yF(x)=y then yy belongs to GOE conversely if yy is in GOE then there is no xx such that F(x)=yF(x)=y. If yy is in a periodic orbit PP, there is unique predecessor xx in PP such that F(x)=yF(x)=y. Any other solution xx which is outside PP cannot be in any other periodic orbit since the two orbits cannot intersect at yy. Hence all other solutions xx are on chains merging with PP at yy under iterations of FF. Hence every solution outside PP is on one of the chains F(k)(z)F^{(k)}(z) for zz in GOE and k1k\geq 1. ∎

2.1 Solution in a periodic orbit

We need to revisit some of the well known background on the theory of recurrent sequences over finite fields [14, 13] for the special iterative sequences we encounter in this problem of local inversion of maps. The theory of linear recurring sequences over finite fields in [14, 13] considers recurrence relations with for sequences and their co-efficients in the same field. On the other hand the sequences encountered in the problem of local inversion are in 𝔽2n\mathbb{F}_{2}^{n} and generated iteratively by the map FF while the co-efficients are over 𝔽2\mathbb{F}_{2}. Because of this minor difference we choose to revisit proofs of fundamental results for the special sequences and show that the well known results go though without change. Consider a periodic orbit of iterations of FF which contains yy, denoted as

S(F,y)={y,F(y),F(2)(y),,F(N1)(y)}S(F,y)=\{y,F(y),F^{(2)}(y),\ldots,F^{(N-1)}(y)\}

which has period NN which is the smallest number such that Fk(y)=F(k+N(y)F^{k}(y)=F^{(k+N}(y) for k=0,1,2,k=0,1,2,\ldots. We say that the sequence S(F,y)S(F,y) has a linear recurrence relation over 𝔽2\mathbb{F}_{2} of degree mm if there exist constants {a0,a1,,a(m1),am}\{a_{0},a_{1},\ldots,a_{(m-1)},a_{m}\} in 𝔽2\mathbb{F}_{2} such that

amF(k+m)(y)+i=0(m1)aiF(k+i)(y)=0a_{m}F^{(k+m)}(y)+\sum_{i=0}^{(m-1)}a_{i}F^{(k+i)}(y)=0 (3)

The periodicity condition on a sequence S(F,y)S(F,y) of period NN,

F(k+N)(y)=F(k)(y)F^{(k+N)}(y)=F^{(k)}(y)

gives existence of one such linear recurrence relation with m=Nm=N. The polynomial

ϕ(X)=amXm+i=0(m1)aiXi\phi(X)=a_{m}X^{m}+\sum_{i=0}^{(m-1)}a_{i}X^{i} (4)

associated with a linear recurrence relation is called a characteristic polynomial of S(F,y)S(F,y). The indeterminate XX of a characteristic polynomial represents the operation

Xk(y)=F(k)(y)X^{k}(y)=F^{(k)}(y) (5)

(X0(y)X^{0}(y) is the identity map), which is also compatible with the compositional operation by FF as seen by

X(k+l)(y)=F(k+l)(y)=F(k)(F(l)(y))X^{(k+l)}(y)=F^{(k+l)}(y)=F^{(k)}(F^{(l)}(y))

The linear operation of terms in powers of XX is by definition

(Xk+Xl)(y)=Xk(y)+xl(y)(X^{k}+X^{l})(y)=X^{k}(y)+x^{l}(y)

A monic linear recurrence relation i.e. with am=1a_{m}=1 and of least degree is unique and the monic polynomial ϕ(X)\phi(X) associated with it is called the minimal polynomial. In a finite field 𝔽q\mathbb{F}_{q} a polynomial ϕ(X)\phi(X) in the polynomial ring 𝔽q[X]\mathbb{F}_{q}[X] satisfying ϕ(0)0\phi(0)\neq 0 has an order, which is the minimum number NN such that ϕ(X)\phi(X) is a divisor of XN1X^{N}-1.

Following result follows from this background.

Proposition 1.

The sequence S(F,y)S(F,y) is periodic iff it has a minimal polynomial which divides any of its characteristic polynomials. The minimal polynomial satisfies α00\alpha_{0}\neq 0 and the period NN of S(F,y)S(F,y) is the order of the minimal polynomial.

Proof.

Let S(F,y)S(F,y) be periodic of period NN, then it has the characteristic polynomial ϕ(X)=XN1\phi(X)=X^{N}-1. Hence it has a minimal polynomial. Let the minimal polynomial of S(F,y)S(F,y) be,

m(X)=Xm+i=0(m1)αiXim(X)=X^{m}+\sum_{i=0}^{(m-1)}\alpha_{i}X^{i} (6)

Then from the definition of the operation XX in (5) and interpretation of XkX^{k} as compositional operation F(k)(.)F^{(k)}(.), m(X)m(X) is the smallest degree polynomial such that

m(X)(y)Fk+m(y)+i=0(m1)αiF(k+i)(y)=0m(X)(y)\triangleq F^{k+m}(y)+\sum_{i=0}^{(m-1)}\alpha_{i}F^{(k+i)}(y)=0

If ϕ(X)\phi(X) is any characteristic polynomial and R(X)R(X) the residue ϕ(X)modm(X)\phi(X)\mod m(X) then there exists a polynomial Q(X)Q(X) such that ϕ(X)=Q(X)m(X)+R(X)\phi(X)=Q(X)m(X)+R(X). Hence using the above algebraic rules of operation of XX on yy through the action of FF it follows that

ϕ(X)y=R(X)y=0\phi(X)y=R(X)y=0

hence due to minimality of degree of m(X)m(X) and noting that degR(X)<degm(X)\deg R(X)<\deg m(X) it follows that R(X)R(X) must be a zero polynomial. Hence in particular if S(F,y)S(F,y) is periodic of period NN then m(X)|(XN1)m(X)|(X^{N}-1). It also follows from this divisibility by m(X)m(X) that m(0)=α00m(0)=\alpha_{0}\neq 0. Moreover since NN is the smallest, NN must be the order of m(X)m(X) as an element of 𝔽2[X]\mathbb{F}_{2}[X]. Conversely if S(F,y)S(F,y) has minimal recurrence relation and the minimal polynomial satisfies m(0)0m(0)\neq 0 then for NN the order of m(X)m(X) it is a divisor of XN1X^{N}-1. Hence (XN1)(y)=0(X^{N}-1)(y)=0 which proves that S(F,y)S(F,y) is periodic of period NN. ∎

2.1.1 Rank criterion and computation of minimal polynomial

Consider the sequence S(F,y)S(F,y). It is a-priori not possible to know whether the sequence is periodic from a short length samples F(k)(y)F^{(k)}(y) (for small kk) since the period can be exponentially large. The issue here is that while the sequence S(F,y)S(F,y) is not fully available for computation, to compute a linear recurrence relation (3) of shortest degree. In fact this is what is the well known computation of linear complexity of a sequence by the Berlekamp-Massey algorithm. Important point is that such a computation requires the a-priori knowledge of the period of the sequence S(F,y)S(F,y) to stop the search for the degree of the minimal polynomial. We introduce the Hankel matrix

Hm+j=[yF(j+1)(y)F(j+(m1))(y)F(y)F(2)(y)F(j+m)(y)F(j+(m1)(y)F(j+m)(y)F(j+(2m2))(y)]H_{m+j}=\left[\begin{array}[]{llll}y&F^{(j+1)}(y)&\ldots&F^{(j+(m-1))}(y)\\ F(y)&F^{(2)}(y)&\ldots&F^{(j+m)}(y)\\ \dots&\vdots&&\vdots\\ F^{(j+(m-1)}(y)&F^{(j+m)}(y)&\ldots&F^{(j+(2m-2))}(y)\end{array}\right] (7)

Following proposition is well known on computation of minimal polynomial of sequences in finite fields. In the present context the sequence is the vector sequence S(F,y)S(F,y) in 𝔽2n\mathbb{F}_{2}^{n}. Hence the Hankel matrix (7) is no more square as in the case of sequences over finite fields but is a block Hankel matrix.

Proposition 2.

Let S(F,y)S(F,y) be periodic then it has minimal polynomial of degree mm iff

rankHm+j=rankHm=m\mbox{rank}\,H_{m+j}=\mbox{rank}\,H_{m}=m (8)

for all j=0,1,2,j=0,1,2,\dots. The co-efficient vector

α^=(α0,,α(m1))T\hat{\alpha}=(\alpha_{0},\ldots,\alpha_{(m-1)})^{T}

of the minimal polynomial is the unique solution of

Hmα^=h(m)H_{m}\hat{\alpha}=h(m) (9)

where

h(m)=[Fm(y),F(m+1)(y),,F(2m1)(y)]Th(m)=[F^{m}(y),F^{(m+1)}(y),\ldots,F^{(2m-1)}(y)]^{T}
Proof.

In Proposition 1 it is shown that the sequence S(F,y)S(F,y) is periodic iff it has a minimal polynomial. Hence it is required to find its degree and co-efficients using the sequence. Let m(X)m(X) denoted in (6) be the minimal polynomial of degree mm. Then there is recurrence relation satisfied by the sequence S(F,y)S(F,y)

Fm+j(y)+i=0(m1)αiF(k+i+j)(y)=0F^{m+j}(y)+\sum_{i=0}^{(m-1)}\alpha_{i}F^{(k+i+j)}(y)=0

writing these equations for j=0,1,2,j=0,1,2,\ldots and noting that there is a unique solution to the co-effcients αi\alpha_{i} is equivalent to the rank condition (8) and the co-efficient vector is the solution of the linear system (9).

Conversely if the rank condition is satisfied there is a shortest linear recurrence relation of degree mm satisfied by the sequence S(F,y)S(F,y). The co-efficients of the recurrence are obtained uniquely by the linear system (9). ∎

2.1.2 Algorithm to compute a solution in a periodic orbit

One solution of F(x)=yF(x)=y when sequence S(F,y)S(F,y) is periodic, is obtained as described in the theorem below.

Theorem 1.

Let S(F,y)S(F,y) be a periodic sequence and m(X)m(X) as described in (6) be its minimal polynomial. Then there is a unique solution to F(x)=yF(x)=y in S(F,y)S(F,y) given by

x=(1/α0)[F(m1)(y)+i=1(m1)αiF(i1)(y)]x=(1/\alpha_{0})[F^{(m-1)}(y)+\sum_{i=1}^{(m-1)}\alpha_{i}F^{(i-1)}(y)] (10)
Proof.

Let S(F,y)S(F,y) be periodic of period NN. The point x=F(N1)(y)x=F^{(N-1)}(y) then satisfies the equation F(x)=yF(x)=y, hence this is one and the unique solution of the equation in the periodic orbit. But then it follows that for this solution xx, the periodic sequence S(F,x)=S(F,y)S(F,x)=S(F,y). Hence if m(X)m(X) as described in (6) is the minimal polynomial of S(F,Y)S(F,Y),

m(X)(x)=F(m)(x)+i=0(m1)αiFi(x)=0m(X)(x)=F^{(m)}(x)+\sum_{i=0}^{(m-1)}\alpha_{i}F^{i}(x)=0

From this expression of m(X)(x)m(X)(x) the term xx can be solved uniquely since α00\alpha_{0}\neq 0.

x=(1/α0)[F(m)(x)+i=1(m1)αiF(i)(x)]x=(1/\alpha_{0})[F^{(m)}(x)+\sum_{i=1}^{(m-1)}\alpha_{i}F^{(i)}(x)]

Then by using the condition y=F(x)y=F(x) one gets the relation (10). This is the expression of the unique solution xx in the periodic orbit S(F,y)S(F,y). ∎

We note following important points about the solution (10).

  1. 1.

    The unique solution (10) in the periodic orbit S(F,y)S(F,y) is expressed in terms of the linear combinations of the sequence S(F,y)S(F,y) which consists of only forward operations of the map FF (which is assumed to be feasible in practical time).

  2. 2.

    The number of terms in (10) are mm the degree of the minimal polynomial. Hence the solution xx is computed in polynomial order of computations in O(mk)O(m^{k}) given yy.

  3. 3.

    Since S(F,y)S(F,y) is periodic of period NN if it has a minimal polynomial, x=F(N1)(y)x=F^{(N-1)}(y) is also the same solution as computed in (10). However NN may be exponentially large hence this formula for computation of xx is not feasible without knowing the period NN.

  4. 4.

    If a solution xx is obtained by a possible minimal polynomial as in (10) then knowing the possible period NN it can be easily verified whether xx lies in the periodic orbit S(F,y)S(F,y) by F(x)=yF(x)=y instead of verifying by the equation F(N1)(y)=xF^{(N-1)}(y)=x.

  5. 5.

    If the degree mm itself is of polynomial order in nn (number of variables) then the online computation of the solution xx in S(F,y)S(F,y) is computable in polynomial time. (The situation is comparable to primitive polynomials of degree nn whose order is N=2n1N=2^{n}-1. Hence mm is expected to be of the order logN\log N in same proportions (density) as primitive polynomials of degree nn among all polynomials).

Based on this theorem the online algorithm to compute one solution xx when yy is in a periodic orbit S(F,Y)S(F,Y) is Algorithm 1.

Algorithm 1 Online Algorithm: Unique solution in a periodic orbit
1:procedure SolutioninPriodicorbit(S(F,y)S(F,y))
2:     Input: Set of all possible periods Π^\hat{\Pi} (computed offline), Nm=max{Π^}N_{m}=\mbox{max}\{\hat{\Pi}\}, m0m_{0} a miniumum value of degree below which minimal polynomial does not exist.
3:     Output: One solution of F(x)=yF(x)=y in the periodic orbit S(F,y)S(F,y) if one exists otherwise returns that there is no solution in a periodic orbit.
4:     Set m=m0m=m_{0}
5:     repeat
6:         Compute matrices HmH_{m}, H(m+1)H_{(m+1)}
7:         if 
rankHm=rankHm+1=m\mbox{rank}\,H_{m}=\mbox{rank}\,H_{m+1}=m
 then
8:              find solution α^\hat{\alpha} (co-efficients of polynomial m(X)m(X)) in (9).
9:              for NΠ^N\in\hat{\Pi} do
10:                  while (m(X)|XN1)(F(x)=y)(m(X)|X^{N}-1)\bigwedge(F(x)=y) do
11:                       Return solution xx as computed in (10)
12:                       % Solution in a periodic orbit of period NN
13:                  end while
14:              end for
15:         else
16:              mm+1m\leftarrow m+1
17:         end if
18:     until m>Nmm>N_{m}
19:     Return: No solution in periodic orbits.
20:end procedure

2.1.3 Online Incomplete algorithm to compute local inverse

It is interesting to observe how an online incomplete online algorithm can be constructed which may possibly find a solution given yy but without any offline computation. Such an algorithm may be practically useful within certain bounds on the degree of the minimal polynomial. Let a bound MM on the degree of the minimal polynomial m(X)m(X) is specified and the step of computation of m(X)m(X) is stopped when degree mm of a possible minimal polynomial exceeds MM. The bound MM should be theoretically at most equal to any of the possible periods of closed orbits NN of FF. However MM is chosen from a point of view of feasibility of the computation of the minimal polynomial using the rank criterion of the the section 2.1.1. Hence MM may be chosen of polynomial order O(nk)O(n^{k}) in the number of variables for suitable kk. Algorithm 2 shows this computation.

Algorithm 2 Online Algorithm (Incomplete): Unique solution in a periodic orbit or report no conclusion
1:procedure PossibleSolutionin(S(F,y)S(F,y))
2:     Input: yy, m0m_{0} a miniumum value of degree below which minimal polynomial does not exist and MM maximum value.
3:     Output: One solution of F(x)=yF(x)=y in the periodic orbit S(F,y)S(F,y) if one exists with minimal polynomial of degree m<Mm<M otherwise returns that there is no conclusion.
4:     Set m=m0m=m_{0}
5:     repeat
6:         Compute matrices HmH_{m}, H(m+1)H_{(m+1)}
7:         if 
rankHm=rankHm+1=m\mbox{rank}\,H_{m}=\mbox{rank}\,H_{m+1}=m
 then
8:              find solution α^\hat{\alpha} (co-efficients of polynomial m(X)m(X)) in (9)
9:              compute xx as a possible solution as in (10) .
10:              compute N=ordm(X)N=\mbox{ord}\;m(X)
11:              while F(x)=yF(x)=y do
12:                  Return solution xx as computed in (10)
13:                  % Solution in a periodic orbit of period NN
14:              end while
15:         else
16:              mm+1m\leftarrow m+1
17:         end if
18:     until m>Mm>M
19:     Return: No conclusion about solution in a periodic orbit.
20:end procedure

Algorithm 2 is practically feasible and results in one correct solution when the linear complexity of S(F,y)S(F,y) is less than MM. The algorithm eliminates false positive solutions by checking the equation F(x)=yF(x)=y in step 1111.

Theorem 1 leaves open the question whether there are other solutions outside the periodic orbit S(F,y)S(F,y) or when such solutions exist when S(F,y)S(F,y) is not periodic. This problem is considered next.

2.2 Solutions outside periodic orbits

From the lemma 1 it follows that solutions which are not in the periodic orbit S(F,y)S(F,y) or if S(F,y)S(F,y) is itself not periodic can only possibly arise on chains Fk(z)F^{k}(z) starting from zz in GOE of FF. Hence assuming the GOE is computed in offline computation an online algorithm for discovering solutions on chains from GOE uses only forward computations of the map FF. However an efficient termination condition for the forward computation on a chain is needed.

2.2.1 Termination of a chain on a periodic orbit and all solutions on the chains

If z(k)=F(k)(z)z(k)=F^{(k)}(z) is a sequence of points on a chain, the chain terminates when z(k)z(k) meets a periodic orbit. If all possible periods of periodic orbits of FF are known a-priori then for each NN of these periods, the relation FN(z(k))=z(k)F^{N}(z(k))=z(k) seems to be the only way to check whether z(k)z(k) is on a periodic orbit of period NN. Hence it is necessary to show that even when NN is exponential order in nn, evaluation FN(z)F^{N}(z) can be carried out efficiently in polynomial time in logN\log N on any point zz in 𝔽2n\mathbb{F}_{2}^{n}. This is shown in Appendix. Algorithm 3 to compute solutions of F(x)=yF(x)=y outside periodic orbits S(F,y)S(F,y) can be as follows.

Algorithm 3 Solution in a chain
1:procedure Solutioninachain(z,y)
2:     Input:
3:     1. zz a point in GOE (computed offline),
4:     2. yy online value of F(x)F(x) to be inverted,
5:     3. set of all possible periods Π^\hat{\Pi} (computed offline)
6:     Output: Solution of F(x)=yF(x)=y on a chain starting from zz.
7:     for NN in Π^\hat{\Pi} do
8:         k=1k=1,
9:         Compute z(k)=F(k)(z)z(k)=F^{(k)}(z)
10:         while z(k)yz(k)\neq y do
11:              if F(N)(z(k))=z(k)F^{(N)}(z(k))=z(k) then
12:                  Print: No solution on the chain from zz.
13:              end if
14:         end while
15:         if z(k)=yz(k)=y then
16:              a solution is
17:              x=z(k1)=F(k1)(z)x=z(k-1)=F^{(k-1)}(z)
18:         end if
19:         kk+1k\leftarrow k+1
20:         \triangleright The loop always ends because z(k)z(k) joins a
21:         \triangleright periodic orbit of period NN or is equal to yy
22:     end for
23:end procedure

Algorithm 3 is repeated in parallel for all points zz in GOE. Both the online algorithms Algorithm 1 for computing an inverse in a periodic orbit containing yy and Algorithm 3 to compute all other solutions, require an a-priori (offline) computation on FF which is independent of yy. This computation creates a data, the set Π^\hat{\Pi} of all possible periods of periodic orbits of FF and the set GOE. This offline computation is discussed in the next section.

3 Computation of possible periods of orbits and the GOE

For linear maps L:𝔽2n𝔽2nL:\mathbb{F}_{2}^{n}\mapsto\mathbb{F}_{2}^{n}, [1] showed how the computation of the set of all periods of closed orbits and the set of all points in the GOE is accomplished by computing the rational canonical form of LL over 𝔽2\mathbb{F}_{2} in a fixed basis in 𝔽2n\mathbb{F}_{2}^{n}. The online algorithms presented in the previous section to compute local inverse of FF at yy make use of the offline data of all possible periods of closed orbits of the map FF and the GOE of FF. However since FF is not linear the linear algebraic computation of [1] is no more applicable. In this section we take up the problem of computation of the GOE when FF is not linear. We show that the computations of all periods of closed orbits of the map FF can be achieved by computing an analogous linear algebraic map whose set of periods of closed orbits contains this information of periods of orbits of FF. The GOE of FF however needs to be computed separately by solving a Boolean system. These two computations are achieved as follows.

  1. 1.

    Computation of all possible periods of orbits of map FF, by showing that this set belongs to the set of periods of all orbits of a linear map dual to FF restricted to a dual vector space. This observation allows the linear algebraic computation of all possible periods by the rational canonical form as shown in [1].

  2. 2.

    Computation of GOE of the map FF by means of the implicant based Boolean solver algorithm of [9].

Both of these computations are expected to be hard. However since these are performed offline on FF they may be feasible practically for special instances of FF given sufficient memory for parallel computation.

3.1 Linear representation of map FF

To compute the information on periods of closed orbits of the map FF a suitable representation of the action of the map FF in a linear space is logically appropriate. We shall revisit the essential ideas on this representation which have recently been announced in [6]. The map FF acts in the space 𝔽2n\mathbb{F}_{2}^{n} as a polynomial function of the co-ordinates of the space 𝔽2n\mathbb{F}_{2}^{n}. Let VV denote the 𝔽2\mathbb{F}_{2}-linear space of 𝔽2\mathbb{F}_{2}-valued functions on 𝔽2n\mathbb{F}_{2}^{n}. Denote by χi\chi_{i} the co-ordinate functions in VV defined by their evaluation at points xx in 𝔽2n\mathbb{F}_{2}^{n} as

χi(x)=xi\chi_{i}(x)=x_{i}

where xix_{i} is the ii-th co-ordinate of xx. The map FF has the dual action on functions ϕ\phi in VV defined by the composition

F(ϕ(x))ϕ(F(x))F^{*}(\phi(x))\triangleq\phi(F(x))

FF^{*} is thus a linear operator ϕF\phi\circ F in VV. Consider the FF^{*}-invariant subspace WW which is the smallest invariant subspace of FF^{*} containing all the co-ordinate functions χi\chi_{i}. The space WW can be obtained as the sum of cyclic invariant subspaces WiW_{i} generated by χi\chi_{i},

Wi=span𝔽2{χi,F(χi),,(F)(mi1)(χi)}W_{i}=\mbox{span}_{\mathbb{F}_{2}}\{\chi_{i},F^{*}(\chi_{i}),\ldots,(F^{*})^{(m_{i}-1)}(\chi_{i})\} (11)

where mim_{i} is the smallest number such that (F)mi(χi)(F^{*})^{m_{i}}(\chi_{i}) is linearly dependent on WiW_{i}. Define

W=W1+W2++WnW=W_{1}+W_{2}+\ldots+W_{n} (12)

This space WW is thus the smallest invariant subspace of FF^{*} which contains all co-ordinate functions. Consider the restriction F1=F|WF_{1}=F^{*}|W. We define a linear dynamic system using the action of F1F_{1} in WW as shown next.

3.2 Computation of all periods from the linear representation

In this section we gather some of the relevant results of [6]. Consider a basis {\cal B} (of functions in VV) of WW as the ordered set

={ψ1,ψ2,,ψN}{\cal B}=\{\psi_{1},\psi_{2},\ldots,\psi_{N}\}

where N=dimWN=\dim W. Define the matrix representation of F1F_{1} by the relation

F1[ψ1,,ψN]=[ψ1,,ψN]KF_{1}[\psi_{1},\ldots,\psi_{N}]=[\psi_{1},\ldots,\psi_{N}]K (13)

where KK is an N×NN\times N matrix over 𝔽2\mathbb{F}_{2}. Columns of KK are the co-efficients kijk_{ij} appearing in the expression

F1(ψi)=j=1NkijψjF_{1}(\psi_{i})=\sum_{j=1}^{N}k_{ij}\psi_{j}

We first show how F1F_{1} hence KK capture information about the map FF and its dynamical trajectories.

Proposition 3.

The map FF is a permutation of 𝔽2n\mathbb{F}_{2}^{n} iff F1F_{1} is a permutation, equivalently the matrix KK is non-singular

Proof.

Let ψ\psi be any function on 𝔽2n\mathbb{F}_{2}^{n}. Then F(ψ)=0F^{*}(\psi)=0 implies ψ(F(x))=0\psi(F(x))=0 for all xx. Hence FF is one to one implies ψ(y)=0\psi(y)=0 for all yy in 𝔽2n\mathbb{F}_{2}^{n} i.e. ψ\psi is the zero function. Hence FF^{*} is also one to one. Hence its restriction F1F_{1} in WW is also one to one and equivalently the matrix representation KK is non-singular.

Conversely, assume FF is not surjective, then there exists a point β\beta in the GOE of FF for which there is no solution xx such that β=F(x)\beta=F(x). Any function ψ\psi in F(W)F^{*}(W) is of the form

ψ=i=1NaiψiF\psi=\sum_{i=1}^{N}a_{i}\psi_{i}\circ F

where ψi\psi_{i} are functions in the basis {\cal B}. Then for any function ψ\psi in F(W)F^{*}(W) as above, the value

i=1Naiψi(β)\sum_{i=1}^{N}a_{i}\psi_{i}(\beta)

does not belong to image the image of ψ\psi. In particular for a co-ordinate function χi\chi_{i} in WW which has a representation in the basis as

χi=i=1Nαiψi\chi_{i}=\sum_{i=1}^{N}\alpha_{i}\psi_{i}

the value of ii-th component βi=χi(β)\beta_{i}=\chi_{i}(\beta) does not belong to the image of FχiF^{*}\chi_{i}. Hence it follows that χi\chi_{i} does not belong to F(W)F^{*}(W). But since WW is an invariant subspace of FF^{*} which contains all co-ordinate functions χi\chi_{i} it follows that F(W)=F1(W)F^{*}(W)=F_{1}(W) does not contain the function χi\chi_{i}. Which implies that F1F_{1} is not surjective. Equivalently KK is singular. ∎

Above proposition gives a necessary and sufficient condition for FF to be a permutation in terms of the matrix representation KK on the subspace WW. Next we draw a correspondence between the trajectories of dynamics of FF with dynamics of KK in 𝔽2N\mathbb{F}_{2}^{N}.

3.2.1 Embedding of trajectories in trajectories of a Linear dynamic system

Consider the linear dynamic systems, called hereafter as Koopman system corresponding to FF, defined by iterations by the linear map

KT:𝔽2N𝔽2NyKTy\begin{array}[]{rcl}K^{T}:\mathbb{F}_{2}^{N}&\mapsto&\mathbb{F}_{2}^{N}\\ y&\mapsto&K^{T}y\end{array} (14)

For a trajectory

x,F(x),F(2)(x),x,F(x),F^{(2)}(x),\ldots

of iterations of the map FF in 𝔽2n\mathbb{F}_{2}^{n} define an embedding in the trajectories of Koopman system in 𝔽2N\mathbb{F}_{2}^{N} corresponding to the basis {\cal B} by

𝔽2n𝔽2Nxψ^(x)\begin{array}[]{lcl}\mathbb{F}_{2}^{n}&\mapsto&\mathbb{F}_{2}^{N}\\ x&\mapsto&\hat{\psi}(x)\end{array} (15)

where

ψ^(x)=[ψ1(x),ψ2(x),,ψN(x)]T\hat{\psi}(x)=[\psi_{1}(x),\psi_{2}(x),\ldots,\psi_{N}(x)]^{T}

Then a trajectory of the map FF in 𝔽2n\mathbb{F}_{2}^{n} is embedded as a trajectory of the linear map (14) in 𝔽2N\mathbb{F}_{2}^{N} by

(x,F(x),F(2)(x),)(ψ^(x),ψ^(F(x)),ψ^(F(2)(x)),)=(ψ^(x),Fψ^(x),(F)2ψ^(x),)=(ψ^(x),KTψ^(x),(KT)2ψ^(x),)\begin{array}[]{lcl}(x,F(x),F^{(2)}(x),\ldots)&\mapsto&(\hat{\psi}(x),\hat{\psi}(F(x)),\hat{\psi}(F^{(2)}(x)),\dots)\\ &=&(\hat{\psi}(x),F^{*}\hat{\psi}(x),(F^{*})^{2}\hat{\psi}(x),\dots)\\ &=&(\hat{\psi}(x),K^{T}\hat{\psi}(x),(K^{T})^{2}\hat{\psi}(x),\ldots)\end{array} (16)
Lemma 2.

Following correspondence holds between trajectories of iterations of map FF and that of KTK^{T}.

  1. 1.

    To every closed orbit of the iteration of the map FF there corresponds a closed orbit of the Koopman system (iterations of the linear map (14)) of the same period

  2. 2.

    To every chain in iterations of FF there corresponds a chain in iterations of KTK^{T} of same length.

Proof.

The proof essentially follows from the embeddings (16) of trajectories of FF into that of trajectories of KTK^{T}. If there is a periodic trajectory F(k)(x)F^{(k)}(x) of FF of period NN then it satisfies F(k+N)(x)=F(k)(x)F^{(k+N)}(x)=F^{(k)}(x). Hence under the embeddings (15) and (16) the trajectory satisfies

(KT)(k+N)(ψ^(x))=(KT)k(ψ^(x))(K^{T})^{(k+N)}(\hat{\psi}(x))=(K^{T})^{k}(\hat{\psi}(x))

Since NN is the period of the trajectory it is also the period of the embedded trajectory.

The argument about the embedding of chain and their lengths also follows on similar reasoning. ∎

From this lemma we get a set of all numbers which contains all periods of closed orbits of FF as follows.

Theorem 2.

The set Π\Pi of all periods of closed orbits of iterations of FF in 𝔽2n\mathbb{F}_{2}^{n} is a subset of the set of all periods Π^\hat{\Pi} of closed orbits of iterations of KTK^{T} in 𝔽2N\mathbb{F}_{2}^{N}. Π^\hat{\Pi} can be computed in polynomial time in NN.

Proof.

That ΠΠ^\Pi\subset\hat{\Pi} follows from the above lemma. The rational canonical form of KTK^{T} gives all elementary divisors of KTK^{T} and as shown in [1] the periods of closed orbits of iterations of KTK^{T} are obtained as the orders of powers of elementary divisors of KTK^{T}. Hence computation of Π^\hat{\Pi} can be accomplished in polynomial time in NN which is the size of KTK^{T}. ∎

For the sake of clarity of the computation of Π^\hat{\Pi}, the set of periods of all closed orbits of iterations of KTK^{T}, we present the well known result from [1] here without proof.

Theorem 3.

Consider the linear map A:𝔽2n𝔽2nA:\mathbb{F}_{2}^{n}\mapsto\mathbb{F}_{2}^{n}. Let

{d1(X),d2(X),,dw(X)}\{d_{1}(X),d_{2}(X),\ldots,d_{w}(X)\}

denote the elementary divisors of AA in 𝔽2[X]\mathbb{F}_{2}[X] such that di(0)0d_{i}(0)\neq 0 and let each di(X)d_{i}(X) has the form

di(X)=(pi(X))eid_{i}(X)=(p_{i}(X))^{e_{i}}

where pi(X)p_{i}(X) are irreducible polynomials in 𝔽2[X]\mathbb{F}_{2}[X]. Then the set of all periods of closed orbits of iteration of the map AA is given by

Π(A)={1,Tij,i=1,,w,j=1,,ei}\Pi(A)=\{1,T_{ij},i=1,\ldots,w,j=1,\ldots,e_{i}\}

where

{Tij=Order(pi(X))j,j=1,2,,ei}\{T_{ij}=\mbox{Order}\;(p_{i}(X))^{j},j=1,2,\ldots,e_{i}\}

(Here Orderp(X)\mbox{Order}\;p(X) of a polynomial satisfying p(0)0p(0)\neq 0 is the smallest number TT such that p(X)p(X) divides XT1X^{T}-1). For a proof of this well known theorem reader may see section 12.10 in [1]. The theorem above shows that the computation of the set Π(A)\Pi(A) of periods of the map AA is accomplished by computing the rational canonical form of AA to compute all elementary divisors of AA.

3.2.2 Offline algorithm for computing the set of all possible periods

An offline algorithm can thus find the input Π^\hat{\Pi} required in Algorithms 1 and 2 in following by computing Π(K)\Pi(K) and treating it as Π^\hat{\Pi} since by theorem 2 Π^\hat{\Pi} contains all possible periods of closed orbits of iterations of FF.

  1. 1.

    Compute the matrix KK, a representation of FF^{*} on the invariant space WW in a fixed basis.

  2. 2.

    Compute the set Π^\hat{\Pi} of all periods of closed orbits of KK by computing the rational canonical form of KK and using theorem (3). (Note that this set is same as that of set of all periods of closed orbits of iterations of KTK^{T}).

The computation of the matrix representation KK of FF may turn out to be a hard computation of NPNP class. This is because the dimensions of the subspaces WiW_{i} in (11) are likely to grow very fast with nn depending on the degrees of polynomial components of the map FF. Also the computation of composition F(f)=fFF^{*}(f)=f\circ F is complicated although theoretically of polynomial time in nn. However as this computation is offline it has much relaxed conditions on practical time and memory issues as compared to online computation. However the computation of Π^\hat{\Pi} is polynomial time in NN the dimension of the space WW. Doing this hard computation offline is the price one has to pay for getting a complete algorithm for inversion.

3.3 Computation of the GOE

The input required for the Algorithm 2 is the set GOE of FF. This computation is formalised as the following Boolean system problem.

Problem 1.

Given the map FF in polynomial form, determine the set GG of all simultaneous assignments {yi,i=1,,n}\{y_{i},i=1,\dots,n\} in 𝔽2\mathbb{F}_{2} such that for the vector y=(y1,,yn)Ty=(y_{1},\ldots,y_{n})^{T} the Boolean system of equations

F(x1,,xn)=yF(x_{1},\ldots,x_{n})=y

is not satisfiable for any assignments {xi,i=1,,n}\{x_{i},i=1,\dots,n\} in 𝔽2\mathbb{F}_{2}. Then GOE of FF is the set of all such vectors yy in 𝔽2n\mathbb{F}_{2}^{n}.

Computation of GOE can be accomplished in offline by means of an algorithm which can represent all solutions of a Boolean system of equation. Such an algorithm is announced in [9]. The algorithm is in general of exponential order in nn. However the algorithm is parallel and given sufficient memory has complexity O(n)O(n) for parallel computation of an nn variable Boolean system. This computation is described in the next section.

4 Computation of the GOE in terms of implicants

The final offline computation required to solve the local inversion problem is the computation of the GOE of the map FF. As stated in Problem 1, a strategy to solve this problem makes use of the Boolean system F(X)=YF(X)=Y defined by the map FF. Let the map FF be described in terms of its component functions of nn variables as

F(x1,,xn)=[f1(x1,,xn),,fn(x1,,xn)]TF(x_{1},\ldots,x_{n})=[f_{1}(x_{1},\ldots,x_{n}),\ldots,f_{n}(x_{1},\ldots,x_{n})]^{T}

where fif_{i} are Boolean functions of nn Boolean variables variables xix_{i} taking values in the Boolean ring 𝔽2\mathbb{F}_{2}. We shall briefly revisit background of the implicant based representation of all solutions of Boolean systems from [9]. Let g(x1,,xn)g(x_{1},\ldots,x_{n}) be a Boolean function of X={x1,,xn}X=\{x_{1},\ldots,x_{n}\}. A term t(X)t(X) in Boolean variables XX is an elementary conjunction

t(X)=i{1:n}xiait(X)=\prod_{i\in\{1:n\}}x_{i}^{a_{i}}

where ai=0,1a_{i}=0,1 and xa=xx^{a}=x for a=1a=1 while xa=xx^{a}=x^{\prime} (the compliment) if a=0a=0. An implicant of a Boolean function g(X)g(X) is a term t(X)t(X) such that if t(a)=1t(a)=1 for any assignment X=aX=a for a𝔽2na\in\mathbb{F}_{2}^{n} then g(a)=1g(a)=1. A set IgI_{g} of implicants of a function gg is said to be complete if g(a)=1g(a)=1 for any assignment X=aX=a then there exists a term tt in IgI_{g} such that t(a)=1t(a)=1. A basic fact in Boolean algebra is that if IgI_{g} is a complete set of implicants of a function gg then

g(X)=tIgt(X)g(X)=\sum_{t\in I_{g}}t(X)

One of the fundamental problems of computation in Boolean algebra is the computation of the representation of all satisfying assignments of a Boolean function gg of nn variables. An assignment X=aX=a is said to satisfy a Boolean function gg if g(a)=1g(a)=1. Such a representation is accomplished by an algorithm using implicants in [9]. This shall be described next.

4.1 Representation of all satisfying assignments

A set of nonzero orthogonal (OG) terms {t1,,tm}\{t_{1},\ldots,t_{m}\} is one in which titj=0t_{i}t_{j}=0 for iji\neq j. An OG set of terms is said to be orthonormal (ON) if

iti(X)=1\sum_{i}t_{i}(X)=1

Hence following fact follows.

Lemma 3.

If IgI_{g} is a complete set of OG implicants of a Boolean function gg then the set of all satisfying assignments of gg is the set

S(g)=tiIgS(ti)S(g)=\cup_{t_{i}\in I_{g}}S(t_{i}) (17)

where S(ti)S(t_{i}) is the satisfying assignment of the implicant tit_{i}.

4.1.1 Implicants of a system

For any implicant t(X)t(X) the satisfying assignment t(a)=1t(a)=1 is a partial assignment of all literals in t(X)t(X) to equal 11. Hence the above expression (17) is a compact representation of all satisfying assignments of gg. The union in (17) is disjoint because the implicants are OG hence for any ti=1t_{i}=1, tj=0t_{j}=0 at the same assignment for jij\neq i.

The implicant based solver for a Boolean system of equations of [9] computes the set set of all satisfying assignments of a Boolean system in terms of a complete OG set of implicants of the system. Here an implicant of a system of Boolean functions G={gi(X)}G=\{g_{i}(X)\}, i=1,,m}i=1,\dots,m\} is meant a term t(X)t(X) such that if t(a)=1t(a)=1 for an assignment X=aX=a then gi(a)=1g_{i}(a)=1 for all i=1,,mi=1,\ldots,m. Hence such a system of Boolean functions is represented by a single function gg in terms of a complete set IGI_{G} of implicants of the system GG

g(X)=tIGt(X)g(X)=\sum_{t\in I_{G}}t(X)

Then we have

g(X)=i=1mgi(X)g(X)=\prod_{i=1}^{m}g_{i}(X)

Hence the set of all satisfying assignments of the system GG is given by

S(G)=S(g)=tIGS(t)S(G)=S(g)=\sum_{t\in I_{G}}S(t) (18)

4.2 Formulation of the problem of GOE

Consider the map FF in Problem 1, then GOE of FF consists of points (y1,y2,,yn)(y_{1},y_{2},\ldots,y_{n}) in 𝔽2n\mathbb{F}_{2}^{n} such that

F(x1,,xn)=(y1,,yn)TF(x_{1},\ldots,x_{n})=(y_{1},\ldots,y_{n})^{T}

has no satisfying assignments XX. Consider the above system of Boolean equations in variables XX and Y=(y1,,yn)Y=(y_{1},\ldots,y_{n}), denoted as F(X)Y=0F(X)\oplus Y=0. Let a complete set of OG implicants for satisfying assignments of this system of equations be denoted as I(F,Y)I(F,Y). Then each implicant in this set is of the form

t(X,Y)=t1(X)t2(Y)t(X,Y)=t_{1}(X)t_{2}(Y)

where t1t_{1} and t2t_{2} are terms in XX and YY respectively such that for assignments t1(a)=1t_{1}(a)=1, t2(b)=1t_{2}(b)=1, (a,b)(a,b) satisfies t(a,b)=1t(a,b)=1 for some tt in the set I(F,Y)I(F,Y). Define the function

ϕ(Y)=tI(F,Y)t2(Y)\phi(Y)=\sum_{t\in I(F,Y)}t_{2}(Y) (19)
Theorem 4.

GOE of FF is the set S(ϕ(Y))S(\phi(Y)^{\prime}) or alternatively,

GOE={Y|ϕ(Y)=0}\mbox{GOE}=\{Y|\phi(Y)=0\}
Proof.

Since tt is itself an implicant of the system F(X)Y=0F(X)\oplus Y=0, for an assignment X=a,Y=bX=a,Y=b which satisfies this equation, t1(a)=t2(b)=1t_{1}(a)=t_{2}(b)=1. From this it follows that the set of all assignments of YY for which there exist assignments of XX of the system is obtained as satisfying assignments of

tI(F,Y)t2(Y)=1\sum_{t\in I(F,Y)}t_{2}(Y)=1

Hence all assignments of YY for which there is no solution XX of the equation are equal to satisfying assignments of all the equations

t2(Y)=0,tI(F,Y)t_{2}(Y)=0,\forall t\in I(F,Y)

This is expressed as the set of all solutions of the the equation

tI(F,Y)t2(Y)=0\sum_{t\in I(F,Y)}t_{2}(Y)=0

Defining the function ϕ(Y)\phi(Y) as given the result follows. ∎

Such a set of assignments YY can be thus computed by using the implicant algorithm again on the function ϕ(Y)\phi(Y)^{\prime}.

4.2.1 An example of computation of GOE using the Boolean solver algorithm

Consider the map

F(x1,x2,x3)=[x1x2x3x1x2x3,x1x2,x2x1x3]TF(x_{1},x_{2},x_{3})=[x_{1}\oplus x_{2}x_{3}\oplus x_{1}x_{2}x_{3},x_{1}\oplus x_{2},x_{2}\oplus x_{1}x_{3}]^{T}

The system F(X)Y=0F(X)\oplus Y=0 above in this case is

g1=x1x2x3x1x2x3y1=0g2=x1x2y2=0g3=x2x1x3y3=0\begin{array}[]{rcl}g_{1}=x_{1}\oplus x_{2}x_{3}\oplus x_{1}x_{2}x_{3}\oplus y_{1}&=&0\\ g_{2}=x_{1}\oplus x_{2}\oplus y_{2}&=&0\\ g_{3}=x_{2}\oplus x_{1}x_{3}\oplus y_{3}&=&0\end{array}

which we shall denote as S(X,Y)S(X,Y). Define

g(X,Y)=(g1(X,Y)1)(g2(X,Y)1)(g3(X,Y)1)g(X,Y)=(g_{1}(X,Y)\oplus 1)(g_{2}(X,Y)\oplus 1)(g_{3}(X,Y)\oplus 1)

Then a complete set of implicants of g(X,Y)g(X,Y) is a complete set of implicants of the system S(X,Y)S(X,Y). We find this set using the Boolean system solver algorithm of [9]. Using the ON set I={x1,x1x2,x1x2}={ti,i=1,2,3}I=\{x_{1},x_{1}^{\prime}x_{2},x_{1}^{\prime}x_{2}^{\prime}\}=\{t_{i},i=1,2,3\} we find implicants of the function g(X,Y)g(X,Y).

Pivote function gg/t1g/t2g/t3g21=1x1x2y2x2y2y2y2\begin{array}[]{llll}\mbox{Pivote function $g$}&g/t_{1}&g/t_{2}&g/t_{3}\\ g_{2}\oplus 1=1\oplus x_{1}\oplus x_{2}\oplus y_{2}&x_{2}\oplus y_{2}&y_{2}&y_{2}^{\prime}\\ \end{array}

Hence I(g21)={x1x2y2,x1x2y2,x1x2y2,x1x2y2}I(g_{2}\oplus 1)=\{x_{1}x_{2}^{\prime}y_{2},x_{1}x_{2}y_{2}^{\prime},x_{1}^{\prime}x_{2}y_{2},x_{1}^{\prime}x_{2}^{\prime}y_{2}^{\prime}\} denoted as {ti,i=1,,4}\{t_{i},i=1,\dots,4\} next we use this implicant set

Pivote function gg/t1g/t2g/t3g/t4g11=1x1x2x3x1x2x3y1y1y1x3y1y1\begin{array}[]{lllll}\mbox{Pivote function $g$}&g/t_{1}&g/t_{2}&g/t_{3}&g/t_{4}\\ g_{1}\oplus 1=1\oplus x_{1}\oplus x_{2}x_{3}\oplus x_{1}x_{2}x_{3}\oplus y_{1}&y_{1}&y_{1}&x_{3}\oplus y_{1}^{\prime}&y_{1}\\ \end{array}

Hence

I((g11)(g21))={x1x2y1y2,x1x2y1y2,x1x2y2x3y1,x1x2y2x3y1,x1x2y1y2}I((g_{1}\oplus 1)(g_{2}\oplus 1))=\{x_{1}x_{2}^{\prime}y_{1}y_{2},x_{1}x_{2}y_{1}y_{2}^{\prime},x_{1}^{\prime}x_{2}y_{2}x_{3}y_{1},x_{1}^{\prime}x_{2}y_{2}x_{3}^{\prime}y_{1}^{\prime},x_{1}^{\prime}x_{2}^{\prime}y_{1}^{\prime}y_{2}^{\prime}\}

This set has five implicants {ti,i=1,ldots,5}\{t_{i},i=1,ldots,5\}. We next take the final pivot to find complete implicant set of the function gg or the system S(X,Y)S(X,Y).

Pivote function gg/t1g/t2g/t3g/t4g/t5g31=1x2x1x3y3x3y3x3y3y3y3y3\begin{array}[]{llllll}\mbox{Pivote function $g$}&g/t_{1}&g/t_{2}&g/t_{3}&g/t_{4}&g/t_{5}\\ g_{3}\oplus 1=1\oplus x_{2}\oplus x_{1}x_{3}\oplus y_{3}&x_{3}\oplus y_{3}^{\prime}&x_{3}\oplus y_{3}&y_{3}&y_{3}&y_{3}^{\prime}\\ \end{array}

Hence the complete set of implicants of the system F(X)=YF(X)=Y is

{x1x2y1y2x3y3,x1x2y1y2x3y3,x1x2x3y1y2y3,x1x2y1y2x3y3,x1x2y1y2x3y3,x1x2x3y1y2y3,x1x2y1y2y3}\begin{array}[]{l}\{x_{1}x_{2}^{\prime}y_{1}y_{2}x_{3}^{\prime}y_{3}^{\prime},x_{1}x_{2}y_{1}y_{2}^{\prime}x_{3}y_{3}^{\prime},x_{1}^{\prime}x_{2}x_{3}y_{1}y_{2}y_{3},x_{1}x_{2}^{\prime}y_{1}y_{2}x_{3}y_{3},x_{1}x_{2}y_{1}y_{2}^{\prime}x_{3}^{\prime}y_{3},\\ x_{1}^{\prime}x_{2}x_{3}^{\prime}y_{1}^{\prime}y_{2}y_{3},x_{1}^{\prime}x_{2}^{\prime}y_{1}^{\prime}y_{2}^{\prime}y_{3}^{\prime}\}\end{array}

Expressing these as products {ti1(X)ti2(Y)}\{t_{i1}(X)t_{i2}(Y)\} the factors affecting assignments of YY for which there exist solution XX are

T(Y)={y1y2y3,y1y2y3,y1y2y3,y1y2y3,y1y2y3,y1y2y3}T(Y)=\{y_{1}y_{2}y_{3}^{\prime},y_{1}y_{2}^{\prime}y_{3}^{\prime},y_{1}y_{2}y_{3},y_{1}y_{2}^{\prime}y_{3},y_{1}^{\prime}y_{2}y_{3},y_{1}^{\prime}y_{2}^{\prime}y_{3}^{\prime}\}

These are six minterms in y1,y2,y3y_{1},y_{2},y_{3}. Hence all points in GOE are given by solutions of

ϕ(Y)=iti2(Y)=0\phi(Y)=\sum_{i}t_{i2}(Y)=0

Since all minterms in YY add up to 11 the above equation is equivalent to the following equation in terms of minterms not present in the above set T(Y)T(Y),

y1y2y3+y1y2y3=1y_{1}^{\prime}y_{2}y_{3}^{\prime}+y_{1}^{\prime}y_{2}^{\prime}y_{3}=1

On simplifying, this equation is equivalent to

y1(y2y3)=1y_{1}^{\prime}(y_{2}\oplus y_{3})=1

Hence y1=0y_{1}=0 along with pairs (y2=0,y3=1)(y_{2}=0,y_{3}=1), (y2=1,y3=0)(y_{2}=1,y_{3}=0). Hence GOE of FF consists of two points

GOE={(0,0,1),(0,1,0)}\mbox{GOE}=\{(0,0,1),(0,1,0)\}

To verify correctness of the GOE computed above we can see actual trajectories of the map FF as follows

orbit of length 1(0,0,0)(0,0,0)orbit of length 4(1,0,0)(1,1,0)(1,0,1)(1,1,1)(1,0,0)chain of length 2(0,1,0)(0,1,1)(1,1,1)chain of length 1(0,0,1)(0,0,0)\begin{array}[]{ll}\mbox{orbit of length $1$}&(0,0,0)\mapsto(0,0,0)\\ \mbox{orbit of length $4$}&(1,0,0)\mapsto(1,1,0)\mapsto(1,0,1)\mapsto(1,1,1)\mapsto(1,0,0)\\ \mbox{chain of length $2$}&(0,1,0)\mapsto(0,1,1)\mapsto(1,1,1)\\ \mbox{chain of length $1$}&(0,0,1)\mapsto(0,0,0)\end{array}

Hence the actual trajectories show that GOE consists of the predicted two points (0,1,0),(0,0,1)(0,1,0),(0,0,1).

5 Applications to Cryptanalysis

In this section we briefly discuss application of the local inversion algorithm we have developed in previous sections to illustrate Cryptanalysis of block and stream ciphers.

5.1 Cryptanalysis of block ciphers

A block cipher is a map E:𝔽2n+m𝔽2pE:\mathbb{F}_{2}^{n+m}\mapsto\mathbb{F}_{2}^{p} where nn is the length in bits of the symmetric key KK, mm is the length of the input plaintext block PP and pp is the length of the output ciphertext CC. EE is called an encryption function and CC the encryption of PP. The map EE satisfies the properties:

  1. 1.

    Computation of CC for given PP and KK is efficiently feasible.

  2. 2.

    Computation of PP given CC and KK is efficiently feasible.

  3. 3.

    For any fixed KK, E(K,X):𝔽2m𝔽2pE(K,X):\mathbb{F}_{2}^{m}\mapsto\mathbb{F}_{2}^{p} is a practical OWF. Alternatively this condition is same as, given a pair (P,C)(P,C) such that C=E(K,P)C=E(K,P) for some KK it is practically infeasible to find any bit of KK.

The Cryptanalysis problem in its general sense is usually understood as recovery of KK given (P,C)(P,C) pair of blocks. Such a problem is practically justified because same key KK is used in encryption of many plaintext blocks PP. Some of these blocks are known a-priori. Hence if a likely block PP is fixed the problem is to compute KK given C=E(K,P)C=E(K,P). Hence this is a local inversion problem of F(X)=E(X,P)F(X)=E(X,P) when n=m=pn=m=p which we shall address here.

5.1.1 Algorithm for cryptanalysis

The theory of local inversion developed in previous sections leads to Algorithm 3 for cryptanalysis of block ciphers of above form with n=m=pn=m=p.

Algorithm 4 Cryptanalysis of block ciphers C=E(K,P)C=E(K,P)
1:procedure BlockcipherCryptanalysis(C=E(K,P)C=E(K,P))
2:     Input: The algorithm EE and one pair (P,C)(P,C).
3:     Output: All solutions KK such that C=E(K,P)C=E(K,P).
4:     Offline Computation:
5:     Compute the set Π^\hat{\Pi} of all possible periods of closed orbits of the map F(X)=E(X,P)F(X)=E(X,P).
6:     Offline Computation:
7:     Compute the set GOE of the map FF.
8:     Online Computation:
9:     Use Algorithm 1 to find the minimal polynomial of the sequence S(F,C)S(F,C) and one solution if the sequence turns out periodic.
10:     Online Computation:
11:     Find all other solutions using the Algorithm 2.
12:end procedure

The algorithm 3 shows that once the offline computation of periods of closed orbits and GOE of F(X)=E(X,P)F(X)=E(X,P) is carried out apriori, the online computation of all KK for a given CC can be achieved only by forward iterative action by FF which is computationally very efficient.

5.2 Cryptanalysis of stream ciphers

Stream ciphers come with an iteration map (a dynamical system) with an output function. A general model of such an algorithm is

x(k+1)=F(x(k))w(k)=f(x(k))\begin{array}[]{rcl}x(k+1)&=&F(x(k))\\ w(k)&=&f(x(k))\end{array} (20)

k=0,1,2,k=0,1,2,\dots. The initial condition x(0)=(K,IV)x(0)=(K,IV) where KK is symmetric key. The output stream is w(k)w(k) is used for encryption of the plaintext stream of bits p(k)p(k) as

c(k)=p(k)w(k)c(k)=p(k)\oplus w(k) (21)

Hence w(k)w(k) is called keystream. When some of the bits p(k)p(k) of plaintext at instances kk are known, then the keystream bits w(k)w(k) are also known.

5.2.1 Cryptanalysis problems

Cryptanalysis of the stream cipher (20), (21) consists of two problems

  1. 1.

    Problem 1. (Internal state recovery). Given a partial key stream w(k)w(k) over some interval k0,k0+1,,k0+tk_{0},k_{0}+1,\ldots,k_{0}+t, find all possible internal states x(k0)x(k_{0}).

  2. 2.

    Problem 2. (Key recovery from internal state). Given an internal state x(k0)x(k_{0}) at some k0k_{0} find all the initial states x(0)x(0). This leads to key recovery by matching the known IV in the x(0)x(0).

We show how each of these can be formulated as local inversion problems of maps.

5.2.2 Internal state recovery

Let FF^{*} denote the dual linear map on the space of functions VV on 𝔽2n\mathbb{F}_{2}^{n} for the map FF. For a keystream w(k0),,w(k0+n1)w(k_{0}),\ldots,w(k_{0}+n-1), of length nn, the internal state x(k0)x(k_{0}) is related by the equations

w(k0+j)=(F)jf(x(k0))w(k_{0}+j)=(F^{*})^{j}f(x(k_{0})) (22)

Hence when all the nn samples of w(k0+j)w(k_{0}+j) for j=0,,(n1)j=0,\ldots,(n-1) denoted as w^(k0)\hat{w}(k_{0}) are given the equation (22) defines the map

F^(x(k0))=[f,Ff,,(F)(n1)f]T(x(k0))\hat{F}(x(k_{0}))=[f,F^{*}f,\ldots,(F^{*})^{(n-1)}f]^{T}(x(k_{0})) (23)

Whose local inversion at w^(k0)\hat{w}(k_{0}) gives solutions of internal states. Due to the special structure of the map F^\hat{F} the evaluation of the sequence S(F^,w^(k0))S(\hat{F},\hat{w}(k_{0})) can be carried out by repeated forward action of the stream cipher map FF itself. Hence online computation by algorithms 1 and 2 is as easy as the stream cipher operation itself.

5.2.3 Computation of set of possible periods of iteration of F^\hat{F}

For local inversion of the map F^\hat{F} it is thus necessary to examine the computation of the set of all possible periods of iterations of F^\hat{F}. This map F^\hat{F} is same as given in (23) acting on any state xx in 𝔽2n\mathbb{F}_{2}^{n}. The definition of the dual map F^\hat{F}^{*} is then

F^(χ1)=fF^(χ2)=(F)fF^(χn)=(F)(n1)f\begin{array}[]{lcl}\hat{F}^{*}(\chi_{1})&=&f\\ \hat{F}^{*}(\chi_{2})&=&(F^{*})f\\ \vdots&&\vdots\\ \hat{F}^{*}(\chi_{n})&=&(F^{*})^{(n-1)}f\end{array} (24)

Alternatively the map F^:𝔽2n𝔽2n\hat{F}:\mathbb{F}_{2}^{n}\mapsto\mathbb{F}_{2}^{n} is defined as

F^=[f(x),(Ff)(x),,(Ff)(n1)(x)]T\hat{F}=[f(x),(F^{*}f)(x),\ldots,(F^{*}f)^{(n-1)}(x)]^{T} (25)

Hence it follows that for any function ϕ(x1,,xn)\phi(x_{1},\ldots,x_{n})

F^ϕ=ϕ(f,Ff,,(F)(n1)f)\hat{F}^{*}\phi=\phi(f,F^{*}f,\ldots,(F^{*})^{(n-1)}f) (26)
Definition 1.

A stream cipher (20) denoted as system (F,f)(F,f) is said to be observable if F^\hat{F} defined in (25) is a permutation of 𝔽2n\mathbb{F}_{2}^{n}.

Proposition 4.

The stream cipher defined by the system (F,f)(F,f) is observable iff all co-ordinate functions belong to the space of functions

S(F,f)=span{f,Ff,(F)2f,,(F)(n1)f}S(F,f)=\mbox{span}\;\{f,F^{*}f,(F^{*})^{2}f,\ldots,(F^{*})^{(n-1)}f\} (27)
Proof.

Let the stream cipher (F,f)(F,f) be observable which by definition implies that F^\hat{F} is a permutation of 𝔽2n\mathbb{F}_{2}^{n}. Let G^\hat{G} be the inverse of F^\hat{F} and let G^\hat{G}^{*} denote its dual linear map on functions as defined in (26). By definition of inverse it follows that

G^F^=Id𝔽2nF^G^=IdV\hat{G}\circ\hat{F}=Id_{\mathbb{F}_{2}^{n}}\Leftrightarrow\hat{F}^{*}\hat{G}^{*}=Id_{V}

By the expression of F^\hat{F}^{*} in (24) it follows that

χi=G^(F)(i1)f\chi_{i}=\hat{G}^{*}(F^{*})^{(i-1)}f

for all i=1,,ni=1,\ldots,n. Hence all co-ordinate functions belong to the space of functions S(F,f)S(F,f).

Conversely, if all co-ordinate functions χi\chi_{i} belong to S(F,f)S(F,f), then the map F^\hat{F} is surjective on 𝔽2n\mathbb{F}_{2}^{n} hence for an output stream w(k0+j)w(k_{0}+j) of length nn-there is a unique x=x(k0)x=x(k_{0}) such that equations (22) hold. This implies observability of (F,f)(F,f). ∎

We thus get the following observation about the set of all possible periods of closed orbits of iterations of the map F^\hat{F}.

Theorem 5.

If the stream cipher system (F,f)(F,f) is observable, then

  1. 1.

    S(F,f)S(F,f) is the smallest F^\hat{F}^{*}-invariant subspace which contains all co-ordinate functions as well as the function ff.

  2. 2.

    All periods of closed orbits of iterations of F^\hat{F} are contained in the periods of closed orbits of iterations of the linear map

    F^1=F^|S(F,f)\hat{F}_{1}=\hat{F}^{*}|S(F,f)

    whose matrix representation in a basis of S(F,f)S(F,f) is denoted KK. Hence all possible periods of closed orbits are contained in Π^\hat{\Pi} the set of all periods of closed orbits of KK

  3. 3.

    Every output stream w(k)w(k) of length nn has a unique solution to the internal state.

Proof.

Let a function gg be in S(F,f)S(F,f). Then by definition of S(F,f)S(F,f) in (27), gg has an expression

g=j=0n1αj(F)jfg=\sum_{j=0}^{n-1}\alpha_{j}(F^{*})^{j}f

for some constants αj\alpha_{j} in 𝔽2\mathbb{F}_{2}. Now F^g\hat{F}^{*}g is

g(F^χ1,,F^χn)g(\hat{F}\chi_{1},\ldots,\hat{F}\chi_{n})

Hence using expressions (24) and expression of gg itself as linear combination of generators of S(F,f)S(F,f) it follows that F^g\hat{F}^{*}g belongs S(F,f)S(F,f). Which proves that S(F,f)S(F,f) is F^\hat{F}^{*}-invariant. It is smallest such space being cyclically generated and contains both ff and all co-ordinate functions.

Being a permutation, all trajectories of iteration of F^\hat{F} are closed orbits. Let dimS(F,f)=N\dim S(F,f)=N then KK is an N×NN\times N matrix and we can consider trajectories of iteration of KK in 𝔽2N\mathbb{F}_{2}^{N}. From Proposition 2 it follows that KK is nonsingular hence trajectories of iteration of KK are also closed orbits. From Theorem 2 it follows that the set of all possible periods of orbits of F^\hat{F} are contained in the set of periods Π^\hat{\Pi} of closed orbits of KK.

Unique internal state corresponds to an output stream of length nn since F^\hat{F} is a permutation. ∎

The offline algorithm for computation of all possible periods of F^\hat{F} follows from above theorem. We can thus state the solution of Problem 1 of cryptanalysis of stream ciphers as in Algorithm 4 below. Assume that (F,f)(F,f) is observable.

Algorithm 5 Cryptanalysis of stream ciphers (F,f)(F,f)
1:procedure Streamciphercryptanalysis(w(k0+k),k=0,,nw(k_{0}+k),k=0,\ldots,n)
2:     Input: The algorithm (F,f)(F,f) and sequence w^\hat{w} of length nn.
3:     Output: Unique internal state x(k0)x(k_{0}).
4:     Offline Computation:
5:     Compute the set Π^\hat{\Pi} of all possible periods of closed orbits of the map F^\hat{F} as the set Π^\hat{\Pi} of periods of closed orbits of the linear map KK.
6:     Online Computation:
7:     Search for the minimal polynomial of the sequence S(F^,w^)S(\hat{F},\hat{w}). Verify that the order of the polynomial belongs to Π^\hat{\Pi}.
8:     Find the unique solution x(k0)x(k_{0}) using formula in equation (10)
x(k0)=(1/α0)[F^(m1)(w^)+i=1(m1)αiF^(i1)(w^)]x(k_{0})=(1/\alpha_{0})[\hat{F}^{(m-1)}(\hat{w})+\sum_{i=1}^{(m-1)}\alpha_{i}\hat{F}^{(i-1)}(\hat{w})]
9:     The computation of F^(k)(w)\hat{F}^{(k)}(w) is defined by single step F^(w)\hat{F}(w) as
F^(w)=[f(w),f(F(w)),,f(F(n1)(w))]T\hat{F}(w)=[f(w),f(F(w)),\ldots,f(F^{(n-1)}(w))]^{T}
10:end procedure

Note that as (F,f)(F,f) is assumed observable the map F^\hat{F} is a permutation. Hence the GOE is empty. The online computation only involves forward computation by the map F^\hat{F} which is in turn obtained via forward computation of the stream cipher (F,f)(F,f) which is very efficiently possible. The expression of x(k0)x(k_{0}) can also be alternatively obtained by linear representation of the inverse map G^\hat{G} computed from F^1\hat{F}_{1} as shown in [7]. Yet another approach to recovering the internal state using observer theory is announced in [8].

5.2.4 Case of unobservable (F,f)(F,f)

In the general case of the stream cipher system (F,f)(F,f), the map F^\hat{F} is not a permutation. Hence local inversion of the equation

F^(x)=w^\hat{F}(x)=\hat{w} (28)

to recover all internal states xx requires computation of the GOE of F^\hat{F} in addition to the period of S(F^,w^)S(\hat{F},\hat{w}). Although this additional requirement (in offline) makes the computation of all internal states more complex in the unobservable case, this approach of computing one solution in a periodic orbit of S(F^,w^)S(\hat{F},\hat{w}) online by Algorithm 1 and all other solutions using the chains starting from GOE by Algorithm 2 is expected to be far faster than direct solution of the Boolean system (28). Hence at the cost of doing an offline computation using the Boolean solver for GOE the online computation is made much effcient.

5.2.5 Key recovery from internal state: solution to Problem 2

This problem has the fastest solution in the case when the map FF of the system is a permutation. Suppose FF is a permutation. Then by locating the inverse of the internal state x(k0)x(k_{0}) in the periodic orbit S(F,x(k0))S(F,x(k_{0})) the unique inverse can be found by repeated forward computation of FF. Repeating this process till one gets x(0)x(0) recovers the initial condition. Hence the offline computation involves only the computation of the set of all periods of closed orbits of iteration of FF by linear representation of FF.

When FF is not a permutation, an expression of x(k0)x(k_{0}) when k0k_{0} is a-priori known, can be obtained by offline computation as

F(k0)(x0)=x(k0)F^{(k_{0})}(x_{0})=x(k_{0})

This is again a local inversion problem of the map F(k0)F^{(k_{0})}. This problem can be solved by repeated forward computations on x(k0)x(k_{0}) and the GOE of the map as shown in Algorithms 1 and 2. Hence the offline computation consists of finding the linear representation of Fk0F^{k_{0}} and set of all periods of closed orbits of its iteration. By linear representation of FF, as the restriction of the dual linear map FF^{*} on the FF^{*}-invariant subspace WW, let KK denotes the matrix representation. Then the linear representation of F(k0)F^{(k_{0})} is obtained as the matrix Kk0K^{k_{0}}. Unfortunately computation of GOE does not allow such a simplification in terms of KK.

Appendix

We show here how the checking of the condition FN(y)=yF^{N}(y)=y is efficiently feasible in Algorithm 3. Consider the map FF in 𝔽2n\mathbb{F}_{2}^{n} and assume that an evaluation F(x)F(x) at any point xx is efficiently possible. We have following rules for composition of FF with itself (FF)(x)=F(F(x))(F\circ F)(x)=F(F(x)) for non-negative numbers a,ba,b.

F(a)(x)(FF)(x),atimes. By definitionF(a+b)(x)=(F(a)F(b))(x)F(ab)(x)=(F(a)F(a))(x),btimes.\begin{array}[]{lcl}F^{(a)}(x)&\triangleq&(F\circ\ldots\circ F)(x),a\;\mbox{times. By definition}\\ F^{(a+b)}(x)&=&(F^{(a)}\circ F^{(b)})(x)\\ F^{(ab)}(x)&=&(F^{(a)}\circ\ldots\circ F^{(a)})(x),b\;\mbox{times.}\end{array}

From these it follows that for the repeated squaring under composition we have

F(2i)(x)=(F(2(i1))F(2(i1)))(x)F^{(2^{i})}(x)=(F^{(2^{(i-1)})}\circ F^{(2^{(i-1)})})(x)

Hence using this recursive rule F(2i)(x)F^{(2^{i})}(x) can be computed in ii compositions. Now to compute F(N)(x)F^{(N)}(x) for an exponential NN, we can write binary expansion

N=n0+n12+n222++ni2(i1)N=n_{0}+n_{1}*2+n_{2}*2^{2}+\ldots+n_{i}*2^{(i-1)}

for NN of logN=i\log N=i. Then by above rules of composition,

FN(x)=F(n0)F(n12)F(ni)2(i1)(x)F^{N}(x)=F^{(n_{0})}\circ F^{(n_{1}*2)}\circ\ldots\circ F^{(n_{i})*2^{(i-1)}}(x)

These are ii compositions and evaluations of functions. But each composition above can be achieved in at most ii compositions and evaluations. Since basic operation of evaluation F(x)F(x) is efficiently feasible all of the above individual evaluations, the computation of FN(x)F^{N}(x) is feasible in polynomial number of evaluations in logN\log N.

6 Conclusions

A complete algorithm is constructed for local inversion of a map F:𝔽2n𝔽2nF:\mathbb{F}_{2}^{n}\mapsto\mathbb{F}_{2}^{n} at yy in 𝔽2n\mathbb{F}_{2}^{n} which is equivalent to an algorithm for computation of all solutions xx of the equation F(X)=yF(X)=y over 𝔽2n\mathbb{F}_{2}^{n}. The algorithm is constructed in two parts one which depends only on FF called Offline computation and another which depends on yy and a repeated forward action of FF called online computation. Offline computation consists of computation of two sets associated with FF, the set of all possible periods of closed orbits of iterations of FF and the GOE of FF. The set of closed orbits of the a linear representation of FF is shown to contain all possible periods of closed orbits of FF. It is shown that if there exists a solution in a periodic orbit S(F,y)S(F,y) then this solution is unique in any periodic orbit and is efficiently obtained by forward computation by FF once the minimal polynomial of the orbit is computed. Finally other solutions of the inversion lying on chains are discovered by computing the chains by the forward map FF starting from the points in GOE. These computations are inherently parallel for each point in GOE. The most important practical impact of this paper for Cryptanalysis is that, one solution of the inverse is feasible efficiently for an online data when the linear complexity of S(F,y)S(F,y) is small enough to facilitate practically feasible computation even if data of offline computation is not available. Offline computation is required to compute all other solutions. Hence any encryption algorithm in order to be secure must have high linear complexity of all of its periodic orbits. Since the offline computation can be efficiently done by parallel computation, an estimation of complete security of cipher algorithms by inversion is practically feasible and can be carried out offline by large scale parallel computation.

Acknowledgements

Author is thankful to Shashank Sule for his suggestions which led him to the investigation of the local inversion problem. He is also thankful to Ramachandran for pointing out important omissions in the first draft of the paper.

References

  • [1] Arthur Gill. Linear Sequential Circuits, Analysis, Synthesis and Applications. McGraw-Hill Book Company, New York, 1966.
  • [2] Martin Hellman. A cryptanalytic time-memory trade-off. IEEE Trans. Information Theory, 26(4), pp.401-406, 1980.
  • [3] J. Hong and P. Sarkar. New Applications of Time Memory Data Tradeoff. B. Roy (Ed) ASIACRYPT, 2005. LNCS 3788, pp.353-372.
  • [4] Howard M. Hays. Distributed Time Memory Tradeoff Attacks on Ciphers. http://eprint.iacr.org/2018/123.
  • [5] S. Gangopadhyay. The Time-memory Trade-off Attack. ACM Winter School 2019 on Cybersecurity, December 2019. National Institute of Science Education and Research, Bhubaneswar.
  • [6] Ramamchanran Anantharaman and Virendra Sule. Koopman operator approach for computing structure of solutions and Observability of non-linear dynamical systems over finite fields. Mathematics of Control, Signals and Systems, 2021. DOI 10.1007/s00498-021-00286-y
  • [7] Ramachandran A. and Virendra Sule. On computation of the inverse of a polynomial map over finite fields using the reduced Koopman dual linear map. arXiv.org/cs.SY/2010.14601.
  • [8] Ramachandra A. and Virendra Sule. Observaility attack on Stream Generators. eprint.iacr.org/2021/126.
  • [9] Virendra Sule. An implicant based, parallel, all solution solver for Boolean satisfiability. arXiv.org/1611.09590v3, Feb 6, 2017.
  • [10] A. Cafure, G. Matera and A. Waissbein. Inverting bijective polynomial maps over finite fields. IEEE Information Theory Workshop - ITW ’06, Punta del Este, 2006.
  • [11] Nicolas T. Courtois, Gregory Bard, David Wagner. Algebraic and Slide Attacks on Keeloq. Proc. Fast Software Encryption 2008. LNCS 5086, pp.97-115.
  • [12] Yanbin Zheng, Qiang Wang and Wenhong Wei. On Inverses of Permutation Polynomials of SmallDegree Over Finite Fields. IEEE Transactions on Information Theory. vol. 66, pp.914-922, 2020.
  • [13] Gary Mullen, Daniel Panario (Ed.). Handbook of Finite Fields. Taylor and Francis, 2013.
  • [14] Lidl R. and Neiderreiter H. Finite Fields. Cambridge University Press, 1997.
  • [15] Rainer Ruppel. Linear Complexity and Random Sequences. F. Pichler (Ed), Advances in Cryptology-EUROCRYPT’85, LNCS 219, pp.167-188, Springer-Verlag, Berlin Heidelberg 1986.
  • [16] Alfred Menezes, Paul van Oorschot, and Scott Vanstone (Ed.). Handbook of Applied Cryptography. CRC Press, 1996.
  • [17] Joachim on zur Gathen. Modern Compuiter Algebra. Cambridge University Press, 2013.