Basic key exchange
As we all know, the key between the receivers and senders is a difficult problem which make us confused. So early years , the cryptologists had already thinked that everyone would have others’ keys in a key cycle, such as the figure 1:
Obviously, from the fig.1,we learn that the method of saving others’ keys are inefficient, every user have O(n) keys.
Then, there is an another ways which we can use the third party—**Online trusted third Party(TTP)**By this way, every user only remembers one key(fig.2).
there is no doubt that the TTP obeys a toy protocol.Suppose Alice wants a shared key with Bob.At the beginning ,Alice send the messages and her keys to TTP,then TTP choose random key -
kab
k
a
b
, TTP would send the E(
ka
k
a
,”A,B”||
kab
k
a
b
),same as Bob be a sender.(E,D) is CPA secure, that means eavesdropper learns nothing about
kab
k
a
b
.But at the same time, we think that it is insecure against active attacks.
Here we need to review what is CPA.
CPA-chosen plaintext attack
The attacker send some plaintext to encryption oracle.The oracle will encrypt these messages ,then send results to adversary.By the way the adversary can learn about keys and use these keys to encrypt any messages what he want.Such as he sends two different messages to oracle, then oracle will encrypt one of them.If the adversary guesses which the encrypted plaintext is, that means the attack is successful.
Why we said that the TTP is CPA secure?
Because when the Alice(sender) send message to Bob,Bob never know anything about Alice’keys.What the adversary only knows possibly is any keys of TTP.So we think that TTP motion is CPA secure.
NOW we review what the active attacks means
active attack is a broad concept.There are many attacks, such as replay attacks, DOS.
Why we said that TTP is insecure against replay attacks?
Because attacker can record session between Alice and merchant Bob.For example Alice wants to buy a book,when Bob receives Alice’s request, he would response the answer with a book.But, during this process, attacker can record session. And attacker could pretend be Alice to get the same book(Attacker replays session to Bob), finally Bob thinks Alice is ordering another copy of book.So we said that TTP is insecure against replay attacks.
Now we think about another method so that we do not need to depends on an online trusted third party.Since 1970s the public-key cryptography is got attention.There are mainly Merkle(1974),Diffie-Hellman(1976) and RSA(1977) in this field.Now we will describe it in detail.
Merkle Puzzles
The idea is mainly Puzzles.For example:E(k,m) is a symmetric system with k∈{0,1}128 k ∈ { 0 , 1 } 128 .And we define
Although Merkle Puzzles had already solved the problem that depending on online trusted third party, quadratic gap( O(n2) O ( n 2 ) ) is not secure enough to against attacks.And while we can’t figure out a better gap to solve the problem, roughly speaking, quadratic gap is possible if we treat cipher as a black box oracle.
The Diffie-Hellman protocol
Now we consider exponential gap.The idea using prime concept is described as follows:
Suppose a fixed large prime p(e.g. 600 digits), a fixed integer g in
{1,...,p}
{
1
,
.
.
.
,
p
}
.
Now Alice selects a integer a in
{1,...,p−1}
{
1
,
.
.
.
,
p
−
1
}
, then she sends
ga mod p
g
a
m
o
d
p
to Bob, and Bob select a integer b in
{1,...,p−1}
{
1
,
.
.
.
,
p
−
1
}
,the he sends
gb mod p
g
b
m
o
d
p
to Alice.And how to determine the shared key.That is
gab mod p
g
a
b
m
o
d
p
.
Proof:
Why we said the DH protocol is secure?
Here we don’t discuss the adversary’s attack, The idea that DH protocol is secure can be thought that for attacker it will pay a huge price. For example , if p is a n bits long,the cost of computing D(ga,gb)=gab mod p D ( g a , g b ) = g a b m o d p is about eO(n√3) e O ( n 3 ) .(Warning : n‾√3 n 3 has coefficient).But because of the increase of the cipher key size, the modulus size is also increased.So for module size oversized question, we introduce elliptic curves.But the protocol is insecure against man-in-the-middle attack(active attacks).
Insecure against man-in-middle
Suppose Alice sends ga g a to Bob,but when adversary obtains the result he will change into ga′ g a ′ and send it to Bob.Then Bob sends gb g b to Alice,the adversary will change into gb′ g b ′ and send it to Alice.The first process the adversary gets ga′b g a ′ b ,the next process the adversary gets gab′ g a b ′ .So we said that the DH protocol can not against man-in-middle.
Public-key encryption
we define that a public-key encryption system is a triple of algorithms(G,E,D).
G(): randomized alg.outputs a key pair(pk,sk)(public key,private key)
E(pk,m):randomized alg.that takes
m∈M
m
∈
M
and output
c∈C
c
∈
C
D(sk,c): randomized alg.that takes
c∈C
c
∈
C
and output
m∈M
m
∈
M
or
⊥
⊥
And the property of public-key encryption is concistency:
The process can be described as follows:
Alice sends pk and message m to Bob,then Bob encrypts m by using pk.Finally,Bod sends the result to Alice, and Alice would decrypt it by using sk.
But public-key encryption is insecure against man in the middle attack.The principle is similar to the DH protocol mentioned above.