ECS401: Cryptography and Network Security
ECS401: Cryptography and Network Security
Network Security
2
Pretty Good Security
Phil Zimmerman is the father of the Pretty Good Privacy (PGP) protocol. He is credited with the creation of
PGP.
The most significant aspects of PGP are that it supports the basic requirements of cryptography, is quite
simple to use, and is completely free, including its source code and documentation.
Moreover, for those organizations that require support, a low-cost commercial version of PGP is available
from an organization called Viacrypt (now Network Associates).
PGP has become extremely popular and is far more widely used, as compared to PEM. The email
cryptographic support offered by PGP is shown in Figure 1.
As shown, PGP
In PGP, the sender starts with a digital
of the message signature, which is
needs to include The broad-level followed by
the identifiers of steps in PGP are compression, then
the algorithm used illustrated in Figure by encryption,
in the message, 2. then by digital
along with the enveloping and
value of the keys. finally, by Base-64
encoding.
Signature only
(Steps 1 and 2)
Signature, Encryption,
Enveloping, and Base-64
encoding (Steps 1 to 5)
Figure 2: PGP operations
5
Security options using PGP
Notation
6
The Working of PGP
Let us discuss the five steps in PGP now. Note that the receiver has to perform these four steps in the reverse direction to
retrieve the original plain text email message.
8
The Working of PGP
Step 3: Encryption Step 4: Digital Enveloping
• In this step, the compressed output of • In this case, the symmetric key used for
step 2 (i.e. the compressed form of the encryption in step 3 is now encrypted
original email and the digital signature with the receiver’s public key. The
together) are encrypted with a output of step 3 and step 4 together
symmetric key. For this, generally the form a digital envelope. This is shown in
IDEA algorithm in CFB mode is used. Figure 4.
9
Figure 4: Formation of digital envelope
The Working of PGP
Step 5: Base-64 encoding
• The output of step 4 in Base-64 is
encoded now.
Thus, part or all of the resulting block consists of a stream of arbitrary 8-bit octets. However, many electronic mail systems
only permit the use of blocks consisting of ASCII text.
To accommodate this restriction, PGP provides the service of converting the raw 8-bit binary stream to a stream of printable
ASCII characters. 10
The Working of PGP
Step 5: Base-64 encoding
• The use of radix 64 expands a message by 33%. Fortunately, the session key and signature portions of the message are
relatively compact, and the plaintext message has been compressed.
• In fact, the compression should be more than enough to compensate for the radix-64 expansion. For example, literature
reports an average compression ratio of about 2.0 using ZIP. If we ignore the relatively small signature and key
components, the typical overall effect of compression and expansion of a file of length would be . Thus, there is still an
overall compression of about one-third.
• One noteworthy aspect of the radix-64 algorithm is that it blindly converts the input stream to radix-64 format regardless
of content, even if the input happens to be ASCII text. Thus, if a message is signed but not encrypted and the conversion is
applied to the entire block, the output will be unreadable to the casual observer, which provides a certain level of
confidentiality.
• As an option, PGP can be configured to convert to radix-64 format only the signature portion of signed plaintext messages.
This enables the human recipient to read the message without using PGP. PGP would still have to be used to verify the
signature.
14
PGP Algorithms
PGP supports a number of algorithms. The most common of them are listed in Figure 5.
Figure 5: PGP
algorithms
15
Key Rings
In other words, every PGP user needs to have two sets of key rings:
A ring of her own public-private key pairs, and A ring of the public keys of other users.
16
Key Rings
Note that in one of the
key rings, Alice maintains
a set of key pairs; while Obviously, she cannot Similarly, other users in a
The concept of key rings
in the other, she just have the private keys of PGP system will have
is shown in Figure 5.
maintains the public the other users. their own two key rings.
keys (and not key pairs)
of other users.
18
Key Rings
There would be two possible situations:
19
Key Rings
II. Now suppose that Alice has received a message from one of the other users in the system.
20
Key Rings
II. Now suppose that Alice has received a message from one of the other users in the system.
21
PGP Certificates
22
PGP Certificates
Atul can sign the
certificate for Ana, Jui, Harsh may fully trust Atul,
Harsh, and so on. There is For example, Jui may have but not Anita! Hence,
Hence, if Harsh wants to
no hierarchy of trust, or a a certificate signed by there can be multiple
verify Jui’s certificate, he
treelike structure. This Atul, and another one by paths in the line of trust
has two paths: Jui <174>
creates a situation where Anita. This is shown in from a fully or partially
Atul, and Jui <174> Anita.
a user can have Figure 6. trusted authority to a
certificates issued by certificate.
different users.
23
Figure 6: Anyone can issue certificates to anyone else in PGP
PGP Certificates
The equivalent of CA (i.e. a user who issues certificates) in PGP is called an
introducer.
Introducer trust
Key legitimacy
24
Introducer Trust
We have mentioned that there is no concept of a hierarchical CA structure in PGP. Hence, it is natural that the ring of trust
in PGP cannot be very large, if every user has to trust every other user in the system.
To resolve this issue, PGP provides for multiple levels of trust. The
number of levels depends on the decision of implementing PGP
in a certain way. However, for simplicity, let us say that we have
decided to implement three levels of trust to an introducer.
In real life, we do
not fully trust
everyone we know. Let us call none
Do we? these levels as
partial
complete
25
Introducer Trust
The introducer trust then
specifies what level of trust
the introducer wants to
allocate to other users in the
system.
27
Figure 8: Certificate trust
Certificate Trust
Let us take another example to ensure that there is no confusion. Imagine that there is a set of users in the system.
Assume that Mahesh fully trusts Naren, partially trusts Ravi and Amol, and has no trust in Amit.
Interestingly, the legitimacy of a public key belonging to an entity has nothing to do with the trust level of that person.
For instance:
The earlier discussion To resolve this problem, several schemes are possible in PGP, as
outlined below.
leads to a potential
problem. What Mahesh can physically
happens if nobody obtain the public key of
Naren by meeting in This can be done
creates a certificate person and getting the telephonically as well.
for a fully or partially key on a piece of paper
trusted entity? or as a disk file.
31
Web of Trust
Both Naren and Mahesh compute a message digest of this key. If MD5 is used, the result is
a 16-byte digest. If SHA-1 is used, the result is a 20- byte digest. In hexadecimal, the digest
becomes a 32-digit value in MD5, and a 40-digit value in SHA-1. This is displayed as 8
groups of 4-digit values in MD5, or 10 groups of 4-digit values in SHA-1, and is called
fingerprint. Before Mahesh adds the public key of Naren to his ring, he can call up Naren to
Naren can email his public tell him what fingerprint value he has obtained to cross-check with the fingerprint value
key to Mahesh. that is separately obtained by Naren. This ensures that the public key value is not changed
in the email transit. To make matters better, PGP assigns a unique English word to a 4-digit
hexadecimal number group, so that instead of speaking out the hexadecimal string of
numbers, users can speak out normal English words, as defined by PGP. For example, PGP
may have assigned a word India to a hexadecimal pattern of 4A0B, etc.
32