CIS 5371 Cryptography 3. Private-Key Encryption and Pseudorandomness B

advertisement
CIS 5371 Cryptography
3. Private-Key Encryption and
Pseudorandomness
Based on: Jonathan Katz and Yehuda Lindel Introduction to Modern Cryptography
1
A Computational Approach
to Cryptography
• The principal of Kerchoffs essentially
says that it is not necessary to use a
perfectly-secret encryption scheme, but
instead it suffices to use a scheme that
cannot be broken in reasonable time
with any reasonable probability of
success.
2
A Computational Approach
to Cryptography
• That is, it suffices to use an encryption
scheme that
• can be broken in theory
• but that cannot be broken in practice with
probability better than 10−30 in 200 years
using the fastest available supercomputer.
3
A Computational Approach
1. Security is only preserved against
efficient adversaries
2. Adversaries can potentially succeed
with some very small probability
(small enough so that we are not concerned
that it will ever really happen)
4
A concrete approach
𝟐−πŸ”πŸ’ .
5
The asymptotic approach
•
6
The asymptotic approach
7
The asymptotic approach
8
The asymptotic approach –
an example
The effect that availability of faster computers
might have on security in practice
• Say we have a cryptographic scheme where
honest parties are required to run for
106 βˆ™ 𝑛2 cycles
and for which an adversary is running for
108 βˆ™ 𝑛4 cycles
can succeed in breaking the scheme with
probability
230 βˆ™ 2−𝑛 .
9
The asymptotic approach –
an example
10
The asymptotic approach –
an example
2−80 .
11
The asymptotic approach –
an example
• The asymptotic approach has the
advantage of not depending on any
specific assumptions regarding,
e.g., the type of computer an adversary
will use.
12
Efficient Algorithms
13
Efficient Algorithms
Generating randomness
There are a number of ways random bits are
obtained in practice.
• One solution is to use a hardware random
number generator that generates random bitstreams based on certain physical phenomena
like thermal/electrical noise or radioactive decay.
• Another possibility is to use software random
number generators which generate random bitstreams based on unpredictable behavior such as
the time between key-strokes, movement of the
mouse, hard disk access times, and so on.
14
Efficient Algorithms
Generating randomness
•
•
Some modern operating systems provide
functions of this sort. Note that, in either of these
cases, the underlying unpredictable event is
unlikely to directly yield uniformly-distributed
bits, and so further processing of the initial bitstream is needed.
Techniques for doing this are complex and poorly
understood.
15
Efficient Algorithms
Generating randomness
• One must be careful in how random bits are
chosen, and the use of badly designed or
inappropriate random number generators can
often leave a good cryptosystem vulnerable to
attack.
• Particular care must be taken to use a random
number generator that is designed for
cryptographic use, rather than a general-purpose
random number generator which may be fine for
some applications but not cryptographic ones
16
Negligible Success
17
Negligible Success
18
Proofs by Reduction
Strategy
1.
2.
Assume that some low-level problem is
hard to solve.
Then prove that the construction in
question is secure given this assumption.
19
Proofs by Reduction
The proof that a given construction is secure as
long as some underlying problem is hard generally
proceeds by presenting
• an explicit reduction showing how to convert any
efficient adversary A that succeeds in breaking
the construction with non-negligible probability
• into an efficient algorithm A’ succeeds in solving
the problem that was assumed to be hard.
20
Proofs by Reduction
To do this:
1. Fix some adversary A that succeeds in breaking
a crypto construction  with probability ο₯(n).
2. Construct an algorithm A’ (the reduction) that
attempts to solve problem X using adversary A as
a subroutine.
3. Given some instance x of X, algorithm A’ simulates
for A an instance  of  such that: If A can break
 then A’ can break x with probability
