# Patent

## Title
Method of encipherment by permutations of fixed-length sequences

## Abstract

A method of enciphering information constituted by a finite sequence {S1,S2, . . . ,SN} of N symbols (S1,S2, . . . ,SN) selected from an alphabet A. There are defined both a secret convention of p key symbols K1, . . . ,Kp selected form a second alphabet B, and a multivariate function M having m+1 variables (m<=N): M(Xi1, . . . ,Xim,Y) operating Am□B in A, {i1, . . . ,im} being m distinct indices in the range [1,N] and the function M being bijective relative to at least one (Xi1) of the m variables of A. A succession of X permutations are performed on the sequences {S1,S2, . . . ,SN} such that where {S1,S2, . . . ,SN} is the sequence prior to the jth permutation, the sequence after the jth permutation is {S2,S3, . . . ,SN,Zj}, where Zj is equal to M(Si1, . . . ,Sim,Kj) the enciphered information being constituted by the sequence {S′1,S′2, . . . ,S′N} obtained after the Xth permutation.

## Background
FIELD OF THE INVENTION
The present invention involves the field of processing information, and more particularly the field of enciphering information using symmetrical secret key cryptography, as opposed to asymmetrical public key cryptography. The present invention relates to a method of enciphering information constituted by a finite sequence of N symbols selected from an alphabet.
BACKGROUND OF THE INVENTION
It often happens that there is a need to encipher information constituted by a finite sequence of symbols belonging to a finite alphabet, and that it is desired that the enciphered information itself be represented in the same alphabet and be of the same length as the initial sequence in the clear, i.e., the original information to be enciphered. This need is felt, for example, in respect of telephone numbers, virtual prepaid card numbers, bank card numbers, or indeed alphanumeric license plate numbers. In the first three cases mentioned above, the alphabet is constituted by the digits 0 to 9, whereas in the last case it is constituted by upper and lower case letters and digits.
SUMMARY OF THE INVENTION
It is an object of the present invention to provide an enciphering method based on constructing enciphering functions that can be referred to as “overall permutations of fixed-length sequences over a finite set of symbols”, and to satisfy the above-specified need regardless of the particular finite set of symbols and regardless of the fixed length of the sequences.
Secret key cryptography involves designing and studying functions based on a secret convention that enables two parties sharing knowledge of the secret convention to perform the two operations referred to as “enciphering” and “deciphering”. This includes the following:

    
    
        for enciphering, transforming data D into data C; and
        for deciphering, transforming the above data C into the data D.
    
    


These operations are conditional on the following:

    
    
        the data C can be transformed into the data D only through knowledge of the secret convention; and
        knowledge of C and D, or of a large number of {C, D} pairs, does not enable the secret convention to be discovered.
    
    


Numerous known secret key enciphering algorithms are in existence, and many of them are standardized, such as DES, 3DES, ADES, IDEA, BLOWFISH, RC2, RC4, etc.
Most of those algorithms are used for enciphering binary sequences, independently of the semantic meaning of the bits, and they therefore require the information for enciphering to be transformed into a binary code. The resulting enciphered information is likewise represented by a binary sequence.
There exist several methods of enciphering that usually require enciphering to be applied to binary blocks of fixed size. The several methods for enciphering differ from each other by the way synchronization (i.e. the way the method for enciphering is run in terms of time schedule from the block in the clear to the enciphered block) is performed between a block in the clear and an enciphered block; for example: reinjecting an enciphered block to encipher the following blocks, dictionary of independently enciphered blocks, etc.
Nevertheless, those known enciphering techniques present various drawbacks:
a) When it is desired to encipher independent data, in small quantities, existing tools lead to the information being expanded, either to comply with the format for representing the enciphered information, or in order to make diversification keys (initialization vectors) available that are suitable for guaranteeing security of the encipherment. Thus, for example, enciphering a text made up of printable characters (ASCII characters in particular) yields a binary sequence, and it must be expanded in order to be able to represent the enciphered text in the form of printable characters.
b) With existing tools, the constraint of complying with the format of the information to be enciphered and with the format of the enciphered information leads to loss of the format of the data being enciphered in the clear. This applies in particular to enciphering numerical identifiers, which are generally representable by a serial number (e.g. a credit card number) that has the property of being smaller than some maximum value, and leads to an enciphered result that no longer has that property.
Thus, a technical problem to be solved by the subject matter of the present invention is to provide a method of enciphering information constituted by a finite sequence {S1,S2, . . . ,SN} of N symbols selected from an alphabet A, which method enables a sequence of fixed length to be enciphered while avoiding the above-mentioned drawbacks of the prior art.
According to the present invention, the solution to the technical problem posed above is that there are defined both a secret convention of p key symbols K1, . . . , Kp selected from a second alphabet B, and a multivariate function M having m+1 variables (m<=N): M(Xi1, . . . ,Xim,Y) operating Am×B in A, {i1, . . . . im} being m distinct indices in the range [1,N] and the function M being bijective relative to at least one (Xi1) of the m variables of A. The enciphering method performs a succession of X permutations on the sequences {S1,S2, . . . ,SN} such that where {S1,S2, . . . ,SN} is the sequence prior to the jth permutation, the sequence after the jth permutation is {S2,S3, . . . ,SN,Zj}, where Zj is equal to M(Si1, . . . ,Sim,Kj) the enciphered information being constituted by the sequence {S′1,S′2, . . . ,S′N} obtained after the Xth permutation.
In the text set forth below, the term “symbol” is used to mean an individual unit of information used to represent words, numbers, names, etc. Examples of symbols are: bits; bytes; printable characters; digits; etc.
Similarly, the term “alphabet” is used to mean a set of symbols sharing a common property, for example concerning format, size, etc., which together serve to represent a certain category of information. As alphabets, mention can be made of the 7-bit characters defined by ASCII code, the digits 0 to 9, and displayable characters.
A function is said to be “multivariate” when it takes a plurality of input arguments, which arguments may be of the same kind or of different kinds. Addition is an example of a multivariate function. In the context of the invention, the multivariate function M takes as its input m symbols Si1, . . . ,Sim and a value Kj of the key symbol of the secret convention K, and it outputs a symbol Zj belonging to the same alphabet A as the symbols Si: Zj=M(Si1, . . . ,Sim,Kj).
The multivariate function M is said to be “bijective” relative to one of its variables if, all other variables remaining fixed, the function restricted to this coordinate is bijective. In the description below, the case is considered where the function M(Xi1, . . . ,Xim,Y) is bijective relative to the first variable (Xi1).
In a particular implementation of the method of the invention in which the number m is equal to 3, the function M defined by Z=M(X1,X2,XN,Y) is calculated in the following steps;

