Back in 1997, Israeli scientists Shimon Even and Ishay Mansour (Yishay Mansour) asked themselves the question:
how minimal can a strong block cipher have ? By minimality they meant the number of structural elements in the cipher scheme, and by persistence - any (formally correct) lower estimate of the complexity of the attacks on this cipher. As they say, under the cut - a description of the minimum (to this day) block cipher with provable strength.
Lyrical digression
Virtually all encryption standards used today are
not formally strong . No one gives, and cannot give any guarantee that there are no bookmarks, vulnerabilities or weaknesses. Just so far no one has invented (or, at least, has not published) any ways to crack these ciphers = ways to
significantly reduce the exponential complexity of a complete search. Opening up
virtually any cryptographic algorithm on which your security and privacy are based, be it symmetric, asymmetric encryption, or hashing, is reduced to solving
relatively complex problems (for example, to the problem of discrete logarithmization). Complicated because no one has yet offered
relatively simple solutions. Unless we learn to logarithm in a finite field or factorize numbers in polynomial time (or until we build a quantum computer more), DH and RSA will be considered stable, and only the number of bits in the key will grow in proportion to the power of personal computers.
And all because we still do not know how to get lower ratings. Friends, in mathematics (and especially in cryptography) there are not so many beautiful ideas and elegant solutions, and there are even less proven estimates from below. The cipher considered here, in my opinion, falls into the intersection: it is as simple as possible, and at the same time formally resistant.
')
I warn you at once that this publication is not a work of art for unprepared readers, although it does not contain anything more complicated than the Bayes conditional probability formula and elementary arithmetic of fractions.
The inexperienced reader will remain satisfied with the description of the design of the cipher , and a strict proof of its endurance is given here for professionals and true connoisseurs of mathematics.
Israeli scientists Shiman Even (Shimon Even) and Ishei Mansour (Yishay Mansour) in [EM97] proposed a way to build a block cipher with demonstrable persistence, based on the only randomly selected permutation from

.
Before I introduce you directly to this block cipher, let me indicate a list of the introduced symbols and basic definitions. However, you can always return to it, therefore, in the event that I managed to awaken in you a serious interest to see everything “here and now”, go directly to the description of the cipher.
Definitions and conventions Classical Even – Mansour scheme
Israeli scientists Shimon Even and Yishay Mansour in their work proposed a block cipher with provable cryptographic strength, for which only one substitution is required

which is randomly (or pseudo-randomly) selected from the set of all permutations

over open texts.
It is assumed that the selected substitution is not part of the key, and is available to any attacker in the form of a “black box”.
It is argued that, from the point of view of the attacker, the proposed cipher is almost indistinguishable from the ideal random cipher, and the probability of a successful opening of the system

) is polynomially small (the main result is
Theorem 2 ,
Corollary 2.1 of it, and
Theorem 3 ).
It is also argued that the use of a pseudo-random substitution instead of a truly random substitution does not change the shown cipher strength.
Description
Let be

and

- substitution selected from the set

of all substitutions over a set of open texts, and

- back to her.
It is assumed that for any elements

and

sets of open and ciphertext values
)
and
)
can be easily obtained either by directly calculating the value of substitutions

and

or by referring to public oracles

and

.
Open spaces and ciphertexts are binary spaces.

–Dimensional vectors:

and the key space of the system is the space of binary vectors of dimension

:

.
The secret key

is an ordered pair of two

–Dimensional plug (half)

and

; each subkey is selected randomly from space

–Dimensional binary vectors with equal probability

.
It is also assumed that the selected secret key

known only to legitimate users, and is used by them to encrypt plaintext (messages) and decrypt ciphertexts (cryptograms).
Plain text encryption

using a secret key

and the selected substitution

as follows:
and decryption ciphertext

with a key

and the selected substitution

- as follows:
Really simple? They took the message, poked it with the first half of the key, replaced the plate that was open and accessible to everyone, poked it with the second half of the key, and the cryptogram was obtained. Great, right? Why does nobody use this scheme in practice? After all, it is much easier AES, and DES. The easiest block cipher. Where is the catch?
TrickThe thing is, the substitution is set to binary

