17.1 Encryption, Encryption Protocols and Digital Certificates

Bulk view disabled for Guests. View lessons individually.

Asymmetric Encryption

1. Asymmetric Encryption

Unlike symmetric encryption (one key), asymmetric encryption uses a Key Pair. These keys are mathematically linked but cannot be derived from one another.

Public Key

Shared with everyone. Used by others to encrypt a message meant for you.

Private Key

Kept strictly secret by the owner. Used to decrypt messages encrypted with your Public Key.

2. Digital Signatures

A Digital Signature proves that a message hasn't been altered and that it definitely came from the sender (Non-repudiation).

The Signing Process:
  1. Sender creates a Hash of the message.
  2. Sender encrypts the hash using their Private Key.
  3. The message and the encrypted hash (the signature) are sent.
  4. Receiver decrypts the hash using the sender's Public Key and compares it to their own hash of the message.

3. Digital Certificates

How do you know a Public Key actually belongs to the person who claims it? You use a Digital Certificate issued by a Certificate Authority (CA).

  • Contains the owner's Name, Serial Number, Expiry Date, and Public Key.
  • Contains the Digital Signature of the CA to prove the certificate is valid.

4. SSL / TLS Handshake

This is what happens when you visit https://e-consult.co.ke:

  1. Browser requests a secure connection.
  2. Server sends its Digital Certificate (containing its Public Key).
  3. Browser verifies the certificate with a CA.
  4. Browser generates a random Session Key (symmetric), encrypts it with the server's Public Key, and sends it back.
  5. Server decrypts it with its Private Key. Both now use the Session Key for fast, encrypted communication.
⚠️ Blockchain Link:

In your SaaS voting system, every voter has a "Wallet Address," which is essentially a derived version of their Public Key. When they cast a vote, they sign the transaction with their Private Key. This proves the vote is authentic without revealing who they are!