U=t1(X1,XN)

V=t2(U,Y)

Z=t1(V,X2)

t1 and t2 being the functions associated with two Latin squares T1 and T2 of size equal to the cardinal number of the set A.

The term “Latin square” of size N designates a table T of N×N positions containing N distinct symbols (S1, . . . ,SN) of an alphabet A and such that each row and each column of the table contains each symbol once, and once only. An example of a Latin square of size 4 is given in FIG. 5.
By extension, and assuming that the symbols of the alphabet A are ordered, i.e. numbered 1 to N, a “Latin square” function t associated with the Latin square T is defined as follows: t(Si,Sj) is the symbol contained in the position situated at the intersection of the ith row and the jth column.
The multivariate function t defined in this way is bijective relative to each of its variables.
The “left inverse” T*l and the “right inverse” T*r of a Latin square and the corresponding associated functions t*l and t*r are defined by the following properties:

for all Y and X, t(t*l(X,Y),Y)=X; 

for all Y and X, t(X,t*r(X,Y),Y)=Y. 




BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a diagram showing the mechanism of a shift register.
FIG. 2 is a diagram showing the mechanism of a first implementation of the method in accordance with the invention.
FIG. 3 is a diagram showing the mechanism of a second implementation of the method in accordance with the invention.
FIG. 4 is a diagram showing the deciphering mechanism associated with the enciphering mechanism of FIG. 3.
FIG. 5 shows an example of a Latin square of size 4.



DETAILED DESCRIPTION OF THE DRAWINGS
FIG. 1 shows a shift register of length N made up of an ordered set of N positions containing N optionally distinct symbols of an alphabet A, namely S1,S2, . . . ,SN.
The register of FIG. 1 possesses a so-called “shift” mechanism which, starting with a new symbol, stores this new symbol in the last position and stores the symbol previously present in each position i in each respective position j−1. Consequently, the symbol S1 previously present in the first position is forgotten.
In the context of the invention, the N symbols constituting the information to be enciphered are initially disposed in the N positions of the shift register of FIG. 1.
In the method of the invention, there are defined both a secret convention K consisting in a sequence of e key symbols K1, . . . ,Kp selected from a second alphabet B with p preferably being sufficiently large, and also a multivariate function M having m+1 variables (m<=N): M(Xi1, . . . ,Xim,Y) operating Am×B in A, {i1, . . . ,im} being m distinct indices in the range [1,N].
In addition, the function M is taken to be bijective relative to its first variable Xi1.
In a general implementation of the enciphering method of the invention, as shown in FIG. 2, the number m is equal to N: ({i1, . . . ,im}={1, . . . ,N}).
The result of the Jth turn of the shift register is then written Zj=M(S1, . . . ,SN,Kj). If {S1,S2, . . . ,SN} is the state of the shift register prior to the Jth turn, then the state of the shift register after the Jth turn and before the J+1th turn becomes {S2,S3, . . . ,SN,Zj}.
The enciphering method performs X turns of the shift register where X is preferably greater than several times N. The state of the shift register before the first turn constitutes the information in the clear. The state of the shift register after the Xth turn constitutes the enciphered information.
In a variant of the method of the invention, the number m is taken to be less than N, e.g. 3, and the function M is defined by M(X1,X2,XN,Y) as shown in FIG. 3: {i1,i2,i3}={1,2,N}. The result Zj of the Jth turn of the shift register is given by Zj=M(S1,S2,SN,Kj).
By way of example, a particular implementation of this variant embodiment selects for the alphabet A the set of digits 0 to 9.
The length N of sequences {S1,S2, . . . ,SN} can take various values in the range about 6 to 16, e.g. N=14. Naturally any other value could be envisaged.
The shift register is thus of size N=14.
The secret convention K is constituted by a sequence of p=12 digits, e.g.: K1, . . . ,K12. If the number X of turns of the shift register is greater than p, then K13=K1, K14=K2, etc.
T1 and T2 are two Latin squares of size N=10 using the alphabet A, and t1 and t2 are the associated functions.
The function M takes as its arguments three of the positions of the shift register: the first position X1, the second position X2, and the last X14. Zj=M(S1,S2,SN,Kj) is calculated with a key symbol Kj selected from the secret convention K.
M(X1,X2,X14,Y)=Z is calculated by the following steps:

