Public Key Cryptography and Key Distribution
Administrative Concerns and Lecture Logistics
Accessing Recordings: There have been issues with the lecture recordings. Specifically, it was reported that Lecture 2 was a duplicate of Lecture 1. This error was discovered during a morning check of the system.
Material Sharing: Students are encouraged to talk with colleagues and share information among themselves while technical issues regarding system access and enrollment are being sorted out. The instructor permits students to attend lectures even if their enrollment process is not yet complete.
Audio Quality: Feedback from students who accessed recordings confirmed that the audio quality is acceptable, even though the remote microphone was not initially used.
Class Representative: A class representative was needed for standard student meetings. Steve volunteered to take the position. The instructor will provide the necessary registration forms next week.
Application of Public Key Cryptography in Session Key Sharing
Efficiency Considerations: Asymmetric encryption (Public Key Cryptography) is mathematically complex and computationally intensive. Therefore, it is considered inefficient and slow for transmitting large amounts of data over a long session. It is not suitable as a primary means of high-speed data transmission.
Primary Use Case: Asymmetric encryption is highly effective and acceptable for encrypting very small amounts of data. The most common use is the secure transmission of a session key, secret key, or master key.
Merkle’s Proposed Protocol: Merkle proposed a simple protocol for establishing a symmetric session key using a public key system: * generates a pair of public/private keys. * generates a pair of public/private keys. * sends a message to containing its identity () and its public key (). * generates a session key (), encrypts it using 's public key (), and sends it to . * Once the session key is established, both parties can eventually discard the temporary asymmetric keys.
Vulnerabilities: Man-in-the-Middle Attacks
Protocol Subversion: The simple protocol described by Merkle is vulnerable to a Man-in-the-Middle (MitM) attack.
The Identity Linkage Problem: The core issue is the lack of a secure, verifiable link between the identity () of the sender and the cryptographic material (the public key) provided. Anyone can claim a specific identity and provide their own public key.
Mechanism of Attack: 1. attempts to send an identity and public key to . 2. An attacker, (Eve), intercepts the message and modifies it. 3. replaces 's public key with 's own public key () but maintains the identity as . 4. receives the message, believing the public key belongs to . generates a session key (), encrypts it with , and sends it back. 5. intercepts this response and decrypts it using their own private key (). 6. then re-encrypts the session key using 's original public key () and sends it to . 7. Now, and communicate using , which is also known to , allowing to read or modify all traffic.
Comparison to Previous MitM Scenarios: * In earlier examples, a MitM attack acted more like a "Denial of Service" because could detect that a message was altered (e.g., if IDs were messed with) and would drop the connection. * In the current scenario, the attack is silent. Neither nor have evidence that the protocol has been subverted. From their perspectives, they have established a secure connection. * Detection would require an offline verification channel (e.g., a physical meeting) to confirm the public keys, which is often not feasible.
Advanced Secure Exchange Protocol
Authentication and Confidentiality: To prevent MitM attacks, the system must be "bootstrapped" so that parties can authenticate the source of a public key.
Protocol Steps involving Nonces: 1. sends a request to encrypted with 's public key (). The message includes and a nonce () for freshness. 2. responds with a message encrypted under 's public key (). It includes the original nonce () to prove it is a response to the specific request, and a new nonce (). 3. sends a confirmation encrypted under containing . 4. sends a session key () to . This is encrypted under but is also signed by using 's private key ().
Signing vs. Encrypting: Using a private key to "encrypt" is actually a signing operation. While anybody with the public key can verify the signature, only the holder of the private key could have created it, ensuring non-repudiation and authenticity.
Role of Nonces (, ): These are used for fresh transactions and unique identification of the session to prevent replay attacks.
Schemes for Public Key Distribution
Historically, four main schemes have evolved alongside the growth of the internet:
1. Public Announcement
Method: Manual exchange of public keys through physical meetups or public forums.
Context: Common in the early days of "Pretty Good Privacy" (PGP).
Limitations: It relies on physical delivery or trust in a channel. If a private key is compromised, it is nearly impossible to inform every person who received the public key manually.
2. Publicly Accessible Directories
Method: An organization (like a university) maintains a directory of IDs and associated public keys.
Mechanism: Functions similar to a "Yellow Pages." Users look up individuals and retrieve their keys.
Risk: The directory must be kept highly secure. If a hacker alters the database, they can replace legitimate keys with fraudulent ones.
3. Public Key Authority (PA)
Method: A central authority with stricter security than a simple directory. Users follow a specific protocol to request keys.
Protocol Example: 1. sends a request to the PA for 's public key, including a timestamp or nonce. 2. The PA replies with a message containing . This message is signed using the PA's private key. 3. uses to initiate communication with . 4. similarly requests and verifies 's public key from the PA.
Trust Requirement: All users must pre-establish and trust the public key of the Public Key Authority (). Once this trust is established, the PA can manage a massive network of entities.
Advantages: The PA only needs to be involved for initial key discovery; once keys are exchanged, parties communicate directly (offline from the PA).
4. Public Key Certificates
Method: The current standard (forming a Public Key Infrastructure or PKI). It uses digital certificates signed by a Certificate Authority (CA).
Concept: A digital certificate acts like an ID or passport. It contains the user's identity and their public key.
Validity: The certificate is signed by the CA's private key. Anyone with the CA's public key can verify the certificate's authenticity offline.
Components of a Certificate: * Identifier of the entity. * The Entity's Public Key. * Expiration Date (Time stamp). * Signature of the CA.
Life Cycle: Certificates address the problem of compromise through expiration dates and Revocation Lists managed by the CA.
Comparison to Public Key Authority: Certificates are superior because they empower users to perform verification themselves without contacting a central server every time a key is needed. It is a more decentralized approach to key management.
Questions & Discussion
Q: When the PA replies to with 's public key, what if it doesn't sign the message?
A: If the message is not signed, an attacker like Eve can intercept the message and replace 's public key with her own. Signature verification using the PA's public key is essential for security.
Q: How does get the PA's public key securely?
A: This is the "bootstrapping" problem. It must be established securely once. After that, the PA can certify other authorities or millions of users.
Q: Is a cookie similar to a public key store?
A: Not exactly. A cookie is a specific mechanism within a browser to store session data or tracking information. While both store data on a device, they serve different purposes in security and session management.
Q: If a private key is compromised, how does the other party know?
A: This is a major problem with static keys. Solutions include periodic cache clearing, expiration dates on certificates, or checking revocation lists provided by the CA.