Chapter 8: Secret and Public Keys Study Notes
Chapter 8: Secret and Public Keys
Overview of Chapter 8
Managing and Using Secret Keys: Discusses methodologies for effectively handling secret keys.
Wrapping Techniques for Secret Keys: Details on how to secure secret keys during distribution.
Detecting Errors and Protecting File Integrity: Mechanisms to monitor and maintain data integrity.
Public-Key Cryptography: An overview of public-key cryptography and its future implications with quantum cryptography.
Public-Key Techniques for Signing Data: How public keys can be used to sign and wrap data securely.
Public-Key Certificates: The role and structure of public-key certificates in securing communications.
Key Management Challenges (Dr. Z)
Protecting Secret Keys: Instead of protecting large amounts of secret data, it is more efficient to protect smaller secret keys according to Kerckhoffs's (or Shannon's) principle:
Kerckhoffs's Principle: The security of a cryptosystem should depend solely on the secrecy of the key, not the secrecy of the algorithm.
Challenges include:
Key Distribution: Ensure secret keys are shared only with authorized individuals or systems.
Key Generation: Keys must be sufficiently random to resist guessing by attackers.
Key Handling: Keys must be managed and stored securely to prevent interception or leakage.
Cryptonet: A group of entities sharing the same secret key, fostering a network of transitive trust. Trust in one member implies trust in all others.
Rekeying – Changing Old Keys
Encryption Risk: The more data encrypted with a key, the greater the risk of exposure through cryptanalysis.
Rekeying Strategy: To minimize risks, rekey periodically by replacing old keys with new ones.
Cryptoperiod: The defined time during which a key is deemed safe to use.
General Recommendations:
Rarely used keys should have a cryptoperiod of about 2 years.
Heavily used keys should be changed as frequently as practical.
Key Principle: Rekeying presents a trade-off between performance and security; shorter cryptoperiods enhance safety but require more frequent management.
Key Distribution Methods
Person-to-Person Exchange: Safe but inefficient for large-scale systems.
Common Methods:
Verbal Exchange: Effective for short, memorable keys.
Paper Exchange: Keys can be securely written and handed over but require protection against theft/loss.
Electronic Exchange: Convenient but risks include sniffing and unauthorized duplication. Secure methods for electronic exchange will be covered later.
Key Questions to Address:
How to prevent sniffing or interception during transmission.
How to stop unauthorized copying of keys once distributed.
Crypto Keys in Text Format
Useful for encrypting shared files, allowing for verbal or paper exchange.
Key Conversion Question: How to convert text phrases into bits for digital encryption algorithms that operate on binary data. Any text-based key must be converted into bits before use in encryption.
Passphrase as Key: Simple Case (Dr. Z)
Concern: Passwords may not fit key size exactly.
Textual Keys vs. Binary Keys:
Textual keys are flexible and can be shared verbally or in text files.
Binary keys, especially large ones, are difficult to memorize. They often require secure storage which may risk exposure.
Passphrase as Key: Better Case
Use of One-Way Hashes:
Passphrase is hashed to produce a key (Internal Key) before being used in encryption algorithms.
Model:
Text Passphrase → Hash Value → Internal Key.
Data is encrypted using the Internal Key generating ciphertext.
Checklist for Secure Key Handling
Use a password or a passphrase.
Allow long passphrases for better security.
Preserve the full entropy of the passphrase entire key operation.
Erase the passphrase from memory immediately after use.
Facilitate user retention of passphrases securely.
Avoid storing passphrases on disk unless encrypted.
Disable input echoing during passphrase entry to mask input.
Utilize each internal key for a single file only.
Key Strength
A longer key with a diverse character set yields more entropy.
Entropy: The amount of randomness or unpredictability in the key which increases the search space against attacks.
Memorization Trade-off::
Passwords with unusual characters or misspellings are hard to remember.
Longer passphrases with regular words and syntax are easier to recall.
The Reused Key Stream Problem
Illustration of Problem:
Plaintext Key Stream and resulting Ciphertext demonstrate how reusing key streams can compromise security.
Bit Management: XOR function combines duplicate ciphertexts, allowing recovery of original plaintext messages; key management hence requires separate keys for separate messages in stream ciphers.
Using a Nonce
Nonce is introduced in the encryption process to prevent duplicate key streams during encryption using a key wrapped approach, through the use of hashes and keys leading to ciphertext.
Key Wrapping: A Building Block
Random Source and Wrapped Keys: Key wrapping involves using a Key Encryption Key (KEK) which is made up of a one-way hash of the passkey to securely transmit a Data Encryption Key (DEK) (CEK) within the principle of encrypted files.
Key Splitting - Simplified Wrapping
A method of securely sharing keys (CEK and KEK) individually, reducing the risk of interception by sealing away components from potential attackers.
Separation of Duty: A Principle
Task division requiring multiple individuals to complete promotes security as it requires cooperation for illicit actions. Examples include:
Business Example: Dual signature checks for financial approvals.
Military Example: Launching nuclear missiles requires dual confirmations.
Public-Key Cryptography (Dr. Z)
Techniques enable secure communication without prior shared secrets. Notable techniques:
Diffie-Hellman (Merkle): Allows the construction of a shared secret using public information.
Rivest-Shamir-Adleman (RSA): Encrypts data for recipient’s reading while providing means to verify senders’ signatures.
Public and Private Keys
Users maintain a temporary secret for transactions:
Create and discard shared secret key post-transaction to minimize cryptanalysis exposures.
Public/private key architecture:
Public keys are shareable, private keys are secured.
Constructing a Key Pair
The process involves constructing both a public and private key for an entity (e.g., Alice) based on random input.
Diffie-Hellman Secret Sharing
Process utilizing public keys shared between entities (e.g., Bob and Alice) to create a shared secret through mathematical methods.
Elliptic Curve Cryptography
Similar to Diffie-Hellman, utilizes elliptic curve mathematics for secure key exchanges:
Formula: (y² = x² + ax + b) (mod p).
This approach allows for smaller key sizes while maintaining effective security.
Quantum Theory and Cryptography
Quantum Key Distribution: Based on Heisenberg's Uncertainty Principle to detect eavesdropping.
Quantum Cryptanalysis: Developments like Shor's algorithm can undermine traditional public-key systems; hence, post-quantum research does exist to confront these potential threats.
RSA In Practice
RSA revolves around a fundamental calculation involving large integers: C = M^x ext{ mod } N where:
N is a product of two prime numbers.
e is a public exponent and d is a secret exponent.
M is the plaintext, and C is the resulting ciphertext.
Encryption and decryption require the appropriate keys (e or d).
Key Wrapping with RSA
Utilizing RSA to wrap keys involves an encryption process where data keys are encapsulated into ciphertext for transport security.
Attacking Public Key Crypto
The strength of public key systems resides in the large prime numbers used. Attack strategies focus on efficient factorization of these primes.
Attacking RSA:
Vulnerability assessment includes small plain texts and timing analysis for capturing key information.
Data Integrity
Encryption fails to guarantee data integrity; hence mechanisms are required to detect changes, whether malicious or accidental.
Detection Methods: Utilizing hash functions similar to Error Detection Codes (EDCs).
Bit Flipping Attack on Ciphertext
Example illustrated to show how modifying ciphertext can alter plaintext through deliberate changes in encrypted data.
Checking Data Protection
A checksum is calculated post-encryption to verify data integrity, aiding in detecting unauthorized changes post-encryption.
Birthday Attack on a Check Value
Demonstrates the theoretical framework for exploiting hash collisions to adjust values covertly within digital documents, impacting data integrity.
Alternative: Encrypting a Hash
Efficiency in digital signing and integrity validation can be achieved by hashing content and then encrypting the hash rather than the full message.
Keyed Hash: More Efficient
A secure method to ensure integrity while maintaining a level of efficiency with digital signatures related to the content.
Public Keys and Digital Signatures
Mechanism outlined where Bob signs a transaction, which is subsequently verified through asymmetric techniques utilizing public keys to validate authenticity.
Constructing an RSA Digital Signature
Process detailing how to create a digital signature using RSA securely, involving public/private keys and the signing function.
Verifying an RSA Digital Signature
Steps taken to validate the authenticity of a digital signature, ensuring integrity and authenticity of the transaction or message.
The MITM or Bucket Brigade Attack
Illustrates the concept of man-in-the-middle attacks where an attacker can impersonate another entity and intercept/alter communications, undermining trust.
Public-Key Certificates
Certificates establish trust in public keys through digital signatures from Certificate Authorities (CAs) ensuring public key authenticity.
Interpreting Certificates
Certificates can be organized hierarchically whereby root certificates validate subordinate certificates, ensuring an organized trust model.