---
title: "PGP authentication and confidentiality"
subject: "Internet and Intranet"
chapter: 3
key: "semester_8/internet_and_intranet:pgp-authentication-confidentiality"
source: https://www.bctengineer.com/q/semester_8/internet_and_intranet/pgp-authentication-confidentiality
site: BCT Engineering
---

# PGP authentication and confidentiality

Internet and Intranet · Chapter 3: Protocols and Client/Server Applications

- Asked in: 2074 Bhadra, 10 marks
- Video: [#52 Pretty Good Privacy ( PGP ) - working, cases in PGP |CNS|](https://www.youtube.com/watch?v=XICDWB06VG4) — Trouble- Free
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_8/internet_and_intranet/pgp-authentication-confidentiality
- Whole chapter: https://www.bctengineer.com/md/semester_8/internet_and_intranet/chapter-3

## Question

What is PGP? Explain the operation of PGP for authentication and confidentiality with necessary diagrams.

## Short answer

PGP is a public-key program providing email confidentiality and authentication. For authentication, the sender signs a hash with the private key; the receiver verifies with the sender's public key. For confidentiality, a random session key encrypts the message, and that key is encrypted with the receiver's public key.

## Answer

#### What is PGP?

**PGP (Pretty Good Privacy)** is a public-key based security program, written by Phil Zimmermann, that provides confidentiality, authentication, integrity and compression for e-mail and files. It combines symmetric encryption (fast), public-key encryption (key exchange and signatures) and hashing. Its open standard form is OpenPGP (RFC 4880).

Algorithms commonly used:

- Hash: SHA-1 / SHA-256 (older: MD5)
- Signature: RSA or DSS
- Symmetric cipher: CAST-128, 3DES, IDEA or AES
- Key exchange: RSA or Diffie-Hellman/ElGamal

Notation: KS = one-time session key, KRa / KUa = private / public key of A, H = hash, EP / DP = public-key encrypt / decrypt, EC / DC = symmetric encrypt / decrypt, Z = ZIP compression, || = concatenation.

#### PGP authentication (digital signature)

Goal: the receiver is sure who sent the message and that it was not altered.

**Sender A**
1. Compute the hash (message digest) of message M: H(M).
2. Encrypt the digest with A's **private key** KRa. This is the signature.
3. Attach the signature to M, compress the whole with ZIP and send.

**Receiver B**
1. Decompress.
2. Decrypt the signature using A's **public key** KUa to get the digest.
3. Compute H(M) of the received message and compare. If equal, the message is authentic (only A has KRa) and unaltered.

```text
SENDER A
 M --+--> [Hash H] --> [Encrypt KRa] --+
     |                                 v
     +-------------------------> [ M || Sig ]
                                       |
                                  [ZIP  Z]
                                       |
                                       v  to B
RECEIVER B
 [Unzip] --> M, Sig
   Sig --> [Decrypt KUa] --> digest1
   M   --> [Hash H]      --> digest2
   digest1 == digest2 ?  yes: authentic
```

#### PGP confidentiality (encryption)

Goal: only the intended receiver can read the message.

**Sender A**
1. Compress M (Z) to reduce size and remove patterns.
2. Generate a random one-time **session key KS** (128-bit).
3. Encrypt the compressed message with KS using a symmetric cipher.
4. Encrypt KS with B's **public key** KUb.
5. Send the encrypted message plus encrypted KS.

**Receiver B**
1. Decrypt KS using B's **private key** KRb.
2. Decrypt the message with KS.
3. Decompress to get M.

```text
SENDER A
 M --> [ZIP] --> [Sym Encrypt, KS] --+
                        ^            |
 random KS -------------+            v
    |                           [ EKS(M) || EKUb(KS) ]
    +--> [Encrypt KUb] -------------^      |
                                           v  to B
RECEIVER B
 EKUb(KS) --> [Decrypt KRb] --> KS
 EKS(M)   --> [Sym Decrypt KS] --> [Unzip] --> M
```

The session key is used because public-key encryption of long data is very slow, and a fresh key per message limits damage if one key leaks.

#### Both together

Normally the sender first signs (hash + KRa), then compresses, then encrypts with KS, and finally encrypts KS with KUb. The receiver reverses the order. Finally the result is converted to ASCII using **Radix-64** so it can pass through SMTP.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. In PGP authentication, what does the sender A encrypt with her private key KRa?
   A. The whole message M
   B. The hash (digest) of M
   C. The one-time session key KS
   D. B's public key
   Answer: B. A hashes M and encrypts only the digest with KRa; this encrypted digest is the digital signature. (Key point: Signature creation)

2. How does B conclude the message is authentic and unaltered?
   A. The decrypted digest (using KUa) equals the hash B computes from the received message
   B. B decrypts the message with his own private key KRb
   C. The ZIP decompression succeeds
   D. The session key decrypts correctly
   Answer: A. B decrypts the signature with A's public key and compares it to H(M) of the received message; equality proves origin (only A has KRa) and integrity. (Key point: Signature verification)

3. Why does PGP encrypt the message with a one-time session key KS instead of directly with B's public key?
   A. Public-key encryption cannot be decrypted by B
   B. Public-key encryption of long data is very slow, so a fast symmetric key is used and only KS is public-key encrypted
   C. The session key provides the digital signature
   D. ZIP requires a symmetric key
   Answer: B. Symmetric encryption is fast for bulk data; public-key encryption is used only for the short key KS. A fresh key per message also limits damage if a key leaks. (Key point: Session key in confidentiality)

4. When PGP provides both services, what is the correct sender order?
   A. Encrypt, compress, sign
   B. Compress, sign, encrypt
   C. Sign, compress, encrypt with KS, then encrypt KS with KUb
   D. Encrypt KS with KRa, hash, compress
   Answer: C. The sender signs first, then compresses, encrypts with KS, and finally encrypts KS with KUb; Radix-64 conversion follows so it can pass through SMTP. (Key point: Order of operations)

## Related in other subjects

- [CMOS switch operation](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Acmos-switch) — Basic Electronics Engineering, chapter 3
- [JK flip-flop operation and truth table](https://www.bctengineer.com/question.md?key=semester_2%2Fbasic_electronics_engineering%3Ajk-flip-flop) — Basic Electronics Engineering, chapter 6
- [n-channel depletion MOSFET operation](https://www.bctengineer.com/question.md?key=semester_1%2Ffundamental_of_electrical_and_electronics_engineering%3Adepletion-mosfet-operation) — Fundamental of Electrical and Electronics Engineering, chapter 5
- [DIAC drawback; TRIAC four-quadrant operation](https://www.bctengineer.com/question.md?key=semester_4%2Fadvanced_electronics%3Adiac-drawback-triac-quadrants) — Advanced Electronics, chapter 7