U=t1(X1,X14)

V=t2(U,Y)

Z=t1(V,X2)

After X=100 turns of the shift register, for example, the initial information in enciphered form is obtained which is written in the following text in the form of the sequence {S′1,S′2, . . . ,S′N}.
As shown in FIG. 4, the function for deciphering the enciphered information {S′1,S′2, . . . ,S′N} is constructed as follows:
On input, the shift register is loaded with the enciphered data in reverse order, symbol (S′N,S′N-1, . . . ,S′1)
The inverse function “M−1” of M relative to the first coordinate takes as its arguments three positions of the shift register: the first position X1, the second X2, and the last X14. Zj=M(S1,S2,SN,Kj) is calculated with a key symbol Kj, beginning with the symbol last used during enciphering and subsequently in decreasing order on the following turn Kj-1 is used.
M(X1,X2,X14,Y)=Z is calculated using the following steps:

V=t1*l(X1,X14)

U=t2*l(V,Y)

Z=t1*l(U,X2)

The register is then shifted in the same manner as for the enciphering function, the 14th position taking the value Zj.
100 turns are performed in this way on the shift register.
At the end of these 100 turns, the register contains the information in the clear {S1,S2, . . . ,SN}.
It will be understood that an advantage of this method is that the enciphering function and the deciphering function have the same scheme.

## Claims

1. A method of enciphering information constituted by a finite sequence {S1,S2, . . . ,SN} of N symbols {S1,S2, . . . ,SN} selected from an alphabet A, wherein there are defined both a secret convention (K) of p key symbols K1, . . . ,Kp selected from a second alphabet B, and a multivariate function M having m+1 variables (m<=N): M(Xi1, . . . ,Xim,Y) operating Am×B in A, {i1, . . . , im} being m distinct indices in the range [1 ,N] and the function M being bijective relative to at least one (Xi1) of the m variables of A, said enciphering method comprising:
initially placing the N symbols S1,S2, . . . ,SN) constituting the information to be enciphered in the N positions of a shift register, and then
performing a succession of X turns of the shift register implementing a succession of X permutations on the sequences {S1,S2, . . . ,SN} such that where {S1,S2, . . . ,SN} is the sequence prior to the jth permutation, the sequence after the jth permutation is {S2,S3, . . . ,SN,Zj}, where Zj is equal to M(Si1, . . . ,Sim,Kj), the enciphered information being constituted by the sequence {S′1,S′2, . . . ,S′N} contained in the shift register at the end of the Xth permutation resulting from the Xth turn of the shift registers,
wherein the number X of permutations is greater than several times the length N of the sequences {S1,S2, . . . ,SN},
wherein the number m is equal to 3, the function M being defined by M(X1,X2,XN,Y), and
wherein the function M(X1,X2,XN,Y) is calculated using the following steps:


U=t1(X1,XN)



V=t2(U,Y)



Z=t1(V,X2)



t1 and t2 being the functions associated with two Latin squares T1 and T2 of size equal to the number N.

2. A method of deciphering information enciphered using the enciphering method of claim 1, wherein the symbols (S′1 ,S′2, . . . ,S′N) of the sequence {S′1,S′2, . . . ,S′N} constituting the enciphered information are reverse symbol by symbol (S′N,S′N−1, . . . ,S′1), M(S1,S2,SN,Kj)=Zj is calculated using a key symbol Kj beginning with the last key symbol to be used during enciphering, and so on in decreasing order . . . Zj,Zj−1, . . . , with M(X1,X2,XN,Y)=Z being calculated using the following steps:


V=t1*□(X1,XN)



U=t2*□(V,Y)



Z=t1*□(U,X2)


the sequence obtained at the end of the Xth permutation reconstituting the information in the clear {S1,S2, . . . ,SN}.