This application claims priority from German Patent Application No.102004037814.2, which was filed on Aug. 4, 2004 and is incorporated herein by reference in its entirety.
1. Field of the Invention
The present invention relates to number generators and particularly to pseudo random number generators, which can for example be used as key generators.
2. Description of the Related Art
A known random number generator is illustrated in
The linear feedback shift register shown in
The sequence of numbers obtained at the output 56 is referred to as pseudo random sequence of numbers, since the numbers seem to follow each other in a seemingly random way, but are overall periodical although the period is long. Additionally, the sequence of numbers can be repeated unambiguously and thus it has a pseudo random character when the initializing value fed to the memory elements by the initializing means 55 is known. Such shift registers are used, for example, as key stream generators to provide a stream of encoding/decoding keys depending on a specific initializing value (seed).
Such shift registers illustrated in
Additionally, there are irregularly clocked LFSRs. They show slightly increased hardware costs with a mostly lower period. The linear complexity, however, can be significantly higher. A disadvantage of such irregularly clocked devices, however, is the fact that due to the irregular clocking, in principle, the output sequence can be inferred by measuring the current in an SPA (SPA =simple power analysis). By using the shift register devices as parts of key generators, which generate data to be kept secret inherently, that is key data, it is of crucial importance for them to be secure against any type of cryptographical attacks.
On the other hand, in such devices, there is the requirement, particularly when they are to be accommodated on chip cards, that the hardware costs have to be low. In other words, the chip area occupied by such devices has to be as small as possible. This is due to the fact that in semiconductor manufacturing the chip area of a whole device, in the end, determines the price and thus the profit margin of the chip manufacturer. Further, particular with chip cards, a specification is such that a customer determines the maximum area of a processor chip in square millimeters, whereon a variety of functionalities have to be accommodated. Thus, it is up to the circuit manufacturer to divide this valuable area between the individual components. With regard to cryptographic algorithms becoming more and more complex, efforts of the chip manufacturer are directed to the chip having the largest amount of memory possible to be able to calculate even algorithms, which are working memory intense, in an acceptable time. Thus, the chip area for key generators and other such components has to be kept as small as possible in order to be able to accommodate a greater amount of memory on the given chip area.
Thus, it is the general requirement for key generators and devices for generating a pseudo random sequence of numbers, respectively, to be secure on the one hand and to require as little space as possible on the other hand, which means to incur the lowest possible hardware costs.
Alternative embodiments for more complex random number generators are shown exemplarily in
In the not yet published German patent application with the official document number 102004013481.2-42, filed Mar. 18th, 2004 with the German Patent and Trademark Office, a random number generator is described, where a shift register is provided with a nonlinear feedforward logic. This means that different cells (flip flops) of the underlying shift register are provided with outputs. The outputs of these cells form again the input signals for a nonlinear function. The output signal of this function will then be used as key sequence.
If a linear shift register LFSR is used as underlying shift register, the security of these key generators is not ideal. Attacks on systems, which are based on linear shift registers, have been discovered. These attacks are summarized under the name XL algorithm. XL stands for extended linearization. XL designates a heuristic method for efficiently solving heavily overdefined algebraic equation systems. Overdefined means that there are more equations than unknown variables.
These attacks are illustrated in Shamir, Patarin, Courtois, Klimov: “Efficient Algorithms for Solving Overdefined Systems of Multivariate Polynomial Equations”, Advances in Cryptology EUROCRYPT 2000 (B. Preneel, ed.), Lecture Notes in Computer Science, vol. 1807, pp. 392-407, Springer-Verlag, 2000.
A further important paper is: N. Courtois and W. Meier: Algebraic attacks on stream ciphers with linear feedback, Advances in Cryptology, EUROCRYPT 2003 (E. Biham, ed.), Lecture Notes in Computer Science, vol. 2656, pp. 345-359, Springer-Verlag, 2003.
Thus, linear shift registers should not longer be used for applications requiring a high degree of security.
It is an object of the present invention to provide an improved concept for generating random numbers, which is characterized, on the one hand, by security, and, on the other hand, by efficiency.
In accordance with a first aspect, the present invention provides a device for generating a sequence of numbers, having: a first shift register with a nonlinear feedback, a first number of memory cells and a first output coupled to the first number of memory cells by a first coupling means; a second shift register with a nonlinear feedback, a second number of memory cells and a second output coupled to the second number of memory cells by a second coupling means; and a combination means for combining a first data sequence at the first output and a second data sequence at the second output to obtain the sequence of numbers.
In accordance with a second aspect, the present invention provides a method for generating a sequence of numbers, having the steps of: generating a first data sequence with a first shift register with a nonlinear feedback, a first number of memory cells and a first output, which is coupled to the first number of memory cells by a first coupling means; generating a second data sequence with a second shift register with a nonlinear feedback, a second number of memory cells and a second output, which is coupled to the second number of memory cells by a second coupling means; and combining the first data sequence at the first output and the second data sequence at the second output to obtain the sequence of numbers.
In accordance with a third aspect, the present invention provides a computer program with a program code for performing the method for generating a sequence of numbers, having the steps of: generating a first data sequence with a first shift register with a nonlinear feedback, a first number of memory cells and a first output, which is coupled to the first number of memory cells by a first coupling means; generating a second data sequence with a second shift register with a nonlinear feedback, a second number of memory cells and a second output, which is coupled to the second number of memory cells by a second coupling means; and combining the first data sequence at the first output and the second data sequence at the second output to obtain the sequence of numbers, when the computer program runs on a computer.
These and other objects and features of the present invention will become clear from the following description taken in conjunction with the accompanying drawings, in which:
a is an embodiment of a shift register with nonlinear feedback;
b is an alternative embodiment of a shift register with nonlinear feedback;
a is another shift register with nonlinear feedback;
b is another shift register with nonlinear feedback;
The present invention is based on the knowledge that optimum security on the one hand and high efficiency on the other hand can be achieved when at least two shift registers with nonlinear feedback are used, wherein every shift register with nonlinear feedback has a linear coupling means, which means a linear feedforward, to generate an output data sequence from a shift register with nonlinear feedback, wherein the output data sequences of all shift registers with nonlinear feedback is then combined in a combination means to finally obtain the sequence of numbers.
The usage of several (smaller) shift registers with nonlinear feedback instead of a single (large) shift register with nonlinear feedback allows to save chip area, since the periodicity of the output sequence of two smaller shift registers is equal to the product of the periodicity of the individual shift registers with nonlinear feedback, so that despite using two shift registers with a smaller number of memory cells, a periodicity of the output sequence can be obtained, wherein for achieving the same with a single shift register with nonlinear feedback significantly more memory cells would be required than the sum of memory cells of the individual registers. Thus, the inventive concept is chip area efficient and particularly applicable in a flexible way, since the circuit designer does not require a large spot of the chip to accommodate a large individual shift register. Instead, several small spots on the chip are sufficient, where the several small individual shift registers are disposed, which can finally be combined.
Thus, the concept is more secure in that nonlinear shift registers are used, against which the XL attacks will fail. Above that, it is significantly more difficult for an attacker to detect several small shift registers as a single large shift register by grinding open and inspecting a chip, since the regular structures in a single large shift register are much clearly visible than with several small shift registers, which are preferably not disposed immediately adjacent on the chip, but at different locations on the chip.
In a preferred embodiment of the present invention, individual shift registers are used, which generate periods equal 2N−1, wherein N is the number of memory cells in the shift register. In the case of a finite body, which not only has the numbers 0 and 1, but an arbitrary number q, the period of the preferred shift registers is qN−1. Even slightly smaller periods are acceptable. The maximum achievable periods 2N are not so well suited for the combination and mathematical predictability as slightly shorter periods 2N−1.
In preferred embodiments, the linear coupling means, which means the feedforward means, is effective to multiply the outputs of several individual memory cells in the shift registers with a respective element of the finite body and then to combine them in a linear way, for example by XOR gates or XNOR gates, to provide the output data sequence of the corresponding shift register, which is again fed into the combination means together with the other output data sequences of the other shift registers, to generate the output sequence of numbers from the finite body by an arbitrary way of combining, preferably by Boolean combination elements, such as elementary gates.
The mathematical predictability of the sequence of numbers obtained at the output 14 is best when the shift registers have such a nonlinear feedback characteristic 101, that the periodicity of an output sequence of the memory cell SZi is 2N−1. This again leads to the first data sequence generated by the linear coupling means 103 having the same periodicity.
In the embodiment shown in
It should be noted that the switches 103b are provided merely preferably. They are to symbolize that the shift register shown in
Above that, it is preferred to feed only a number of low-order memory cells after their weighing by the element 103c to the XOR gate, such as the output sequences of the memory cells x0, x1, x2 in
It has been found out that such a sequence, where part of the memory cells is combined by the coupling means, behaves more like a physical random number source than when a data sequence generated at the output of the linear coupling means, which is based on the combination of all memory cells x0 to xN-1.
This will be illustrated below with regard to a shift register with, e.g., 10 memory cells. Further, it will be assumed that the output sequences of the 5 low-order memory cells are combined as x0, . . . , x4 by the XOR gate 103a of
Thereby it is achieved that a statistical equidistribution of all tuples occurs in the output data sequence, which have a length equal to the number of combined low-order memory cells. This means that the tuples for k=1, which means all zeros and ones, appear with the same frequency in the first data sequence. Above that, all tuples with k=2, which means (0, 0), (0, 1), (1, 0) and (1, 1) occur with the same frequency in the first data sequence at the output 104. This applies also for the tuples with k=3, k=4 and k=5. However, this does not apply for the tuples with k=6, k=7, k=8, k=9 and k=10. Here, deviations exist within the statistics, how often the respective k tuples appear in the first data sequence at the output 104 of the shift register 10 in
The deliberate introduction of deviations from the ideal statistic for larger tuples ensures that an attacker, when viewing the sequence of numbers, does not immediately see that such a sequence of numbers is provided by a pseudo random number generator and not by a real random number generator, such as a noise source. As has been found out, a real physical random number generator does not have the ideal statistic, but always a deviation from the ideal statistic. Only when the output sequence of a physical random number generator is viewed for a very long time, the output sequence would be of an ideal statistic. However, this only applies when the conditions of the random number generator have not changed, which means e.g. temperature, current, etc. Since the conditions of physical random number generators will most likely change during the viewing time, which means it cannot be guaranteed that a noise source is operated for an indefinite amount of time with the same temperature and with the same current, it can be seen that a deviation from the ideal statistic, which is within a limited (small) frame, does not make the generated sequence of numbers look like a synthetical unreal random number sequence, but like a real random number sequence generated by an actual noise generator.
a shows a feedback function F(x) for N=11 memory cells in the feedforward coupling means, wherein F(x) is marked in
An alternative feedback characteristic G(x) is shown in
In the shift register shown in
a and 5b show a further possibility for a 4-cell shift register with two different feedback means F(x) and G(x), which can be implemented based on a change-over switch 203, as shown in
As has already been explained, it is preferred that all shift registers in
A general n-stage (or n-cell) feedback shift register over the base body GF(2)={0,1} will be considered. The shift register consists of n memory cells (flip flops) D0, D1, . . . , Dn-1 and the (electronical) realization of a feedback function F(x0, x1, . . . , xn-1). The feedback function associates an unambiguous value of GF(2), which means the value 0 or 1, to every n tuple consisting of n bits. In mathematical terminology, F is a function with a definition domain GF(2)n and a target domain GF(2).
The shift register is controlled by an external clock. The content of the memory cell Dj is shifted to the left adjacent cell Dj-1 with each clock rate. 1≦j≦n−1. The content of the memory cell D0 is output. If the contents of the memory cells D0, D1, . . . , Dn-2, Dn-1 at a time t are given by
st, st+1 . . . st+n-2, st+n-1
then, one clock rate later, which means at a time t+1, the memory cells will contain the bits
st+1, st+2, . . . , st+n-1, st+n,
wherein the value st+n that has entered the cell Dn-1 is given by
st+n=F(st, st+1, st+n-1).
The n-tuple (st, st+1, . . . , st+n-1) describes the state of the shift register at the time t. The n tuple (s0, s1, . . . , sn-1) is called the initial state. FSR(F) is used as abbreviation for the general feedback shift register having a feedback function F (FSR stands for feedback shift register).
The shift register outputs one bit with each clock of the external clock. In that way, the shift register can produce a periodic bit sequence s0, s1, s2, . . . , a so-called shift register sequence. Let s0, s1, . . . , sn-1 be the initial values of the shift register sequence. The feedback function F(x0, x1, . . . , xn-1) and the initial values s0, s1, . . . , sn-1 completely determine the shift register sequence. Since there are only 2n different states for the shift register, the period of the shift register sequence s0, s1, s2, . . . is at most 2n.
A general feedback shift register FSR(F) will be called homogeneous if its feedback function F is homogenous, i.e. if F(0, 0, . . . , 0)=0 applies. A homogeneous shift register put in the initial state s0=s1= . . . =sn-1=0 will produce the null sequence. It follows that the period of the output sequence of an n stage homogenous shift register can be at most 2n−1. If the period takes on the maximum value 2n−1, the shift register sequence is called an M sequence and the shift register is maximum. It is an important task to find maximum shift registers.
Two special cases of the general feedback shift register FSR(F) are of particular interest. In one case, the feedback function F has the form:
wherein the coefficients aij are either 0 or 1. In that case, this is called a square feedback function as an example for a nonlinear feedback function and the term square applies also to the shift register.
The other special case occurs when the feedback function F is linear. Then F has the following form:
F(x0, x1, . . . , xn1)=a0x0+a1x1+ . . . +an-1xn-1,
wherein the occurring coefficients ai are again equal to 0 or 1, which means elements of GF(2). In this case, this is called a linear or linear feedback shift register and the abbreviation LFSR (linear feedback shift register) is used therefore. It is to be noted that both the linear feedback and the square feedback shift registers are homogenous.
An n-stage linear feedback shift register is usually characterized by a binary polynomial f(x) of the degree n in a variable x. This polynomial f is called the characteristic polynomial of the linear feedback shift register. The shift register is then written as LFSR(f).
The feedback function F(x0, x1, . . . , xn-1) of a linear feedback shift register is a polynomial in n variables x0, x1, . . . , xn-1 and of the degree 1. In contrast, the characteristic polynomial f(x) of the same linear shift register is a polynomial with only one variable, namely the x, but of the degree n. It applies:
f(x)=xn+F(1, x, x2, . . . , xn-1)
Thus, the nonlinearity of the feedback function can be performed by relatively arbitrary forms of the feedback function F. Therefore, it will basically be sufficient to merely multiply the output signals of two memory cells Di and Di+1, which would result in a square shift register. Of course, more than two memory cell outputs can be multiplied or be subjected to any nonlinear function. In principle, however, a feedback can also be performed with only one output signal of a single memory cell, for example by merely feeding back the output signal of the memory cell D0, feeding the same into the function F(x0) and feeding the output signal of this function, e.g. into the memory cell Dn-1 on the input side. Such a nonlinear function with only a single value would, for example, be an inversion, which means a logic NOT function. However, the nonlinear function could also be any other function, for example a nonlinear association function or a cryptographic function.
As has already been explained, the inventive device for generating a long sequence of bits or in more general terms, of elements from a finite body, is advantageous in that it requires, on the one hand, only relatively low hardware cost and, on the other hand, generates sequences with favorable characteristics. Such favorable characteristics are a long period, a high linear complexity, good distribution characteristics, an ideal polynomial complexity (maximum or complexity). Thus, the inventive device for generating key sequences is also suitable for the usage in a stream cipher. Further, it can also be used as parameterizable pseudo random number generator (PRNG).
As has already been discussed, the inventive solution is based on nonlinear feedback shift registers (NLFSR). Therefore, preferably, such NLFSRs are used, which have a feedback function, which can be described by relatively sparsely occupied recursion formulas, which leads to an inexpensive realization in hardware by the low number of gates. Further, such shift registers with nonlinear feedback are preferred, whose output sequences have a long period. With regard to the sparsely occupied recursion formula it should be noted that such recursion formulas are preferred, where the states of less than half or equal to half of the memory cells are entered. Thus, in a shift register with about 10 memory cells, merely the respective output sequences of 5 memory cells or less than 5 memory cells would enter the nonlinear feedback function.
If an inventive nonlinear shift register has exactly N flip flops (as design of a memory cell), the output sequence can have a maximum period of 2N, when the binary case is considered, or qN in the general case of an underlying finite body of the order=amount q. Shift registers of this maximum possible period however, are only suboptimal for the present invention. It is preferred to use shift registers with nonlinear feedback, whose generated sequences are smaller than the maximum possible sequence, which means shift registers with nonlinear feedback generating sequences of the period 2N−1 and qN−1, respectively, wherein slightly smaller periods are still preferred, namely for example periods, which are longer or equal to 2N−1.
According to the invention, such a nonlinear shift register with N flip flops comprises N outputs. As shown with regard to
In other words, the nonlinear shift register is provided with a parameterizable linear feedforward function. The inventive number generator device consists of several shift registers with nonlinear feedback, whose length are preferably prime in pairs. This means that the greatest common divisor between the two numbers N, M of two shift registers 10, 20 (
The inventive concept, which means the inventive device, the inventive method and the inventive computer program have the following advantages:
The device is immune against attacks using the XL algorithm (see point 2).
The device is parameterizable: The occupancy of the cells of all occurring NLFSRs makes up the cryptographical key (or the seed in the context of a pseudo random number generation). The position of the switches of the outputs from the cells of the individual NLFSRs makes up the parameterizability.
It can be proved that the output sequences from the feedforward logic of such an NLFSR have generally the same long period and the same (high) linear complexity as the direct output sequence from the NLFSR.
It can also be proved that the output sequences from the feedforward logic have good statistical characteristics, provided that only about the first half of the cells of the NLFSR is output and fed to the linear feedforward logic. Then, the output sequences have the same amount of zeros and ones in the binary case. The pairs (0, 0) (0, 1), (1, 0) and (1, 1) also with the same frequency within one period. The same applies for all possible k tuples, as long as k is not higher than N/2. These ideal distribution characteristics apply also in the general case of a finite body of the order q in corresponding manner.
The output sequences from the feedforward logics have generally the ideal value of the maximum order complexity. When the NLFSR has exactly N cells, then the direct output sequence has the maximum order complexity N. By contrast, the output sequences from the feedforward function have generally the maximum order complexity N/2 (a real random sequence of the length 2N would also very likely have the maximum order complexity 2N).
Thus, preferably, the inventive number generators have specific nonlinear feedback shift registers with configurable feedforward logics, whose output sequences are then combined term by term with the help of a Boolean combination function to generate the final sequence. This sequence is then used for encrypting in the sense of Vigenere chiffre or serves as pseudo random number for other things than the encryption, namely for simulation purposes, etc.
As has already been discussed, the inventive device can generate sequences of elements from a finite body Fq. For the important specific case, q=2 applies, i.e. Fq=F2=GF(2). The elements of the finite body F2 are 0 or 1, which means bits in the binary case.
In the figures, the feedback functions are shown from FqN to Fq. This means that the feedback logic can be represented by arithmetic operations in the finite body Fq. Here, N is the number of memory cells of a shift register. N means also the length of the shift register. Every memory cell can store an element from Fq.
As has been explained, such nonlinear shift registers are used as a base, whose direct output sequences have the period qN−1, wherein N is the length of the shift register. Further, it is preferred that the lengths of the shift registers are prime in pairs. Further, a linear feedforward logic is preferred. If all switches are closed, the following applies:
V(x0, x1, . . . , xN-1)=c0x0+c1x1+ . . . +cN-1xN-1.
The coefficients c0, c1, . . . , cN-1 are elements from Fq. Depending on the circumstances, the inventive method for generating a sequence of numbers can be implemented in hardware or in software. The implementation can be effected on a digital memory media, particularly a disc or CD with electronically readable control signals, which can cooperate with a programmable computer system such that the method is performed. Thus, generally, the invention consists also of a computer program product with a program code stored on a machine readable carrier for performing the inventive method when the computer program product runs on a computer. In other words, the invention can thus be realized as computer program with a program code for performing the method when the computer program runs on a computer.
While this invention has been described in terms of several preferred embodiments, there are alterations, permutations, and equivalents which fall within the scope of this invention. It should also be noted that there are many alternative ways of implementing the methods and compositions of the present invention. It is therefore intended that the following appended claims be interpreted as including all such alterations, permutations, and equivalents as fall within the true spirit and scope of the present invention.
Number | Date | Country | Kind |
---|---|---|---|
10 2004 037 814.2 | Aug 2004 | DE | national |