NSP Module 2 PGP Only
NSP Module 2 PGP Only
Module 2
Email Security- PGP and S/MIME
• Email is one of the most widely used and regarded network services
• Currently message contents are not secure
– may be inspected either in transit
– or by suitably privileged users on destination system
• Confidentiality
– protection from disclosure
• Authentication
– of sender of message
• Message integrity
– protection from modification
• Non-repudiation of origin
– protection from denial by sender
Email Security
• There are two main schemes which are especially designed to provide confidentiality and
authentication for electronic mail systems.
• These are:
1 Pretty good privacy (PGP)
2 Secure/Multipurpose Internet Mail Extension (S/MIME)
2. PGP – Confidentiality
a. Sender generates message and 128-bit random number as session key for it
b. Encrypt message using CAST-128 / IDEA / 3DES with session key
c. Session key encrypted using RSA with recipient's public key and attached to message
d. Receiver uses RSA with private key to decrypt and recover session key
e. Session key is used to decrypt message
3. PGP – Confidentiality & Authentication
• Can use both services on same message
1. Create signature & attach to message
2. Encrypt both message & signature
3. Attach RSA/ElGamal encrypted session key
• Plaintext message and signature are encrypted by using CAST-128/IDEA/3-DES. And session
key encrypted using RSA
4. PGP – Compression
• By default PGP compresses message after signing but before encrypting
– It stores uncompressed message & signature for later verification
– Algorithm is non deterministic
• Message encryption applied after compression to strengthen security, compressed message
are less redundant than plain text
• Uses ZIP compression algorithm
• PGP provides service of converting raw 8-bit binary stream to a stream of printable ASCII
characters
• Each group of three octets of binary data is mapped into 4 ASCII characters
• The scheme used is radix-64 conversion
• On receiver side, the incoming block is first converted back to 8-bit octet binary format
• Printable Encoding of binary data into radix-64 format
• E-mail systems often restricted the maximum message length to 50,000 octets
• The receiver strips o all e-mail headers and reassemble the block
PGP Notation
𝐾 = session key used in symmetric encryption scheme
EP = public-key encryption
DP = public-key decryption
EC = symmetric encryption
DC = symmetric decryption
H = hash function
|| = concatenation
PGP retrieves the senders private key from the private key ring using your’_user ID as an
index
PGP asks the user for the passphrase, to recover the unencrypted private key
PGP retrieves the recipients public key from the public key ring using her_ userID as an index
PGP retrieves receivers private key from the private key ring using the key ID field in the
session key component.
PGP asks the user for the passphrase to recover unencrypted private key.
PGP then recovers the session key & decrypts the message.
PGP retrieves senders public key from public key ring using the keyID field in the signature
key component of the message as an index.
PGP computes the message digest for the received message & compares it to the
transmitted message digests to authenticate.
2. Public key
3. Private key
• Each session key is associated with a single message and is used only for the purpose of
encrypting and decrypting that message.
• Need a session key for each message of varying sizes: 56-bit DES, 128-bit CAST or IDEA, 168-
bit Triple-DES
• The plaintext input to random number generator consist of two 64-bit blocks, it is derived
from stream of 128-bit randomized numbers
2 -key ID’s are used in any PGP message that provides Authentication & Confidentiality
These keys needs to be stored and organized in a systematic way for efficient & efficient use
by all parties
– Public-key ring : contains all the public-keys of other PGP users known to this user,
indexed by key ID
– Private-key ring : contains the public/private key pair(s) for this user, indexed by key
ID & encrypted key from a hashed passphrase
• Key Id: The least significant 64 bits of the public key (for this entry).
• User Id: User may have a different name with each pair. (may use the same id more than
once.)
Private key encypted using CAST- 128 & then stored in key ring.
2. When system generates a new public/private key pair, it asks the user for a passphrase.
3. Using SHA-1, a 160 bit hash code is generated from the password. //password
discarded//
4. System encrypts the private key using 128 bits of the hash as the key. //hash code is
then discarded//
> Decrypts the encrypted private key using CAST-128 (with the hash code)
• Key ID: The least significant 64 bits of the public key (for this entry).