



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




1
2
3
4
Security of block ciphers
k block cipher computations in the worst case.
up exhaustive search by a factor of 2
2 55 /2!2.5! 10 7 that is about 23 years
Thus, no block cipher is perfectly secure. It is always possible for an attacker to recover the key. A good block cipher, however, is designed to make this task computationally prohibitive. How long does exhaustive key-search take? Since q is small we can neglect the difference in running time between the two versions of the attack above, and focus for simplicity on the first attack. In the worst case, it uses 2 k computations of the block cipher. However it could be less since one could get lucky. For example if the target key is in the first half of the search space, only 2 k− 1 computations would be used. So a better measure is how long it takes on the average. This is 2 k
i= i · Pr[K = T i
2 k
i= i
k
k
2 k
i= i =
k
k ( 2 k
k
k− 1 computations of the block cipher. This is because the target key is chosen at random, so with probability 1 / 2 k equals T i , and in that case the attack uses i E-computations to find it. Thus to make key-recovery by exhaustive search computationally prohibitive, one must make the key-length k of the block cipher large enough. Let’s look at DES. We noted above that there is VLSI chip that can compute it at the rate of 1 .6 Gbits/sec. How long would key-recovery via exhaustive search i 2 2 i q q i irly small vaue of q, say somewhat more than k/n, is enough that this attack usually return the target key itself. For DES, q = 2 is enough. hus, no block cipher is perfectly secure. It is always possible for an attacker cover the key. A good block cipher, however, is designed to make this task putationally prohibitive. ow long does exhaustive key-search take? Since q is small we can neglect the rence in running time between the two versions of the attack above, and focus implicity on the first attack. In the worst case, it uses 2 k computations of the k cipher. However it could be less since one could get lucky. For example if the et key is in the first half of the search space, only 2 k− 1 computations would be
. So a better measure is how long it takes on the average. This is
1 i · Pr[K = T i
2 k
i= i
k
k
2 k
i= i =
k
k ( 2 k
k
k− 1 putations of the block cipher. This is because the target key is chosen at random, ith probability 1 / 2 k equals T i , and in that case the attack uses i E-computations nd it. hus to make key-recovery by exhaustive search computationally prohibitive, must make the key-length k of the block cipher large enough. et’s look at DES. We noted above that there is VLSI chip that can compute the rate of 1 .6 Gbits/sec. How long would key-recovery via exhaustive search
list of security properties SP 1 , SP 2 , SP 3 ,... that are necessary for the security of some block cipher based application. Such a long list of necessary but not sufficient properties is no way to treat security. What we need is one single “MASTER” property of a block cipher which, if met, guarantees security of lots of natural usages of the cipher. Such a property is that the block cipher be a pseudorandom permutation (PRF), a notion explored in another chapter.
56
64
K
K
This is called the key-complementation property of DES. Problem 2.2 Explain how to use the key-complementation property of DES to speed up exhaustive key search by about a factor of two. Explain any assumptions that you make. Problem 2.3 Find a key K such that DES
K
− 1 K
times called a “weak” key. Problem 2.4 As with AES, suppose we are working in the finite field with 2
8
8
x
4
3
{e1} · { 05 } Problem 2.5 For AES, we have given two different descriptions of mix-cols: one using matric multiplication (in GF( 2
8
polynomial c(x) modulo a second fixed polynomial, d(x) = x
4
two methods are equivalent.
5 Security of DES
47 chosen plaintexts and the corresponding ciphertexts
42 known plaintext and ciphertext pairs
parallel!
(K1, DES(K2,M)).
6 Advanced Encryption Standard (AES)
designed by Joan Daemen and Vincent Rijmen from Belgium.
7 Limitations of key-recovery based security
A classical approach to block cipher security: key recovery should be infeasible.
I.e. given (M1,E(K,M1),...,Mq,E(K,Mq)), where K is chosen at random and M1,...Mq are chosen at random (or by an adversary), the adversary cannot compute K in time t with probability ".
Necessary, but is it sufficient?
Consider E’(K,M1||M2)=E(K,M1)||M2 for some “good” E. Key recovery is hard for E’ as well, but it does not look secure.
Q. What property of a block cipher as a building block would ensure various security properties of different constructions? 8
g(!)
global array T
If T[X] is not defined then
T[X] {0,1}
L EnIf
Return Y=T[X]
$
←
1
13
$
←
1
$
←
1
14
$(!)
global array T, S; S#
If T[X] is not defined then
T[X] {0,1}
l
Return Y=T[X]
$
←
1
15
L
$
!
L
−L
1
2
!
1
2
L
1
2
1
1
2
2
−L
1
2
1
2
!
L
1
2
− 2 L
1
2
−L
1
2
1
2
!
L
1
2
−L
1
2
1
2
L
1
2
L
L
l
L
1
2
!
1
L
2
l
2
2
1
1
−l
4 PSEUDORANDOM FUNCTIONS
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$ ← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L .
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1
= X 2
. Then
Pr [f (X 1 ) = Y 1 | f (X 2 ) = Y 2 ] = 2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2 ) = Y ] =
{
2
− 2 L if X 1 #= X 2
2
−L if X 1 = X 2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) ⊕ f (X 2 ) = Y ] =
2
−L if X 1
= X 2
0 if X 1 = X 2 and Y #= 0
L
1 if X 1 = X 2 and Y = 0
L
L → { 0 , 1 }
l denote the function that on input
Y ∈ { 0 , 1 }
L returns the first l bits of Y. Fix distinct X 1 , X 2 ∈ { 0 , 1 }
! , Y 1 ∈
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$
← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L
.
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
2
! and Y 1
2
L , and assume X 1
2
. Then
Pr [f (X 1
1 | f (X 2
2
−L
.
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2
− 2 L if X 1
2
−L if X 1
2
2
! and Y ∈ { 0 , 1 }
L
. Then:
−L if X 1
2
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$
← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L
.
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
2
! and Y 1
2
L , and assume X 1
2
. Then
Pr [f (X 1
1
| f (X 2
2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1
) = Y and f (X 2
− 2 L if X 1
2
−L if X 1
2
4 PSEUDORANDOM FUNCTIONS
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$ ← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L .
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1
= X 2
. Then
Pr [f (X 1 ) = Y 1 | f (X 2 ) = Y 2 ] = 2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2 ) = Y ] =
{
2
− 2 L if X 1
= X 2
2
−L if X 1 = X 2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) ⊕ f (X 2 ) = Y ] =
2
−L if X 1
= X 2
0 if X 1 = X 2 and Y #= 0
L
1 if X 1 = X 2 and Y = 0
L
L → { 0 , 1 }
l denote the function that on input
Y ∈ { 0 , 1 }
L returns the first l bits of Y. Fix distinct X 1 , X 2 ∈ { 0 , 1 }
! , Y 1 ∈
{ 0 , 1 }
L and Z 2 ∈ { 0 , 1 }
l
. Then:
4 PSEUDORANDOM FUNCTIONS
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$ ← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L .
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1
= X 2
. Then
Pr [f (X 1 ) = Y 1 | f (X 2 ) = Y 2 ] = 2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2 ) = Y ] =
{
2
− 2 L if X 1
= X 2
2
−L if X 1 = X 2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) ⊕ f (X 2 ) = Y ] =
2
−L if X 1
= X 2
0 if X 1 = X 2 and Y #= 0
L
1 if X 1 = X 2 and Y = 0
L
L → { 0 , 1 }
l denote the function that on input
Y ∈ { 0 , 1 }
L returns the first l bits of Y. Fix distinct X 1 , X 2 ∈ { 0 , 1 }
! , Y 1 ∈
{ 0 , 1 }
L and Z 2 ∈ { 0 , 1 }
l
. Then:
Pr [τ (f (X 2 )) = Z 2 | f (X 1 ) = Y 1 ] = 2
−l .
4 PSEUDORANDOM FUNCTIONS
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$
← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L .
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1
= X 2
. Then
Pr [f (X 1 ) = Y 1 | f (X 2 ) = Y 2 ] = 2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2 ) = Y ] =
{
2
− 2 L if X 1
= X 2
2
−L if X 1 = X 2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) ⊕ f (X 2 ) = Y ] =
2
−L if X 1
= X 2
0 if X 1 = X 2 and Y #= 0
L
1 if X 1 = X 2 and Y = 0
L
L → { 0 , 1 }
l denote the function that on input
Y ∈ { 0 , 1 }
L returns the first l bits of Y. Fix distinct X 1 , X 2 ∈ { 0 , 1 }
! , Y 1 ∈
{ 0 , 1 }
L and Z 2 ∈ { 0 , 1 }
l
. Then:
Pr [τ (f (X 2 )) = Z 2 | f (X 1 ) = Y 1 ] = 2
−l .
4 PSEUDORANDOM FUNCTIONS
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$ ← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L .
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1
= X 2
. Then
Pr [f (X 1 ) = Y 1 | f (X 2 ) = Y 2 ] = 2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2 ) = Y ] =
{
2
− 2 L if X 1
= X 2
2
−L if X 1 = X 2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) ⊕ f (X 2 ) = Y ] =
2
−L if X 1
= X 2
0 if X 1 = X 2 and Y #= 0
L
1 if X 1 = X 2 and Y = 0
L
L → { 0 , 1 }
l denote the function that on input
Y ∈ { 0 , 1 }
L returns the first l bits of Y. Fix distinct X 1 , X 2 ∈ { 0 , 1 }
! , Y 1 ∈
{ 0 , 1 }
L and Z 2 ∈ { 0 , 1 }
l
. Then:
Pr [τ (f (X 2 )) = Z 2 | f (X 1 ) = Y 1 ] = 2
−l .
4 PSEUDORANDOM FUNCTIONS
The answer on any point is random and independent of the answers on other points.
It is this “dynamic” view that we suggest the reader have in mind when thinking
about random functions or random permutations.
One must remember that the term “random function” is misleading. It might
lead one to think that certain functions are “random” and others are not. (For
example, maybe the constant function that always returns 0
L on any input is not
random, but a function with many different range values is random.) This is not
right. The randomness of the function refers to the way it was chosen, not to an
attribute of the selected function itself. When you choose a function at random, the
constant function is just as likely to appear as any other function. It makes no sense
to talk of the randomness of an individual function; the term “random function”
just means a function chosen at random.
Example 3.3 Let’s do some simple probabilistic computations to understand ran-
dom functions. In all of the following, the probability is taken over a random choice
of f from Func(!,L), meaning that we have executed the operation f
$ ← Func(!,L).
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X) = Y ] = 2
−L .
Notice that the probability doesn’t depend on !. Nor does it depend on the
values of X, Y.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1
= X 2
. Then
Pr [f (X 1 ) = Y 1 | f (X 2 ) = Y 2 ] = 2
−L .
The above is a conditional probability, and says that even if we know the value
of f on X 1 , its value on a different point X 2 is equally likely to be any L-bit
string.
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) = Y and f (X 2 ) = Y ] =
{
2
− 2 L if X 1
= X 2
2
−L if X 1 = X 2
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [f (X 1 ) ⊕ f (X 2 ) = Y ] =
2
−L if X 1
= X 2
0 if X 1 = X 2 and Y #= 0
L
1 if X 1 = X 2 and Y = 0
L
L → { 0 , 1 }
l denote the function that on input
Y ∈ { 0 , 1 }
L returns the first l bits of Y. Fix distinct X 1 , X 2 ∈ { 0 , 1 }
! , Y 1 ∈
{ 0 , 1 }
L and Z 2 ∈ { 0 , 1 }
l
. Then:
Pr [τ (f (X 2 )) = Z 2 | f (X 1 ) = Y 1 ] = 2
−l .
6 PSEUDORANDOM FUNCTIONS
if T [X] is not defined
then Y
$ ← D − S ; T [X] ← Y ; S ← S ∪ {T [X]}
fi
return T [X]
The answer on any point is random, but not independent of the answers on other
points, since it is distinct from those.
Example 3.5 Random permutations are somewhat harder to work with than ran-
dom functions, due to the lack of independence between values on different points.
Let’s look at some probabilistic computations involving them. In all of the following,
the probability is taken over a random choice of π from Perm("), meaning that we
have executed the operation π
$ ← Perm(").
!
. Then:
Pr [π(X) = Y ] = 2
−! .
This is the same as if π had been selected at random from Func(",") rather than
from Perm("). However, the similarity vanishes when more than one point is to
be considered.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1 % = X 2
. Then
Pr [π(X 1 ) = Y 1 | π(X 2 ) = Y 2 ] =
1
2 ! − 1
if Y 1 % = Y 2
0 if Y 1 = Y 2
The above is a conditional probability, and says that if we know the value of π
on X 1 , its value on a different point X 2 is equally likely to be any L-bit string
other than π(X 1 ). So there are 2
! − 1 choices for π(X 2 ), all equally likely, if
Y 1 % = Y 2 .
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [π(X 1 ) = Y and π(X 2 ) = Y ] =
{
0 if X 1 % = X 2
2
−! if X 1 = X 2
This is true because a permutation can never map distinct X 1 and X 2 to the
same point.
! and Y ∈ { 0 , 1 }
!
. Then:
Pr [π(X 1 ) ⊕ π(X 2 ) = Y ] =
1
2 ! − 1
if X 1 %= X 2 and Y %= 0
!
0 if X 1 % = X 2 and Y = 0
!
0 if X 1 = X 2 and Y %= 0
!
1 if X 1 = X 2 and Y = 0
!
6 PSEUDORANDOM FUNCTIONS
if T [X] is not defined
then Y
$ ← D − S ; T [X] ← Y ; S ← S ∪ {T [X]}
fi
return T [X]
The answer on any point is random, but not independent of the answers on other
points, since it is distinct from those.
Example 3.5 Random permutations are somewhat harder to work with than ran-
dom functions, due to the lack of independence between values on different points.
Let’s look at some probabilistic computations involving them. In all of the following,
the probability is taken over a random choice of π from Perm("), meaning that we
have executed the operation π
$ ← Perm(").
!
. Then:
Pr [π(X) = Y ] = 2
−! .
This is the same as if π had been selected at random from Func(",") rather than
from Perm("). However, the similarity vanishes when more than one point is to
be considered.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1 % = X 2
. Then
Pr [π(X 1 ) = Y 1 | π(X 2 ) = Y 2 ] =
1
2 ! − 1
if Y 1 % = Y 2
0 if Y 1 = Y 2
The above is a conditional probability, and says that if we know the value of π
on X 1 , its value on a different point X 2 is equally likely to be any L-bit string
other than π(X 1 ). So there are 2
! − 1 choices for π(X 2 ), all equally likely, if
Y 1 % = Y 2 .
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [π(X 1 ) = Y and π(X 2 ) = Y ] =
{
0 if X 1 % = X 2
2
−! if X 1 = X 2
This is true because a permutation can never map distinct X 1 and X 2 to the
same point.
! and Y ∈ { 0 , 1 }
!
. Then:
Pr [π(X 1 ) ⊕ π(X 2 ) = Y ] =
1
2
! − 1
if X 1 % = X 2 and Y %= 0
!
0 if X 1 % = X 2 and Y = 0
!
0 if X 1 = X 2 and Y %= 0
!
1 if X 1 = X 2 and Y = 0
!
In the case X 1 % = X 2 and Y %= 0
! this is computed as follows:
Pr [π(X 1 ) ⊕ π(X 2 ) = Y ]
6 PSEUDORANDOM FUNCTIONS
if T [X] is not defined
then Y
$ ← D − S ; T [X] ← Y ; S ← S ∪ {T [X]}
fi
return T [X]
The answer on any point is random, but not independent of the answers on other
points, since it is distinct from those.
Example 3.5 Random permutations are somewhat harder to work with than ran-
dom functions, due to the lack of independence between values on different points.
Let’s look at some probabilistic computations involving them. In all of the following,
the probability is taken over a random choice of π from Perm("), meaning that we
have executed the operation π
$ ← Perm(").
!
. Then:
Pr [π(X) = Y ] = 2
−! .
This is the same as if π had been selected at random from Func(",") rather than
from Perm("). However, the similarity vanishes when more than one point is to
be considered.
! and Y 1 , Y 2 ∈ { 0 , 1 }
L , and assume X 1 % = X 2
. Then
Pr [π(X 1 ) = Y 1 | π(X 2 ) = Y 2 ] =
1
2 ! − 1
if Y 1 %= Y 2
0 if Y 1 = Y 2
The above is a conditional probability, and says that if we know the value of π
on X 1 , its value on a different point X 2 is equally likely to be any L-bit string
other than π(X 1 ). So there are 2
! − 1 choices for π(X 2 ), all equally likely, if
Y 1 % = Y 2 .
! and Y ∈ { 0 , 1 }
L
. Then:
Pr [π(X 1 ) = Y and π(X 2 ) = Y ] =
{
0 if X 1 % = X 2
2
−! if X 1 = X 2
This is true because a permutation can never map distinct X 1 and X 2 to the
same point.
! and Y ∈ { 0 , 1 }
!
. Then:
Pr [π(X 1 ) ⊕ π(X 2 ) = Y ] =
1
2 ! − 1
if X 1 % = X 2 and Y %= 0
!
0 if X 1 % = X 2 and Y = 0
!
0 if X 1 = X 2 and Y %= 0
!
1 if X 1 = X 2 and Y = 0
!
In the case X 1 %= X 2 and Y %= 0
! this is computed as follows:
Pr [π(X 1 ) ⊕ π(X 2 ) = Y ]
l = L
1
$
$
!
−!
1
2
!
1
2
L
1
2
1
1
2
2
!
1
2
1
2
1
2
1
!
2
1
2
1
2
!
L
1
2
16
Pseudorandom functions (PRFs)
17
PRFs
Experiment Experiment
g Func(Dom(F),Range(F))
A
g
!
b
Return b
K Keys(F)
F K
!
b
Return b
A
Bellare and Rogaway 9
Experiment Exp
prf- 1
F
(A)
K
$ ← K
b
$
← A
F K
Return b
Experiment Exp
prf- 0
F
(A)
g
$ ← Func(D,R)
b
$
← A
g
Return b
The prf-advantage of A is defined as
Adv
prf
F
(A) = Pr
[
Exp
prf- 1
F
(A) = 1
]
− Pr
[
Exp
prf- 0
F
(A) = 1
]
.
It should be noted that the family F is public. The adversary A, and anyone else,
knows the description of the family and is capable, given values K, X, of comput-
ing F (K, X).
The worlds are captured by what we call experiments. The first experiment picks
a random instance F K of family F and then runs adversary A with oracle g = F K .
Adversary A interacts with its oracle, querying it and getting back answers, and
eventually outputs a “guess” bit. The experiment returns the same bit. The second
experiment picks a random function g: D → R and runs A with this as oracle, again
returning A’s guess bit. Each experiment has a certain probability of returning 1.
The probability is taken over the random choices made in the experiment. Thus,
for the first experiment, the probability is over the choice of K and any random
choices that A might make, for A is allowed to be a randomized algorithm. In the
second experiment, the probability is over the random choice of g and any random
choices that A makes. These two probabilities should be evaluated separately; the
two experiments are completely different.
To see how well A does at determining which world it is in, we look at the
difference in the probabilities that the two experiments return 1. If A is doing a
good job at telling which world it is in, it would return 1 more often in the first
experiment than in the second. So the difference is a measure of how well A is doing.
We call this measure the prf-advantage of A. Think of it as the probability that A
“breaks” the scheme F , with “break” interpreted in a specific, technical way based
on the definition.
Different adversaries will have different advantages. There are two reasons why
one adversary may achieve a greater advantage than another. One is that it is more
“clever” in the questions it asks and the way it processes the replies to determine
its output. The other is simply that it asks more questions, or spends more time
processing the replies. Indeed, we expect that as an adversary sees more and more
input-output examples of g, or spends more computing time, its ability to tell which
world it is in should go up.
The “security” of family F as a pseudorandom function must thus be thought
of as depending on the resources allowed to the attacker. We may want to want to
know, for any given resource limitations, what is the prf-advantage achieved by the
most “clever” adversary amongst all those who are restricted to the given resource
limits.
The choice of resources to consider can vary. One resource of interest is the
time-complexity t of A. Another resource of interest is the number of queries q
Bellare and Rogaway 9
Experiment Exp
prf- 1
F
(A)
K
$ ← K
b
$ ← A
F K
Return b
Experiment Exp
prf- 0
F
(A)
g
$ ← Func(D,R)
b
$ ← A
g
Return b
The prf-advantage of A is defined as
Adv
prf
F
(A) = Pr
[
Exp
prf- 1
F
(A) = 1
]
− Pr
[
Exp
prf- 0
F
(A) = 1
]
.
It should be noted that the family F is public. The adversary A, and anyone else,
knows the description of the family and is capable, given values K, X, of comput-
ing F (K, X).
The worlds are captured by what we call experiments. The first experiment picks
a random instance F K of family F and then runs adversary A with oracle g = F K .
Adversary A interacts with its oracle, querying it and getting back answers, and
eventually outputs a “guess” bit. The experiment returns the same bit. The second
experiment picks a random function g: D → R and runs A with this as oracle, again
returning A’s guess bit. Each experiment has a certain probability of returning 1.
The probability is taken over the random choices made in the experiment. Thus,
for the first experiment, the probability is over the choice of K and any random
choices that A might make, for A is allowed to be a randomized algorithm. In the
second experiment, the probability is over the random choice of g and any random
choices that A makes. These two probabilities should be evaluated separately; the
two experiments are completely different.
To see how well A does at determining which world it is in, we look at the
difference in the probabilities that the two experiments return 1. If A is doing a
good job at telling which world it is in, it would return 1 more often in the first
experiment than in the second. So the difference is a measure of how well A is doing.
We call this measure the prf-advantage of A. Think of it as the probability that A
“breaks” the scheme F , with “break” interpreted in a specific, technical way based
on the definition.
Different adversaries will have different advantages. There are two reasons why
one adversary may achieve a greater advantage than another. One is that it is more
“clever” in the questions it asks and the way it processes the replies to determine
its output. The other is simply that it asks more questions, or spends more time
processing the replies. Indeed, we expect that as an adversary sees more and more
input-output examples of g, or spends more computing time, its ability to tell which
world it is in should go up.
The “security” of family F as a pseudorandom function must thus be thought
of as depending on the resources allowed to the attacker. We may want to want to
know, for any given resource limitations, what is the prf-advantage achieved by the
most “clever” adversary amongst all those who are restricted to the given resource
limits.
The choice of resources to consider can vary. One resource of interest is the
time-complexity t of A. Another resource of interest is the number of queries q
Bellare and Rogaway 9
F
$
$
F K
F
$
$
g
prf
F
F
F
K
K
Bellare and Rogaway 9
Experiment Exp
prf- 1
F
$
← K
b
$
← A
F K
Return b
Experiment Exp
prf- 0
F
g
$
← Func(D,R)
b
$
← A
g
Return b
The prf-advantage of A is defined as
Adv
prf
F
(A) = Pr
Exp
prf- 1
F
− Pr
Exp
prf- 0
F
It should be noted that the family F is public. The adversary A, and anyone else,
knows the description of the family and is capable, given values K, X, of comput-
ing F (K, X).
The worlds are captured by what we call experiments. The first experiment picks
a random instance F K of family F and then runs adversary A with oracle g = F K
Adversary A interacts with its oracle, querying it and getting back answers, and
eventually outputs a “guess” bit. The experiment returns the same bit. The second
experiment picks a random function g: D → R and runs A with this as oracle, again
returning A’s guess bit. Each experiment has a certain probability of returning 1.
The probability is taken over the random choices made in the experiment. Thus,
for the first experiment, the probability is over the choice of K and any random
choices that A might make, for A is allowed to be a randomized algorithm. In the
second experiment, the probability is over the random choice of g and any random
choices that A makes. These two probabilities should be evaluated separately; the
two experiments are completely different.
To see how well A does at determining which world it is in, we look at the
difference in the probabilities that the two experiments return 1. If A is doing a
good job at telling which world it is in, it would return 1 more often in the first
experiment than in the second. So the difference is a measure of how well A is doing.
We call this measure the prf-advantage of A. Think of it as the probability that A
“breaks” the scheme F , with “break” interpreted in a specific, technical way based
on the definition.
Different adversaries will have different advantages. There are two reasons why
one adversary may achieve a greater advantage than another. One is that it is more
“clever” in the questions it asks and the way it processes the replies to determine
its output. The other is simply that it asks more questions, or spends more time
processing the replies. Indeed, we expect that as an adversary sees more and more
input-output examples of g, or spends more computing time, its ability to tell which
world it is in should go up.
The “security” of family F as a pseudorandom function must thus be thought
of as depending on the resources allowed to the attacker. We may want to want to
know, for any given resource limitations, what is the prf-advantage achieved by the
most “clever” adversary amongst all those who are restricted to the given resource
limits.
The choice of resources to consider can vary. One resource of interest is the
time-complexity t of A. Another resource of interest is the number of queries q
Bellare and Rogaway
Experiment Exp
prf- 1
F
$
← K
b
$
← A
F K
Return b
Experiment Exp
prf- 0
F
g
$
← Func(D,R)
b
$
← A
g
Return b
The prf-advantage of A is defined as
Adv
prf
F
(A) = Pr
Exp
prf- 1
F
− Pr
Exp
prf- 0
F
It should be noted that the family F is public. The adversary A, and
knows the description of the family and is capable, given values K, X,
ing F (K, X).
The worlds are captured by what we call experiments. The first expe
a random instance F K
of family F and then runs adversary A with ora
Adversary A interacts with its oracle, querying it and getting back a
eventually outputs a “guess” bit. The experiment returns the same bit.
experiment picks a random function g: D → R and runs A with this as o
returning A’s guess bit. Each experiment has a certain probability of
The probability is taken over the random choices made in the experim
for the first experiment, the probability is over the choice of K and
choices that A might make, for A is allowed to be a randomized algori
second experiment, the probability is over the random choice of g and
choices that A makes. These two probabilities should be evaluated sep
two experiments are completely different.
To see how well A does at determining which world it is in, we
difference in the probabilities that the two experiments return 1. If A
good job at telling which world it is in, it would return 1 more often
experiment than in the second. So the difference is a measure of how wel
We call this measure the prf-advantage of A. Think of it as the probab
“breaks” the scheme F , with “break” interpreted in a specific, technica
on the definition.
Different adversaries will have different advantages. There are two
one adversary may achieve a greater advantage than another. One is th
“clever” in the questions it asks and the way it processes the replies t
its output. The other is simply that it asks more questions, or spend
processing the replies. Indeed, we expect that as an adversary sees mo
input-output examples of g, or spends more computing time, its ability t
world it is in should go up.
The “security” of family F as a pseudorandom function must thus
of as depending on the resources allowed to the attacker. We may wan
know, for any given resource limitations, what is the prf-advantage ach
most “clever” adversary amongst all those who are restricted to the giv
limits.
The choice of resources to consider can vary. One resource of int
time-complexity t of A. Another resource of interest is the number
18
PRFs
Bellare and Rogaway 9
F
$
$
F K
F
$
$
g
prf
F
F
F
K
K
Experiment Exp
prf- 1
F
(A)
K
$
← K
b
$
← A
F K
Return b
Experiment Exp
prf- 0
F
(A)
g
$
← Func(D,R)
b
$
← A
g
Return b
The prf-advantage of A is defined as
Adv
prf
F
(A) = Pr
Exp
prf- 1
F
(A) = 1
− Pr
Exp
prf- 0
F
(A) = 1
.
It should be noted that the family F is public. The adversary A, and anyone else,
knows the description of the family and is capable, given values K, X, of comput-
ing F (K, X).
The worlds are captured by what we call experiments. The first experiment picks
a random instance F K of family F and then runs adversary A with oracle g = F K .
Adversary A interacts with its oracle, querying it and getting back answers, and
eventually outputs a “guess” bit. The experiment returns the same bit. The second
experiment picks a random function g: D → R and runs A with this as oracle, again
returning A’s guess bit. Each experiment has a certain probability of returning 1.
The probability is taken over the random choices made in the experiment. Thus,
19
Resources of an adversary
20
PRP-CCA secure.
Modeling block ciphers security property of block ciphers under which natural usages of block ciphers could be proven secure. We suggest that this master property is that the block cipher be a secure PRP, under either CPA or CCA. We cannot prove that specific block ciphers have this property. The best we can do is assume they do, and then go on to use them. For quantitative security assessments, we would make specific conjectures about the advantage functions of various block ciphers. For example we might conjecture something like: Adv prp-cpa DES
t,q ) ≤ c 1
t/T DES
55
q
40 for any adversary A t,q that runs in time at most t and asks at most q 64 -bit oracle queries. Here T DES is the time to do one DES computation on our fixed RAM model of computation, and c 1 , c 2 are some constants depending only on this model. In other words, we are conjecturing that the best attacks are either exhaustive key search or linear cryptanalysis. We might be bolder with regard to AES and conjecture something like Adv prp-cpa AES
t,q ) ≤ c 1
t/T AES
128
q
128
for any adversary B t,q that runs in time at most t and asks at most q 128 -bit oracle queries. We could also make similar conjectures regarding the strength of block ciphers as PRPs under CCA rather than CPA. More interesting is Adv prf DES (t, q). Here we cannot do better than assume that Adv prf DES
t,q ) ≤ c 1
t/T DES
55
q 2
64 Adv prf AES
t,q ) ≤ c 1
t/T AES
128
q 2
128
for any adversaries A t,q
t,q running in time at most t and making at most q oracle queries. This is due to the birthday attack discussed later. The second term in each formula arises simply because the object under consideration is a family of permutations. We stress that these are all conjectures. There could exist highly effective attacks that break DES or AES as a PRF without recovering the key. So far, we do not know of any such attacks, but the amount of cryptanalytic effort that has focused on this goal is small. Certainly, to assume that a block cipher is a PRF is a much stronger assumption than that it is secure against key recovery. Nonetheless, the motivation and arguments we have outlined in favor of the PRF assumption stay, and our view is that if a block cipher is broken as a PRF then it should be considered insecure, and a replacement should be sought. assessments, we would make specific conjectures about the advantage functions of various block ciphers. For example we might conjecture something like: Adv prp-cpa DES (A t,q ) ≤ c 1 · t/T DES 2 55
q 2 2 64 Adv prf AES (B t,q ) ≤ c 1 · t/T AES 2 128
q 2 2 128 . for any adversaries A t,q , B t,q running in time at most t and making at most q oracle queries. This is due to the birthday attack discussed later. The second term in each formula arises simply because the object under consideration is a family of permutations. We stress that these are all conjectures. There could exist highly effective attacks that break DES or AES as a PRF without recovering the key. So far, we do not know of any such attacks, but the amount of cryptanalytic effort that has focused on this goal is small. Certainly, to assume that a block cipher is a PRF is a much stronger assumption than that it is secure against key recovery. Nonetheless, the motivation and arguments we have outlined in favor of the PRF assumption stay, and our view is that if a block cipher is broken as a PRF then it should be considered insecure, and a replacement should be sought. 25 The “birthday” attack
{0,1} l and any A that makes q queries s.t.
if then the probability of a collision Appendix ??, and then come back to the following. This tells us that an instance of a block cipher random function based on seeing a number of input-o proximately 2
!/ 2
based protocols. Proposition 3.16 Let E: { 0 , 1 }
k
!
!
(!+1)/ 2
queries and having running time about that to do q co Adv
prf E
q(q − 1 2
!
and works like this: Adversary A
g
Let x
i
y
i
i
if y
1
q
Let us now justify Equation ( 3 .5). Letting N = 2
l
Pr [ Exp prf- 1
E
] = 1 Pr [ Exp prf- 0
E
] = 1 − C Here C(N, q), as defined in Appendix ??, is the proba or more balls in the experiment of randomly throwing justify these claims shortly, but first let us use them t get Adv
prf E
[ Exp prf- 1
E
] − Pr = 1 − [1 − C(N, q)] = C(N, q) ≥ 0. 3 · q(q − 1 ) 2
l
The last line is by Proposition ??. It remains to justif Equation ( 3 .6) is clear because in World 1 , g = E
K
family of permutations, g is a permutation, and thus y
1
This tells us that an instance of a block cipher can be distinguished from a random function based on seeing a number of input-output examples which is ap- proximately 2
!/ 2
based protocols. Proposition 3.16 Let E: { 0 , 1 }
k
!
!
Suppose q satisfies 2 ≤ q ≤ 2
(!+1)/ 2
queries and having running time about that to do q computations of E, such that Adv
prf E
q(q − 1 ) 2
!
Proof of Proposition 3.16: Adversary A is given an oracle g: { 0 , 1 }
!
!
Adversary A
g
Let x
i
y
i
i
if y
1
q
Let us now justify Equation ( 3 .5). Letting N = 2
l
Pr
prf- 1
E
Pr
prf- 0
E
Here C(N, q), as defined in Appendix ??, is the probability that some bin gets two or more balls in the experiment of randomly throwing q balls into N bins. We will justify these claims shortly, but first let us use them to conclude. Subtracting, we get Adv
prf E
prf- 1
E
prf- 0
E
= C(N, q) ≥ 0. 3 · q(q − 1 ) 2
l
The last line is by Proposition ??. It remains to justify Equations ( 3 .6) and ( 3 .7). Equation ( 3 .6) is clear because in World 1 , g = E
K
family of permutations, g is a permutation, and thus y
1
q
already quite high, around 1 / 2. This fact can seem surprising when first heard. The reason it is true is that the collision probability C(N, q) grows roughly proportional to q
2
remember. The following gives a more exact rendering, providing both upper and lower bounds on this probability. Theorem A.1 [Birthday bound] Let C(N, q) denote the probability of at least one collision when we throw q ≥ 1 balls at random into N ≥ q buckets. Then C(N, q) ≤ q(q − 1 ) 2 N and C(N, q) ≥ 1 − e
−q(q− 1 )/ 2 N
Also if 1 ≤ q ≤ √ 2 N then C(N, q) ≥ 0. 3 · q(q − 1 ) N . 1 already quite high, around 1 / 2. This fact can seem surprising when first heard. The reason it is true is that the collision probability C(N, q) grows roughly proportional to q
2
remember. The following gives a more exact rendering, providing both upper and lower bounds on this probability. Theorem A.1 [Birthday bound] Let C(N, q) denote the probability of at least one collision when we throw q ≥ 1 balls at random into N ≥ q buckets. Then C(N, q) ≤ q(q − 1 ) 2 N and C(N, q) ≥ 1 − e
−q(q− 1 )/ 2 N
Also if 1 ≤ q ≤ √ 2 N then C(N, q) ≥ 0. 3 · q(q − 1 ) N . 1
26 Proof of the Lemma 1 − C(N, q) = 1 · N − 1 N · N − 2 N
...
N − q + 1 N = ( 1 − 1 N ) · ( 1 − 2 N ) ·... ( 1 − q − 1 N ) // Using that ≤ e − 1 N ·... e − q− 1 N = e − q(q−1) N // Using that 1 − e −x ≥ ( 1 − e − 1 )x q(q − 1 ) 2 N ≤ 1
≤ 1 − ( 1 − 1 e ) · q(q − 1 ) 2 N C(N, q) ≥ ( 1 − 1 e ) · q(q − 1 ) 2 N ≥ 0. 3 · q(q − 1 ) N
A.1: Let C i be the event that the i-th ball collides with one Then Pr [C i ] is at most (i − 1 )/N , since when the i-th ball is at most i − 1 different occupied slots and the i-th ball is equally of them. Now (N, q) = Pr [C 1 ∨ C 2 ∨ · · · ∨ C q ] ≤ Pr [C 1 ] + Pr [C 2 ] + · · · + Pr [C q ] ≤ 0 N
1 N
i= Pr [D i+ | D i ] = q− 1
i=
1 − i N
. So we can use the inequality 1 − x ≤ e −x for each term of the is means the above is not more than −i/N = e − 1 /N − 2 /N −···−(q− 1 )/N = e −q(q− 1 )/ 2 N . 27 Proof of the Theorem
g For i=1,..q do y i #g() EndFor If y i ,...y q are all distinct return 1, else return 0 EndIf
Bellare and Rogaway 23 the birthday paradox. If you are not familiar with this, you may want to look at Appendix ??, and then come back to the following. This tells us that an instance of a block cipher can be distinguished from a random function based on seeing a number of input-output examples which is ap- proximately 2 !/ 2
. This has important consequences for the security of block cipher
based protocols. Proposition 3.16 Let E: { 0 , 1 } k × { 0 , 1 } ! → { 0 , 1 } ! be a family of permutations. Suppose q satisfies 2 ≤ q ≤ 2 (!+1)/ 2
. Then there is an adversary A, making q oracle
queries and having running time about that to do q computations of E, such that Adv prf E (A) ≥ 0. 3 · q(q − 1 ) 2 !
. ( 3 .5)
Proof of Proposition 3.16: Adversary A is given an oracle g: { 0 , 1 } ! → { 0 , 1 } ! and works like this: Adversary A g for i = 1 ,... , q do Let x i be the i-th l-bit string in lexicographic order y i ← g(x i ) if y 1 ,... , y q are all distinct then return 1 , else return 0 Let us now justify Equation ( 3 .5). Letting N = 2 l , we claim that Pr [ Exp prf- 1 E (A) = 1 ] = 1 ( 3 .6) Pr [ Exp prf- 0 E (A) = 1 ] = 1 − C(N, q). ( 3 .7) Here C(N, q), as defined in Appendix ??, is the probability that some bin gets two or more balls in the experiment of randomly throwing q balls into N bins. We will justify these claims shortly, but first let us use them to conclude. Subtracting, we get Adv prf E (A) = Pr [ Exp prf- 1 E (A) = 1 ] − Pr [ Exp prf- 0 E (A) = 1 ] = 1 − [1 − C(N, q)] = C(N, q) ≥ 0. 3 · q(q − 1 ) 2 l . The last line is by Proposition ??. It remains to justify Equations ( 3 .6) and ( 3 .7). Equation ( 3 .6) is clear because in World 1 , g = E K for some key K, and since E is a family of permutations, g is a permutation, and thus y 1 ,... , y q are all distinct. Now, i-th l -bit string 28