1
𝑝(𝑛)
.
4. Adversary A’ gives instance  to A to break. Then
ο₯(𝑛)
A’ can solve instance x with probability
𝑝(𝑛)
21
Proofs by Reduction
Instance  of 
Solution to x
Break
22
Computationally Secure
Encryption
(π‘š)
23
Computationally Secure
Encryption
24
Computationally Secure
Encryption
25
Computationally Secure
Encryption
Equivalent version:
| Pr[PrivK eav 𝐴′ , Р𝑛, 0 = 1]
- Pr PrivK eav 𝐴′ , Р𝑛, 1 = 1 | ≤ negl(𝑛)
26
Computationally Secure
Encryption
and π‘š is chosen uniformly at random
from {0,1}𝑛 .
27
Theorem
Let (Gen,Enc,Dec) be a private-key encryption
scheme that has indistinguishable encryptions in
the presence of an eavesdropper. Then
ο€’ PPT adversaries 𝐴, any 𝑖 there is a negligible
function negl such that:
Pr[𝐴
1𝑛 , πΈπ‘›π‘π‘˜ (π‘š)
=
π‘šπ‘–
1
≤ + negl 𝑛 ,
2
where π‘š is chosen randomly from {0,1}𝑛 , and the
probability are taken over the random coins of 𝐴, the
choice of π‘š and π‘˜ and any random coins used in the
encryption process.
28
Proof of Theorem
We shall reduce the problem
“indistinguishability of the bits of
encrypted messages”
to the problem
“indistinguishability of the encryptions of
the messages”
in the presence of an eavesdropper.
29
Security reduction: converting an
adversary A ′ to an adversary A
Algorithm A ′ (low level reference problem X)
Adversary A
Protocol Π, being analyzed
π‘–π‘›π‘ π‘‘π‘Žπ‘›π‘π‘’ π‘₯ π‘œπ‘“ 𝑋
π‘–π‘›π‘ π‘‘π‘Žπ‘›π‘π‘’  π‘œπ‘“ Π
Suppose A succeeds
in solving with
advantage πœ€ 𝑛
The reduction shows
that A ′succeeds in solving
x with advantage at least
πœ€ 𝑛
π‘ π‘œπ‘™π‘’π‘‘π‘–π‘œπ‘› π‘‘π‘œ π‘₯
π‘ π‘œπ‘™π‘’π‘‘π‘–π‘œπ‘› π‘‘π‘œ Π
30
Proof, in detail
Let the advantage of 𝐴 be
πœ€′ 𝑛 = Pr 𝐴(Encπ‘˜ π‘š = π‘šπ‘– −
1
2
.
Let 𝑖 ≤ 𝑛, and 𝐼0𝑛 be the set of strings of length 𝑛 whose
𝑖-th bit is 0 and 𝐼1𝑛 be the set of strings of length 𝑛 whose
𝑖-th bit is 1.
Take π‘šπ‘ ∈ 𝐼𝑏𝑛 . Then
Pr 𝐴(Encπ‘˜ π‘šπ‘ = 𝑏 = Pr PrivK eav 𝐴′ ,  𝑛 = 1 =
1
2
+πœ€ 𝑛 ,
(πœ€ 𝑛 negligible)
1
=
2
Pr 𝐴 πΈπ‘›π‘π‘˜ π‘š0
𝑏=0
1
=0 +
Pr 𝐴 πΈπ‘›π‘π‘˜ π‘š1
𝑏=1
2
=1
= Pr[𝐴(πΈπ‘›π‘π‘˜ π‘š ) = π‘šπ‘– ]
Then πœ€′ = πœ€
31
Proof of theorem– by reduction
Algorithm A’ (message distinguisher)
Adversary A (bit distinguisher)
1𝑛
1𝑛
π‘š0 , π‘š1
π‘š0 , π‘š1
𝑐𝑏
𝑐𝑏
Suppose A succeeds
with advantage πœ€ 𝑛 in
distinguishing the
i-th bit of encrypted
messages
𝑏′
𝑏′
prediction of
the message
prediction of
the value of
the i-th bit
32
Semantic Security, Intro
Theorem. Let (Gen,Enc,Dec) be a private-key encryption
scheme that has indistinguishable encryptions in the
presence of an eavesdropper. Then,
ο€’ PPT adversary 𝐴, ∃ a PPT algorithm A’ such that,
ο€’ polynomial-time computable functions 𝑓 and sampleable
sets 𝑆 there is a negligible function negl(𝑛) such that:
|Pr 𝐴 1𝑛 , πΈπ‘›π‘π‘˜ π‘š
=𝑓 π‘š
− Pr 𝐴′ 1𝑛 = 𝑓 π‘š
≤
1
2
+ negl 𝑛 ,
where the first probability is taken over uniform choice
of π‘˜ πœ– {0,1}𝑛 and π‘š πœ– 𝑆, that randomness of A, and the
randomness of 𝐸𝑛𝑐 , and the second probability is taken
over uniform choice of π‘š πœ– 𝑆 and the randomness of A’.
33
Semantic Security: Definition
A private-key encryption scheme (Gen,Enc,Dec) is semantically
secure in the presence of an eavesdropper if
ο€’ PPT algorithm 𝐴, ο€€ PPT 𝐴′ such that,
ο€’ PPT algorithm Samp and polynomial-time computable functions
𝑓, β„Ž the following is negligible:
|Pr 𝐴 1𝑛 , πΈπ‘›π‘π‘˜ π‘š , β„Ž π‘š
=𝑓 π‘š
Pr 𝐴′ 1𝑛 , π‘š , β„Ž π‘š
−
= 𝑓 π‘š |,
where π‘š is the output of Samp (1𝑛 ), and the probabilities are taken over
the choices of π‘š, π‘˜, the random coins of 𝐴, 𝐴′.
34
Semantic Security: Theorem
A private-key encryption scheme has
indistinguishable encryptions in the
presence of an eavesdropper if and only if,
it is semantically secure in the presence of
an eavesdropper.
35
Download