–Bit vectors, and storing the replacement table for a randomly selected substitution is completely unacceptable;
)
of memory. The only possible solution to this problem is to build
good pseudo-random substitutions (polynomially indistinguishable from random ones), whose values ​​could be relatively easily calculated at any point; and this we do not know how.
About minimal scheme
It should be noted that the classical scheme is
minimal in the sense that the removal of any of the elements of this scheme leads to a significant weakening of its durability. It is easy to show that removing any of the additions with subkeys, or substitutions

make the circuit vulnerable, and as a result, completely unstable.
- There is no addition with the first subkey.
The encryption function is:
The attacker can easily calculate the secret key
knowing the substitution
:
- There is no addition with the second subkey.
The encryption function is:
The attacker can easily calculate the secret key
knowing the substitution
:
- Missing
–Block (substitution
)
The encryption function is:
The attacker can easily calculate the secret key
:
About circuit durability
Assumptions of persistence, determination
The persistence of the proposed scheme is due to the following assumptions:
- the attacker does not know the true key
; - the attacker has the ability to encrypt plaintext (messages) and decrypt ciphertexts (cryptograms) on the secret key
; - the attacker has the ability to calculate the permutation values
and reverse permutations to it
.
Any algorithm that uncovers a system can refer to the following four oracles.

:
- oracle
calculates the permutation value
on
–Dimensional binary input set
:
- oracle
calculates the permutation value
on
–Dimensional binary input set
:
- oracle
encrypts
–Dimensional binary set (clear text)
on
–Dimensional key
:
- oracle
decodes
–Dimensional binary set (ciphertext)
on
–Dimensional key
:
Further, if the substitution, the value of which calculates the oracle

(

), selected, and encryption and decryption is carried out on a fixed key

, then the index of the notation of oracles, we will omit:

.
Addressing the oracles

and

with queries to calculate the value of substitutions

and

in points

and
)
algorithm gets answers

and

respectively.
Thus, the communication of any algorithm with oracles

and

is reduced to the formation of pairs of the form "point", "the value of the substitution

at this point:
Let's call such pairs
–Pairs and a set of all

–Pairs developed by some algorithm

as a result of its implementation, we denote by

, or simply

.
Addressing the oracles

and

with plaintext encryption requests

and decryption ciphertext
)
algorithm gets answers

and

respectively.
So, communication of any algorithm with oracles

and

is reduced to the formation of pairs of the form "clear text", "ciphertext":
Let's call such pairs
–Pairs , and a set of all

–Pairs developed by some algorithm

as a result of its implementation, we denote by

, or simply

.
Definition
–Pairs

and

are called
intersecting if

either

.
A similar definition can be formulated for

–Pair
Definition
–Pairs

and

are called
intersecting if

either

.
Statement 1 (Overlapping pairs are identical)
Due to the fact that all oracles

honest for any fixed

and

valid statements:
- intersecting
–Pairs are the same; - intersecting
–Pairs are the same.
Modulo statement 1, we can assume that all pairs of sets

and

do not intersect with each other.
Probability of success 
of the algorithm

let's call the calculation probability by this algorithm

correct output on arbitrary (but correct) inputs. So, for example, the probability

success of the algorithm

computing the encryption key by

–Pair

, there will be a probability
Under
runtime 
of the algorithm

we will understand the number of queries made by this algorithm to oracles

.
DefinitionFunction
![f (n) \ colon \ mathbb {N} _0 \ mapsto \ left [0, 1 \ right]](http://tex.s2cms.ru/svg/f(n)%20%5Ccolon%20%5Cmathbb%7BN%7D_0%20%5Cmapsto%20%5Cleft%5B%200%2C%201%20%5Cright%5D)
is called
polynomially mall (polynomially negligable) if for any polynomial
)
there is

such that for all

performed
%20%3C%201%20%2F%20p(n))
:
DefinitionTask

we call
difficult if the probability of success of any algorithm that solves it, which is polynomially limited in time, is polynomially small.
Description of the formal model
In the model proposed in [EM97], the attacker fully has knowledge of the cipher device and the selected substitution

