Public Key Basics
Week 6: 2025-03-04
CH2.3 Public-Key Encryption and Decryption
Public Key Encryption: Keys are labeled with a subscript denoting the single party
they belong to. Each party has a key pair, one being the encryption public key and
the other being the decryption private key. To encrypt a message using public-key
cryptography, the sender obtains the recipient's public key and uses it with a
public-key encryption algorithm to convert the message into ciphertext. The
ciphertext is then sent to the recipient, who decrypts it using the corresponding
decryption algorithm and their private key.
The integrity (and authentication) of a public key is important.
Key Distribution: Symmetric vs Public Key. A symmetric-key system uses the
same shared key to encrypt and decrypt. The public-key (asymmetric) uses
distinct encrypt and decrypt keys, one public, one private. For communication
among n users, you need O(n^2) keys for symmetric, but you only need O(n) for
public key crypto.
Why don’t we just use public key crypto then…
It’s slow (in terms of processing and block size) and also the ciphertext is
larger than plaintext
Hashing/symmetric algorithms involve just bit shifting, so it’s possible to
optimize in the cpu
In practice, we use hybrid encryption
Hybrid Encryption: Combines the advantages of both symmetric-key and publickey encryption. This method is used because public-key cryptography is slow for
Public Key Basics
1
large messages, while symmetric-key encryption is much faster for bulk data
encryption.
How Hybrid Encryption Works:
A public-key algorithm (e.g., RSA) is used to encrypt a session key (a
randomly generated symmetric key).
The encrypted session key is sent to the recipient.
The recipient decrypts the session key using their private key.
The decrypted session key is then used with a symmetric-key algorithm
(e.g., AES) to efficiently encrypt and decrypt the actual message.
RSA Algorithm: Two random prime numbers, mashed together and that is your
public key. The private key is the factors that went into the multiplication.
Public Key Basics
2