CH 2
CH 2
CH 2
The first problem is that of key distribution:- key distribution under symmetric
encryption requires either (1) that two communicants already share a key, which
somehow has been distributed to them; or (2) the use of a key distribution center.
Whitfield Diffie, one of the discoverers of public-key encryption (along with Martin
Hellman, both at Stanford University at the time), reasoned that this second requirement
negated the very essence of cryptography: the ability to maintain total secrecy over your
own communication. As Diffie put it [DIFF88], “what good would it do after all to
develop impenetrable cryptosystems, if their users were forced to share their keys with a
KDC that could be compromised by either burglary or subpoena?”
The second problem that Diffie pondered, and one that was apparently unrelated to the
first, was that of digital signatures. If the use of cryptography was to become widespread,
not just in military situations but for commercial and private purposes, then electronic
messages and documents would need the equivalent of signatures used in paper
documents. That is, could a method be devised that would stipulate, to the satisfaction of
all parties, that a digital message had been sent by a particular person. This is a somewhat
broader requirement than that of authentication. Diffie and Hellman achieved an
astounding breakthrough in 1976 [DIFF76 a, b] by coming up with a method that
addressed both problems and was radically different from all previous approaches to
cryptography, going back over four millennia.
1
cryptography and ntk security 2 019/20
Either of the two related keys can be used for encryption, with the other used for
decryption.
A public-key encryption scheme has six ingredients (Figure 2.1):
Plaintext: This is the readable message or data that is fed into the algorithm as input.
Encryption algorithm: The encryption algorithm performs various transformations on
the plaintext.
Public and private keys: This is a pair of keys that have been selected so that if one is
used for encryption, the other is used for decryption. The exact transformations
performed by the algorithm depend on the public or private key that is provided as input.
Ciphertext: This is the scrambled message produced as output. It depends on the
plaintext and the key. For a given message, two different keys will produce two different
ciphertexts.
Decryption algorithm: This algorithm accepts the ciphertext and the matching key and
produces the original plaintext.
The essential steps are the following:
1. Each user generates a pair of keys to be used for the encryption and decryption of
messages.
2. Each user places one of the two keys in a public register or other accessible file. This is
the public key. The companion key is kept private. As Figure 2.1.a suggests, each user
maintains a collection of public keys obtained from others.
3. If Bob wishes to send a confidential message to Alice, Bob encrypts the message using
Alice's public key.
4. When Alice receives the message, she decrypts it using her private key. No other
recipient can decrypt the message because only Alice knows Alice's private key.
As long as a user's private key remains protected and secret, incoming communication is secure.
At any time, a system can change its private key and publish the companion public key to replace
its old public key.
2
cryptography and ntk security 2 019/20
Encryption/decryption: The sender encrypts a message with the recipient's public key.
Digital signature: The sender "signs" a message with its private key. Signing is achieved
by a cryptographic algorithm applied to the message or to a small block of data that is a
function of the message.
Key exchange: Two sides cooperate to exchange a session key. Several different
approaches are possible, involving the private key(s) of one or both parties.
Some algorithms are suitable for all three applications, whereas others can be used only for one
or two of these applications. RSA is suitable for all three applications. Table 2.1 indicates the
applications supported by some of public-key encryption algorithms
3
cryptography and ntk security 2 019/20
There are a large number of locations at which an attack can occur. Furthermore, for wide area
communications, many of these locations are not under the physical control of the end user. Even
in the case of local area networks, in which physical security measures are possible, there is
always the threat of the disgruntled employee.
4
cryptography and ntk security 2 019/20
The most powerful and most common approach to securing the points of vulnerability is
encryption. If encryption is to be used to counter these attacks, then we need to decide what to
encrypt and where the encryption gear should be located. There are two fundamental
alternatives: link encryption and end-to-end encryption.
With link encryption, each vulnerable communications link is equipped on both ends with an
encryption device. Thus, all traffic over all communications links is secured. One of its
disadvantages is that the message must be decrypted each time it enters a switch because the
switch must read the address (logical connection number) in the packet header in order to route
the frame. Thus, the message is vulnerable at each switch. If working with a public network, the
user has no control over the security of the nodes.
Several implications of link encryption should be noted. For this strategy to be effective, all the
potential links in a path from source to destination must use link encryption (See Figure 2.2
above). Each pair of nodes that share a link should share a unique key, with a different key used
on each link. Thus, many keys must be provided.
5
cryptography and ntk security 2 019/20
against attacks on the network links or switches. Thus, end-to-end encryption relieves the end
user of concerns about the degree of security of networks and links that support the
communication. There is, however, still a weak spot.
With end-to-end encryption, the user data are secure. However, the traffic pattern is not, because
packet headers are transmitted in the clear. On the other hand, end-to-end encryption does
provide a degree of authentication. If two end systems share an encryption key, then a recipient
is assured that any message that it receives comes from the alleged sender because only that
sender shares the relevant key. Such authentication is not inherent in a link encryption scheme.
To achieve greater security, both link and end-to-end encryptions are needed, as is shown in
Figure 2.2. When both forms of encryption are employed, the host encrypts the user data portion
of a packet using an end-to-end encryption key. The entire packet is then encrypted using a link
encryption key. As the packet traverses the network, each switch decrypts the packet, using a
link encryption key to read the header, and then encrypts the entire packet again for sending it
out on the next link. Now the entire packet is secure except for the time that the packet is actually
in the memory of a packet switch, at which time the packet header is in the clear.
Link encryption encrypts all the data along a End-to-end encryption, the headers, addresses,
specific communication path. Not only is the routing, and trailer information are not
user information encrypted, but the header, encrypted, enabling attackers to learn more
trailers, addresses, and routing data that are part about a captured packet and where it is headed.
of the packets are also encrypted.
All data are encrypted, including headers, Headers, addresses, and routing information
addresses, and routing information. are not encrypted, and therefore not protected.
All of the information is encrypted, and the The packets do not need to be decrypted and
packets must be decrypted at each hop so the then encrypted again at each hop, because the
router, or other intermediate device, knows headers and trailers are not encrypted.
where to send the packet next.
6
cryptography and ntk security 2 019/20
With the use of link encryption, network-layer headers (e.g., frame or cell header) are
encrypted, reducing the opportunity for traffic analysis. However, it is still possible in those
circumstances for an attacker to assess the amount of traffic on a network and to observe the
amount of traffic entering and leaving each end system. An effective countermeasure to this
attack is traffic padding.
Traffic padding produces ciphertext output continuously, even in the absence of plainext. A
continuous random data stream is generated. When plaintext is available, it is encrypted and
transmitted. When input plaintext is not present, random data are encrypted and transmitted. This
makes it impossible for an attacker to distinguish between true data flow and padding and
therefore impossible to deduce the amount of traffic.
One technique that might prove useful is to pad out data units to a uniform length at either the
transport or application level. In addition, null messages can be inserted randomly into the
stream. These tactics deny opponent knowledge about the amount of data exchanged between
end users and obscure the underlying traffic pattern.
Key Distribution
For symmetric encryption to work, the two parties to an exchange must share the same key, and
that key must be protected from access by others. Furthermore, frequent key changes are usually
desirable to limit the amount of data compromised if an attacker learns the key. Therefore, the
term that refers to the means of delivering a key to two parties who wish to exchange data,
7
cryptography and ntk security 2 019/20
without allowing others to see the key. For two parties A and B, key distribution can be achieved
in a number of ways, as follows:
A third party (so called key distribution center-KDC), whom all parties trust, can be used as a
trusted intermediary to mediate the establishment of secure communications between them (4).
They must trust intermediary not to abuse the knowledge of all session keys. As number of
parties grows, some variant of 4 is only practical solution to the huge growth in number of keys
potentially needed.
The use of a key distribution center is based on the use of a hierarchy of keys. At a minimum,
two levels of keys are used.
Communication between end systems is encrypted using a temporary key, often referred
to as a session key. Typically, the session key is used for the duration of a logical
connection and then discarded.
Master key is shared by the key distribution center and an end system or user and used to
encrypt the session key.
8
cryptography and ntk security 2 019/20
block size is i bits, where 2i< n ≤ 2i+1. Encryption and decryption are of the following form, for
some plain text block M and cipher text block C:
C = Me mod n
M = Cd mod n = (Me)d mod n = Med mod n
Both sender and receiver must know the value of n. The sender knows the value of e, and only
the receiver knows the value of d. Thus, this is a public-key encryption algorithm with a public
key of PU = {e, n} and a private key of PR = {d, n}. For this algorithm to be satisfactory for
public-key encryption, the following requirements must be met:
1. It is possible to find values of e, d, n such that Med mod n = M for all M < n.
2. It is relatively easy to calculate Me mod n and Cd mod n for all values of M < n.
3. It is infeasible to determine d given e and n.
For now, we focus on the first requirement and consider the other questions later. We need to
find a relationship of the form
Med mod n = M
The preceding relationship holds if e and d are multiplicative inverses modulo φ ( n ), where φ ( n )
is the Euler totient function. For p, q prime, φ ( pq ) = (p - 1)(q - 1). The relationship between e
and d can be expressed as
ed mod φ ( n )=1
This is equivalent to saying
ed 1 mod φ ( n )
d e-1 mod φ ( n )
That is, e and d are multiplicative inverses mod φ ( n ). Note that, according to the rules of modular
arithmetic, this is true only if d (and therefore e) is relatively prime to φ ( n ). Equivalently, gcd(
φ ( n ),d) = 1.
We are now ready to state the RSA scheme. The ingredients are the following:
Key Generation
9
cryptography and ntk security 2 019/20
Public key PU = { e , n }
Private key PR= { d , n }
Encryption
Plaintext : M <n
Cipher text : C=M mod n
e
Decryption
Cipher text : C
Plaintext : M =C mod n
d
10
cryptography and ntk security 2 019/20
11
cryptography and ntk security 2 019/20
12