. To open the system, the attacker uses some algorithm

which can solve one of two tasks:
the decryption task 
, or the
task of building a new plaintext / ciphertext pair 
.
Decryption Task (
)
Under the task of decryption (

,
cracking problem ) is understood by the attacker to decrypt some closed text

. However, any algorithm

used by the attacker to solve the problem, can refer to the oracles

,

,

,

where:
- (limited to
oracle
decrypts everyone
–Dimensional binary set (ciphertext)
, Besides
on the key
:
Algorithm

successfully opens the system if
![\ operatorname {A} \ left [C_0 \ right]} = D (C_0, \ underline {K})](http://tex.s2cms.ru/svg/%5Coperatorname%7BA%7D%5Cleft%5BC_0%5Cright%5D%7D%20%3D%20D%20(C_0%2C%20%5Cunderline%7BK%7D))
.
The task of building a new pair of plaintext / ciphertext (
)
Under the task of building a new pair of texts (

,
existential forgery problem ) understand the problem of building such a pair

that would satisfy the ratio
)
, and it did not consist of a request and response to one of the oracles

. However, any algorithm

used by an attacker to solve a problem can access all four oracles

.
The success of the algorithm

it is considered to receive a
new correct pair of plain text and ciphertext

.
Reduction of the task of constructing a text / ciphertext pair to the task of opening (
)
Theorem 1 (EFP to CP reduction)
Let be

and there is an algorithm

solving the task of opening

during
)
with probability of success
)
then there is an algorithm

building a couple of texts

at the same time
)
with probability of success
%20%2F%20T(n))
:
%2C%5C%20p_%7B%5Cmathrm%7BA%7D%7D%20%3D%20%5Cxi(n)%20%5C%3E%5CLongrightarrow%5C%3E%0A%5Cexists%20%5Cmathrm%7BB%7D%20%5Ctext%7B%20%D0%B4%D0%BB%D1%8F%20%D1%80%D0%B5%D1%88%D0%B5%D0%BD%D0%B8%D1%8F%20%7D%20%5Cmathsf%7BEFP%7D%20%5Cmid%20T_%7B%5Cmathrm%7BB%7D%7D%20%5Cleq%20T(n)%2C%5C%20p_%7B%5Cmathrm%7BB%7D%7D%20%3D%20%5Cfrac%7B%5Cxi(n)%7D%7BT(n)%7D.%0A)
EvidenceFix the plaintext

key

and ciphertext
)
, and consider the progress of the algorithm
![\ operatorname {A} \ left [C_0 \ right]}](http://tex.s2cms.ru/svg/%5Coperatorname%7BA%7D%5Cleft%5BC_0%5Cright%5D%7D)
.
Without loss of generality, we can assume that if the algorithm

successfully decrypts

then at some
critical point in time
)
the execution of this algorithm, the attacker checks the plaintext found, candidate

by sending (for the first time) a request to encrypt it to an oracle

and comparing the decrypted ciphertext

with oracle answer:
Based on the algorithm

let's build an algorithm

solving the problem

:
- Fix ciphertext
; - Let's start the execution of the algorithm
; - Choose random
evenly distributed on the segment
; - Stop the execution of the algorithm
after
requests to oracles; - If in request
algorithm
requests encryption
, the execution of the algorithm is terminated, and the initial pair is
.
It is easy to see that the algorithm

carries no more
)
requests to oracles

while the desired pair

will be built only if the decryption algorithm

successfully decrypts text

(with probability
)
) and

will be stopped at a critical time

(with probability
)
):
Q.E.D.
Corollary 1.1Let the task

difficult (for any polynomial decision algorithm

his probability of success

polynomially small), then the problem

