Lecture 5
Lecture 5
Cryptosystems
In a confidential communication, the authenticity needs to be carefully established for the
two partners before sending any confidential information one needs to be sure to whom it
sends that information: authentication protocols.
A . Direct authentication
1.Based on a shared secret master key
2.Based on a public-key system
3.Diffie-Hellman
B . Mediated authentication
1.Based on key distribution centers
3.kerberos.
In this chapter we examined the problem of the distribution of secret keys. One of the
major roles of public-key encryption has been to address the problem of key distribution.
There are actually two distinct aspects to the use of public-key cryptography in this
regard:
1. The distribution of public keys
2. The use of public-key encryption to distribute secret keys
We examine each of these areas in turn.
1
send his or her public key to any other participant or broadcast the key to the community
at large
Although this approach is convenient, it has a major weakness. Anyone can forge such a
public announcement. That is, some user could pretend to be user A and send a public
key to another participant or broadcast such a public key. Until such time as user A
discovers the forgery and alerts other participants, the forger is able to read all encrypted
messages intended for A and can use the forged keys for authentication.
Public-Key Publication
2
This scheme is clearly more secure than individual public announcements but still has
vulnerabilities. If an adversary succeeds in obtaining or computing the private key of the
directory authority, the adversary could authoritatively pass out counterfeit public keys
and subsequently impersonate any participant and eavesdrop on messages sent to any
participant. Another way to achieve the same end is for the adversary to tamper with the
records kept by the authority.
Public-Key Authority
Stronger security for public-key distribution can be achieved by providing tighter control
over the distribution of public keys from the directory. A typical scenario is illustrated as
in Figure below. As before, the scenario assumes that a central authority maintains a
dynamic directory of public keys of all participants. In addition, each participant reliably
knows a public key for the authority, with only the authority knowing the corresponding
private key. The following steps (matched by number to Figure below) occur:
1. A sends a time stamped message to the public-key authority containing a request for
the current public key of B.
2. The authority responds with a message that is encrypted using the authority's private
key, PRauth Thus, A is able to decrypt the message using the authority's public key.
Therefore, A is assured that the message originated with the authority. The message
includes the following:
B's public key, PUb which A can use to encrypt messages destined for B
The original request, to enable A to match this response with the corresponding
earlier request and to verify that the original request was not altered before
reception by the authority
The original timestamp, so A can determine that this is not an old message from
the authority containing a key other than B's current public key
3. A stores B's public key and also uses it to encrypt a message to B containing an
identifier of A (IDA) and a nonce (N1), which is used to identify this transaction
uniquely.
4, B retrieves A's public key from the authority in the same manner as A retrieved B's
public key.
5. At this point, public keys have been securely delivered to A and B, and they may
begin their protected exchange. However, two additional steps are desirable:
6. B sends a message to A encrypted with PUa and containing A's nonce (N1) as well as a
new nonce generated by B (N2) Because only B could have decrypted message, the
presence of N1 in message assures A that the correspondent is B.
7. A returns N2, encrypted using B's public key, to assure B that its correspondent is A.
3
]
Thus, a total of seven messages are required. However, the initial four messages need be
used only infrequently because both A and B can save the other's public key for future
use, a technique known as caching. Periodically, a user should request fresh copies of the
public keys of its correspondents to ensure currency.
Public-Key Certificates
The scenario of above Figure is attractive, yet it has some drawbacks. The public-key
authority could be somewhat of a bottleneck in the system, for a user must appeal to the
authority for a public key for every other user that it wishes to contact. As before, the
directory of names and public keys maintained by the authority is vulnerable to
tampering.
In essence, a certificate consists of a public key plus an identifier of the key owner, with
the whole block signed by a trusted third party. Typically, the third party is a certificate
authority, such as a government agency or a financial institution, that is trusted by the
user community. A user can present his or her public key to the authority in a secure
manner, and obtain a certificate. The user can then publish the certificate. Anyone needed
this user's public key can obtain the certificate and verify that it is valid by way of the
attached trusted signature. A participant can also convey its key information to another
by transmitting its certificate. Other participants can verify that the certificate was created
by the authority. We can place the following requirements on this scheme:
1. Any participant can read a certificate to determine the name and public key of the
certificate's owner.
2. Any participant can verify that the certificate originated from the certificate
authority and is not counterfeit.
3. Only the certificate authority can create and update certificates.
1. Any participant can verify the currency of the certificate.
A certificate scheme is illustrated in the following Figure. Each participant applies to the
certificate authority, supplying a public key and requesting a certificate.
4
Exchange of Public-Key Certificates
A and B can now securely communicate using conventional encryption and the session
key Ks. At the completion of the exchange, both A and B discard Ks. Despite its
simplicity, this is an attractive protocol. No keys exist before the start of the
communication and none exist after the completion of communication. Thus, the risk of
compromise of the keys is minimal. At the same time, the communication is secure from
eavesdropping.
The protocol depicted in the above Figure is insecure against an adversary who can
intercept messages and then either relay the intercepted message or substitute another
message.
2. B sends a message to A encrypted with PUa and containing A's nonce (N1) as well as a
new nonce generated by B (N2) Because only B could have decrypted message (1), the
presence of N1 in message (2) assures A that the correspondent is B.
3. A returns N2 encrypted using B's public key, to assure B that its correspondent is A.
6
4. A selects a secret key Ks and sends M = E(PUb, E(PRa, Ks)) to B. Encryption of this
message with B's public key ensures that only B can read it; encryption with A's
private key ensures that only A could have sent it.
5. B computes D(PUa, D(PRb, M)) to recover the secret key.
Notice that the first three steps of this scheme are the same as the last three steps of the
above Figure. The result is that this scheme ensures both confidentiality and
authentication in the exchange of a secret key.
The Algorithm
The Diffie-Hellman key exchange algorithm. For this scheme, there are two publicly
known numbers: a prime number q and an integer that is a primitive root of q.
7
The result is that the two sides have exchanged a secret value as shown in Figure below.
The security of the Diffie-Hellman key exchange lies in the fact that, while it is relatively
easy to calculate exponentials modulo a prime, it is very difficult to calculate discrete
logarithms. For large primes, the latter task is considered infeasible.
8
Figure The Diffie-Hellman Key Exchange Algorithm
Here is an example. Key exchange is based on the use of the prime number q = 353 and a
primitive root of 353, in this case α = 3. A and B select secret keys XA = 97 and XB =
233, respectively. Each computes its public key:
A computes YA = 397 mod 353 = 40.
B computes YB = 3233 mod 353 = 248.
After they exchange public keys, each can compute the common secret key:
A computes = (YB)XA mod 353 = 24897 mod 353 =160.
K
B computes K = (YA)XB mod 353 = 40233 mod 353 = 160.
9
1. User Alice logs on to Authentication Server (AS) and requests service.
2. AS verifies user's access right in database, creates ticket-granting ticket and session
key. Results are encrypted using key derived from user's password.
3. User Alice uses password to decrypt incoming message, then sends ticket and
authenticator that contains user's name, network address, and time to Ticket Granting
Server (TGS).
4. TGS decrypts ticket and authenticator, verifies request, then creates ticket for
requested server (Bob).
6. Server verifies that ticket and authenticator match, then grants access to service.
10