3-17 Public Key Cryptography
Announcements
Exam results are available. Papers can be picked up from the office immediately after class or on Wednesday.
Undergraduate student performance will not be discussed due to the small sample size.
Graduate student class average: , highest score: , lowest score: .
The instructor was hoping for a class average closer to .
Drop deadline is next week on Thursday.
Assignment 2 will be returned before the end of the week.
The instructor will attempt to return Assignment 3 (theory part) before the drop deadline but cannot guarantee it.
Due to low performance, curving may be considered but will be marginal.
Assignment 4 was given out last week and is due two weeks from today. It is expected to be relatively easy, especially the programming part, as it is a known plaintext attack.
Transition to Public Key Cryptography
The course will now focus on public key cryptography after the spring break.
Assignments will involve implementation rather than breaking cryptosystems.
Private Key Cryptography
Private key cryptography involves two parties (Alice and Bob) sharing a secret key in advance.
Alice uses to encrypt the message, and Bob uses the same key to decrypt.
The security relies on keeping secret.
The cryptography system is assumed to be known to the opponent, only the key is private.
From "year minus infinity to ," all cryptosystems were private key systems, despite varying methods and principles.
Knowing the key means knowing both encryption and decryption methods.
Examples of Private Key Cryptosystems:
Shift Cipher:
Encryption:
Decryption:
Affine Cipher:
Key:
Encryption:
Decryption:
Hill Cipher:
Key: Matrix
Encryption: Multiply plaintext by matrix
Decryption: Multiply by
DES (Data Encryption Standard):
Encryption involves rounds using keys to , deterministically generated from a master key.
Decryption also involves rounds but uses the keys in reverse order: to .
Crucial Point: Knowing the encryption key implies knowing all round keys, thus enabling decryption.
New Directions: The Advent of Public Key Cryptography
In , Diffie and Hellman introduced the idea of public key cryptography in their paper "New Directions in Cryptography."
They proposed the possibility of making the encryption rule public while keeping the decryption rule private.
The core concept: Anyone can encrypt a message, but only the intended recipient can decrypt it.
This was a drastic paradigm shift, breaking the age-old tradition that knowing how to encrypt also meant knowing how to decrypt.
Public Key Cryptosystem Concept
Encryption rule can be made public, but the decryption rule remains private.
This is the fundamental concept of public key cryptography.
Main Advantages of Public Key Cryptosystems
Eliminates the need for prior secret key exchange between communicating parties.
Enables secure communication with strangers, opening up e-commerce possibilities.
Analogy:
Private Key Model: Box with a padlock; Alice locks and sends the box to Bob, who uses the same key to unlock it. The bad guy intercepts the box but cannot open it because he doesn't have the key. In this model, Alice and Bob must exchange a copy of the same key before communicating.
Public Key Model: Number lock where anyone can lock the lock without knowing the combination, but only the owner (Bob) knows the combination to open it. This achieves separation between encryption and decryption operations.
Public Key Cryptosystem: Keys
Every user has a pair of keys: a public key and a private key.
Public Key: Used for encryption and known to everyone (, , , etc.).
Private Key: Used for decryption and kept secret (, , , etc.).
If Alice wants to send a message to Bob, she encrypts it using Bob's public key (), creating ciphertext .
If Alice wants to send the same message to Charlie, she uses Charlie's public key (), creating ciphertext .
A public directory contains everyone's names and public keys.
The key idea is to separate this encryption from the decryption.
Important Distinction
Simply having two separate keys (encryption key, decryption key) is not enough.
It should not be possible to efficiently compute the decryption key from the knowledge of the encryption key.
Ability to hide the decryption key from the encryption key is important.
Public Key Distribution
Two models:
Centralized: User generates key pair (, ) and sends to a server, which maintains a directory. Bob retrieves Alice's public key from the server.
Grassroots: Alice directly gives her public key to anyone she wants to communicate with.
Assumption: No active adversary modifies the public key during dissemination.
Attacker knowing is not a security problem since it's public. Modification of the key is an issue.
Cryptography Concerns and Solutions
Two fundamental concerns:
Secrecy (Confidentiality)
Integrity
Solutions:
Private Key Setting:
Secrecy: Private key encryption.
Integrity: Message Authentication Code (MAC).
Public Key Setting:
Secrecy: Public key encryption.
Integrity: Digital Signature Scheme.
The course will now focus on the public key encryption and digital signature schemes.
How Public Key Cryptography Addresses Drawbacks of Private Key
Drawbacks of Private Key Cryptography:
Key distribution problem: Secret agreement on the key is needed.
Key management problem: users require keys.
Public Key Cryptography Advantages:
No key distribution problem: Keys can be distributed publicly.
Simplified key management: Linear number of keys instead of quadratic.
Enables communication with strangers.
Public Key Cryptography: Stronger than Private Key
Public key cryptography can do everything that private key cryptography can do.
Private key cryptosystems cannot provide the ability to communicate without a pre-order agreement.
However, public key systems are significantly SLOWER than private key ones.
Why Study Private Key Cryptography?
Speed: Public key systems are much slower (two-three orders of magnitude) than private key systems.
Communication Overhead: Also need high communication.
Using Hybrid Encryption: For sending a long message, encrypt the message using a fast private key cryptosystem (DES). Encrypt the DES key using a public key cryptosystem. Send the encrypted key along with the encrypted message.
Public Key Encryption Model
Alice generates a public key and a private key.
Alice makes the public key known.
Bob gets Alice's Public Key.
Bob sends the ciphertext to Alice, who uses her private key to decrypt.
Technical Definition of a Public Key Encryption Scheme
A public key encryption scheme consists of three spaces (plaintext space, ciphertext space, key space) and three algorithms (key generation, encryption, decryption).
Key Generation Algorithm: Takes as input (where dictates the security level) and outputs a public key and a secret key .
Encryption Algorithm: Transforms the plaintext into a ciphertext .
Decryption Algorithm: Takes a ciphertext and outputs a message .
Correctness: If we take any message encrypted with Alice's public key, and Alice decrypts it with her own secret key, then at any cost we should get the message back: .
Impossibility of Unconditional Security in Public Key Cryptography
Public key cryptosystems cannot provide unconditional security.
Given a ciphertext, an attacker can encrypt every possible plaintext using the public key until a match is found.
Building a Public Key Cryptosystem: Trapdoor One-Way Functions
One Way Function: easy to compute in the forward direction, but difficult to compute in the backward direction.
Given , it should be easy to compute , the encryption of .
Given , it should be difficult to compute .
A function from plaintext space to ciphertext space .
Easy to compute means polynomial time computable; difficult to compute means no polynomial time algorithm should exist for backward computation.
It does not matter if one way function really exists.
Functions
One Way Function: Real Life: Smashing glass, breaking jigsaw puzzles, building a reputation.
A one way function is forward easy to compute, backward it's tough to compute—that's what a one way function is.
This one way function should ideally be polynomial time computable, but determining if something is a one way function remains an open problem, particularly related to the P versus NP problem, which is a significant open problem in computer science.
Trapdoor One-Way Functions are Necessary
We require that given , it should be difficult to figure out the .
However, with trapdoor information (special information only the intended recipient has), should be easily computable from —normally it is difficult to compute but with the trapdoor, it becomes easy.