also difficult (for any polynomial decision algorithm

his probability of success

polynomially small).
It should be noted that the converse statement (reducibility

) not true in the general case: in some classes of cryptosystems, there are open texts, such that their corresponding ciphertexts are known in advance and do not depend on the key (for example,

in the RSA scheme).
Durability of the system when using random substitution 
The main ideas of proof of persistence are as follows:- show that at any stage of a polynomially limited attack, the set of “good” keys (keys whose truth the attacker neither confirm nor deny on the basis of his data) is exponentially large ( Lemma 1 );
- show that the attacker can “guess” the true key
only with a polynomially small probability ( Theorem 2 ); - show that the attacker collect enough data to identify the true key
for the polynomial number of requests to oracles ( Theorem 2 ).
DefinitionThe first subkey of a
key
is called bad with respect to the algorithm
and the sets it has developed.
and
if there are a
couple
and
–Pair
such that
;
and good otherwise:In other words, a subkey
will be considered good if, based on the material obtained as a result of executing the algorithm,
it is impossible to determine if the
subkey is a true key.
.
Let us explain this informal definition by the following example: let the subkey
be bad, then, according to the definition of a bad subkey, there are a
pair
Where
and
–pair%20%5Cright%5Crangle)
.
Then the key
is a candidate for the true key.
where
Obviously, such a key
satisfies this
–pare, becauseWith the help of other collected
–pairs and
–pairs, the attacker has the opportunity to check whether the key constructed in this way is the
true key of the
system being opened; and accept (as a subkey
), or discard the subkey
.
A similar definition can be formulated for the second subkeys. 
.
The definition of thesecond
key
is called bad relative to the algorithm
and the sets it has developed
and
if there are a
couple
and
–Pair
such that)
;
and good otherwise:DefinitionKey
called good if both are connected
and
are good and bad in another case.Statement 2 (True subkeys share goodness)With a private key
and a swap
subkey
and
either are both good or bad:Lemma 1 (The fraction of bad keys)Let the algorithm
generate sets
and
disjoint
–pairs and
–pairs respectively, then the proportion of
bad keys in the key space
does not exceed
.
Evidence,

,

–

and

–
%5Cright%5Crangle%20%5Cin%20%5Cmathsf%7BP%7D)
, ,
,

, ,

and

,

.
,

.

, :

:
.
DefinitionLet be
- substitution from
, and
- some key.We say that the pair
satisfies (satisfies) sets of
pairs
and
–Pair
if the following conditions are met:- The substitution is
indistinguishable from the true substitution
on the resulting set –
pairs:
- The substitution is
indistinguishable from the true substitution
on the resulting set –
pairs:
The following lemma shows that all good keys are, in a sense, equal candidates for the role of a true encryption key. 
.
Lemma 2 (Distribution of true key candidates)Let be

and
- sets
–pairs and
–pairs, respectively, and
a true key, then the probability that a certain key
is a secret key
is the same for all
:
Evidence, :

:
,
:
,

.
,

–

–

,

, :
, ,

,

–

,

–

. ,

,

.
,

:

,

–

and

:

, ( )

.

,

, .
Theorem 2 (Boundary Probability for by success of the any
solving
) Let substitution
selected at random from
and the key
is chosen at random from
, then the probability of success of the algorithm
that solves the problem
, the following upper bound:Where
- number of requests to oracles 
and
, and
- the number of requests to the oracles
and

.
Evidence,

,

and


–

– . :
,
«» 
,
%7D)
.
%7D)
and
%7D)
sets

–

–,

:
%7D)
,
%7D)
and
%7D)
. , , :
,

( ). ,

, ,

–

. , , , .
,

,

– , , , ,

(

):
:
Let be

—

–. :

,

. Key

,

:
Number

(

)

,

–
%7D)
,

—

–
%7D)
:
%7D)
and
%7D)
, :
,
%7D%20%2B%20m)
:

:
:
, ( )

, (

),

, ,

(

),
Let be

—

–. :

,

.
Number

(

)

,

–
%7D)
,

—

–
%7D)
:
%7D)
and
%7D)
, :
,
%7D%20%2B%20l)
:

:
:
, ( )

, (

),
.

, ,

(

),
:

–

,

, ,

, ,
)
,

(

),
)
.
,


,
)
. ,

:

«»

–

:

,

—

and

. ,

–

,

or

.
,

–

,

– , «»

— . ,
)
«»,

:
.
Corollary 2.1.Let the permutation be
chosen randomly from
, then the probability of success of any algorithm
solving the problem
and polynomially limited in the number of queries to oracles is 


polynomial small.Durability of the system using pseudo-random substitution 
The cipher proposed in [EM97] retains the shown crypto resistance property even if the substitution is
chosen pseudo-randomly.To prove this statement, it suffices to clarify the concept of a pseudo-random permutation.DefinitionLet be
- random substitution, and
- some substitution, selected from
according to some non-uniform distribution law, and
and
- implementing their oracles. We will say that a
pseudo-random permutation if there is no polynomial query-limited algorithm that distinguishes oracles
and

.
In other words, in the presented computation model with oracles, the pseudo-random substitution is indistinguishable from the random one. Therefore, the following theorem holds.Theorem 3Let the permutation be
chosen pseudo-randomly from
, then the probability of success of any algorithm
that solves the problem
and is polynomially limited in the number of queries to oracles is 


polynomial small.In continuation
Yes, there is gunpowder in the old dog yet. If there are people interested in Habré, then in the next part I can consider modifications of this classical scheme, and various cryptographic attacks on it (which, by the way, show that the obtained estimate from the bottom is accurate and cannot be improved).Bibliography
For those who are very interested in:- Eli Biham, Yaniv Carmeli, Itai Dinur, Orr Dunkelman, Nathan Keller, and Adi Shamir. Cryptanalysis of iterated Even-Mansour schemes with two keys. IACR Cryptology ePrint Archive, 2013:674, 2013.
- Andrey Bogdanov, Lars R Knudsen, Gregor Leander, Francois-Xavier Standaert, John Steinberger, and Elmar Tischhauser. Key-alternating ciphers in a provable setting: Encryption using a small number of public permutations. In Advances in Cryptology–EUROCRYPT 2012, pages 45–62. Springer, 2012.
- Alex Biryukov and David Wagner. Advanced slide attacks. In Advances in Cryptology—EUROCRYPT 2000, pages 589–606. Springer, 2000.
- Shan Chen, Rodolphe Lampe, Jooyoung Lee, Yannick Seurin, and John Steinberger. Minimizing the two-round Even-Mansour cipher. In Advances in Cryptology–CRYPTO 2014, pages 39–56. Springer, 2014.
- Joan Daemen. Limitations of the Even-Mansour construction. In Advances in Cryptology—ASIACRYPT'91, pages 495–498. Springer, 1993.
- Itai Dinur, Orr Dunkelman, Nathan Keller, and Adi Shamir. Key recovery attacks on 3-round Even-Mansour, 8-step LED-128, and full AES2. In Advances in Cryptology-ASIACRYPT 2013, pages 337–356. Springer, 2013.
- Orr Dunkelman, Nathan Keller, and Adi Shamir. Minimalism in cryptography: The Even-Mansour scheme revisited. In Advances in Cryptology–EUROCRYPT 2012, pages 336–354. Springer, 2012.
- [EM97] Shimon Even and Yishay Mansour. A construction of a cipher from a single pseudorandom permutation. Journal of Cryptology, 10(3):151– 161, 1997.
- Shoni Gilboa and Shay Gueron. Balanced permutations even-mansour ciphers. arXiv preprint arXiv:1409.0421, 2014.
- Philip Hawkes and Luke O'Connor. Xor and non-xor differential probabilities. In Advances in Cryptology—EUROCRYPT'99, pages 272–285. Springer, 1999.
- Nicky Mouha and Atul Luykx. Multi-key security: The Even-Mansour construction revisited. Technical report, Cryptology ePrint Archive, Report 2015/101, 2015.
- Ivica Nikolic, Lei Wang, and Shuang Wu. Cryptanalysis of round-reduced LED. In Shiho Moriai, editor, Fast Software Encryption, volume 8424 of Lecture Notes in Computer Science, pages 112–129. Springer Berlin Heidelberg, 2014.
PS A part of this publication was written in TeX, while the layout on Habré could appear jambs, mainly in formulas. If you notice - please, fix it.EDIT 1. Corrected the names of scientists, thanks alexyr .