is a cornerstone of modern network security. It uses two distinct keys - public and private - to enable secure communication and authentication over untrusted networks. This asymmetric approach relies on complex mathematical problems, providing robust security for various applications.

The principles of public-key cryptography play a crucial role in ensuring confidentiality, integrity, and non-repudiation of data. From secure email and web browsing to cryptocurrencies and technology, this cryptographic method underpins many essential aspects of our digital lives, making it a vital topic in network security and forensics.

Principles of public-key cryptography

  • Public-key cryptography, also known as , uses two different keys for and (public and private keys) enabling secure communication and authentication over untrusted networks
  • Relies on mathematical problems that are easy to compute in one direction but difficult to reverse (e.g., factoring large prime numbers, discrete logarithm problem) providing a high level of security
  • Plays a crucial role in network security and forensics by ensuring confidentiality, integrity, and non-repudiation of data transmitted over networks and stored on devices

Asymmetric key pairs

Public vs private keys

Top images from around the web for Public vs private keys
Top images from around the web for Public vs private keys
  • is freely distributed and used for encrypting messages or verifying digital signatures while is kept secret by the owner and used for decrypting messages or creating digital signatures
  • Messages encrypted with the public key can only be decrypted using the corresponding private key and vice versa ensuring secure communication between parties
  • Private key must be kept secure at all times to maintain the integrity of the cryptographic system as compromise of private key allows an attacker to impersonate the owner and decrypt confidential messages

Key generation process

  • Involves generating a pair of mathematically related keys (public and private) based on a specific algorithm (e.g., , )
  • Key generation parameters (e.g., key size, elliptic curve parameters) are carefully chosen to ensure sufficient security against known attacks
  • Generated keys are typically stored in a secure format (e.g., PEM, PKCS#12) and protected with a passphrase to prevent unauthorized access

RSA algorithm

RSA encryption process

  • Plaintext message is converted into a number MM using a padding scheme (e.g., PKCS#1 v1.5, OAEP)
  • Ciphertext CC is calculated using the formula: C=MemodnC = M^e \mod n, where ee is the public exponent and nn is the modulus (product of two large prime numbers)
  • Resulting ciphertext can only be decrypted using the corresponding private key ensuring confidentiality of the message

RSA decryption process

  • Ciphertext CC is raised to the power of the private exponent dd modulo nn to recover the original message MM: M=CdmodnM = C^d \mod n
  • Private exponent dd is calculated during key generation process using the extended Euclidean algorithm and kept secret
  • Decrypted message is then unpadded to obtain the original plaintext

RSA security considerations

  • Security of RSA relies on the difficulty of factoring large numbers (e.g., 2048-bit or larger modulus) making it infeasible for an attacker to determine the private key from the public key
  • Proper implementation of RSA is crucial to prevent vulnerabilities such as padding oracle attacks, timing attacks, and key leakage
  • Key size should be chosen based on the desired level of security and the expected lifetime of the protected data (e.g., 2048-bit keys for long-term security)

Elliptic curve cryptography (ECC)

ECC vs RSA

  • ECC uses algebraic structure of elliptic curves over finite fields to create public-key cryptographic systems offering similar security to RSA with smaller key sizes
  • Smaller key sizes in ECC (e.g., 256-bit) provide faster key generation, encryption, and decryption compared to RSA making it suitable for resource-constrained devices (smartphones, IoT devices)
  • ECC is considered more secure than RSA for a given key size due to the difficulty of solving the

ECC key generation

  • Involves selecting an appropriate elliptic curve (e.g., NIST P-256, Curve25519) and a base point GG on the curve
  • Private key is a randomly selected integer dd while public key is calculated as Q=dGQ = dG (point multiplication of base point GG by private key dd)
  • Domain parameters (elliptic curve, base point, order of base point) are shared between communicating parties to ensure interoperability

ECC encryption & decryption

  • Plaintext message is first encoded as a point MM on the elliptic curve
  • Encryption involves generating a random integer kk, calculating the points C1=kGC_1 = kG and C2=M+kQC_2 = M + kQ (where QQ is the recipient's public key), and sending the pair (C1,C2)(C_1, C_2) as the ciphertext
  • Decryption is performed by calculating M=C2dC1M = C_2 - dC_1 (where dd is the recipient's private key) to recover the original message point MM, which is then decoded back into the plaintext

Digital signatures

Digital signature creation

  • Signer first hashes the message using a (e.g., SHA-256) to create a fixed-size digest
  • Hash digest is then encrypted using the signer's private key to create the
  • Digital signature is attached to the original message and sent to the recipient providing authentication and integrity of the message

Digital signature verification

  • Recipient first hashes the received message using the same hash function used by the signer
  • Signature is decrypted using the signer's public key to obtain the hash digest calculated by the signer
  • Calculated hash digest is compared with the decrypted hash digest and if they match, the signature is considered valid indicating the message has not been tampered with and originated from the claimed signer

Non-repudiation of digital signatures

  • Digital signatures provide non-repudiation, meaning the signer cannot deny having signed the message as the signature can only be created with the signer's private key
  • Non-repudiation is crucial in legal and financial contexts (e-contracts, online transactions) to prevent parties from denying their actions
  • Digital signatures, when combined with trusted timestamping, can also provide evidence of the time at which the signature was created

Public key infrastructure (PKI)

Role of certificate authorities

  • Certificate authorities (CAs) are trusted third parties responsible for issuing, managing, and revoking digital certificates that bind public keys to the identities of their owners
  • CAs verify the identity of the certificate requestor (individual, organization, device) before issuing a certificate to ensure the authenticity of the public key
  • Root CAs are at the top of the trust hierarchy and are trusted by default by operating systems and browsers while intermediate CAs are certified by root CAs or other intermediate CAs forming a chain of trust

X.509 certificate format

  • is a standard format for digital certificates used in PKI to bind public keys to identities
  • Certificates include information such as the subject's identity (e.g., name, email, domain), public key, issuer's identity, validity period, and digital signature of the issuing CA
  • Extensions can be added to X.509 certificates to include additional information (e.g., key usage, subject alternative names, certificate policies)

Certificate revocation lists (CRLs)

  • CRLs are lists of certificates that have been revoked by the issuing CA before their scheduled expiration date due to reasons such as , change in subject's identity, or violation of certificate policies
  • CAs periodically publish updated CRLs to allow relying parties to check the revocation status of a certificate
  • is an alternative to CRLs that provides real-time revocation status information for individual certificates

Key management

Secure key storage

  • Private keys must be stored securely to prevent unauthorized access and ensure the integrity of the cryptographic system
  • Storage options include hardware security modules (HSMs), smart cards, and encrypted key files protected with strong passphrases
  • Access to private keys should be limited to authorized individuals and applications based on the principle of least privilege

Key backup & recovery

  • Regular backups of private keys are essential to ensure continuity of operations in case of key loss or corruption
  • Backups should be stored in a secure off-site location and protected with strong encryption and access controls
  • Key recovery procedures should be established and tested to allow timely restoration of keys in case of emergencies

Key expiration & rotation

  • Cryptographic keys have a limited lifetime and should be regularly rotated (replaced with new keys) to limit the impact of key compromise and comply with security best practices
  • Expiration dates are set for keys based on factors such as the sensitivity of the protected data, the strength of the keys, and the risk of key compromise
  • Key rotation involves generating new key pairs, securely distributing the new public keys, and revoking the old keys to ensure a smooth transition

Applications of public-key cryptography

Secure email with S/MIME

  • Secure/Multipurpose Internet Mail Extensions () is a standard for encrypting and signing email messages using public-key cryptography
  • S/MIME allows users to encrypt email contents and attachments using the recipient's public key ensuring confidentiality of the message
  • Digital signatures can be added to S/MIME messages using the sender's private key providing authentication, integrity, and non-repudiation

Secure web browsing with SSL/TLS

  • Secure Sockets Layer (SSL) and its successor Transport Layer Security (TLS) are cryptographic protocols used to establish secure communication channels over the internet
  • uses public-key cryptography (e.g., RSA, ECC) for authentication and and symmetric-key cryptography (e.g., AES) for bulk data encryption
  • Websites using SSL/TLS have URLs starting with "https" and display a padlock icon in the browser indicating a secure connection

Cryptocurrencies & blockchain

  • Public-key cryptography is a fundamental component of cryptocurrencies (e.g., Bitcoin, Ethereum) and blockchain technology
  • transactions are signed using the sender's private key and verified using the corresponding public key ensuring the authenticity and integrity of the transaction
  • Blockchain uses public-key cryptography to create a tamper-evident and decentralized ledger of transactions enabling secure and transparent record-keeping without the need for a trusted third party

Attacks on public-key systems

Brute force attacks

  • Involve systematically trying all possible private keys until the correct one is found allowing the attacker to decrypt messages or forge signatures
  • Feasibility of brute force attacks depends on the key size and the computational resources available to the attacker
  • Larger key sizes (e.g., 2048-bit RSA, 256-bit ECC) and proper key management practices can effectively mitigate the risk of brute force attacks

Man-in-the-middle attacks

  • Occur when an attacker intercepts the communication between two parties and impersonates each party to the other allowing the attacker to eavesdrop on or modify the exchanged messages
  • Public-key cryptography is vulnerable to man-in-the-middle attacks if the authenticity of the public keys is not properly verified (e.g., using digital certificates)
  • Countermeasures include using trusted certificate authorities, implementing certificate pinning, and using secure communication protocols (e.g., SSL/TLS, SSH) with proper authentication

Side-channel attacks

  • Exploit information leakage from the physical implementation of a cryptographic system (e.g., timing, power consumption, electromagnetic emissions) to deduce the private key or other sensitive information
  • Examples include timing attacks on RSA implementations, power analysis attacks on smart cards, and cache-based attacks on software implementations
  • Mitigation techniques involve using constant-time algorithms, implementing physical security measures (e.g., shielding, tamper detection), and applying algorithmic countermeasures (e.g., blinding, randomization)

Future of public-key cryptography

Post-quantum cryptography

  • Refers to cryptographic algorithms that are believed to be secure against attacks by quantum computers
  • Quantum computers, when available with sufficient scale and reliability, could break many current public-key cryptosystems (e.g., RSA, ECC) by efficiently solving the underlying mathematical problems
  • Post-quantum cryptographic schemes (e.g., lattice-based, code-based, multivariate) are being developed and standardized to ensure the long-term security of sensitive data and communications

Homomorphic encryption

  • Allows computations to be performed on encrypted data without decrypting it first enabling secure data processing in untrusted environments (e.g., cloud computing)
  • Fully (FHE) schemes enable arbitrary computations on encrypted data but are currently impractical due to high computational overhead
  • Partially homomorphic encryption (PHE) schemes support specific types of computations (e.g., addition, multiplication) and are more efficient but have limited applications

Advancements in quantum computing

  • Quantum computers leverage principles of quantum mechanics (e.g., superposition, entanglement) to perform certain computations much faster than classical computers
  • Development of large-scale, fault-tolerant quantum computers could have significant implications for public-key cryptography rendering many current algorithms insecure
  • Quantum-safe cryptographic solutions, such as post-quantum algorithms and quantum key distribution (QKD), are being actively researched to address the potential threats posed by quantum computing

Key Terms to Review (31)

Asymmetric cryptography: Asymmetric cryptography is a type of encryption that uses a pair of keys for secure communication: a public key and a private key. The public key can be shared openly, allowing anyone to encrypt a message for the key owner, while the private key is kept secret and is used to decrypt those messages. This method enhances security and enables functionalities like digital signatures, making it a fundamental component of modern public-key cryptography systems.
Blockchain: Blockchain is a decentralized digital ledger technology that securely records transactions across many computers, ensuring that the recorded transactions cannot be altered retroactively. This technology underpins cryptocurrencies and other applications, providing transparency and security through a network of nodes that validate and confirm transactions using cryptographic techniques.
Certificate Authority: A Certificate Authority (CA) is a trusted entity that issues digital certificates, which validate the identity of entities and enable secure communication through encryption. CAs play a crucial role in the public-key infrastructure (PKI) by ensuring that the public keys contained in these certificates are associated with legitimate organizations or individuals, facilitating trust in online communications.
Certificate Revocation List (CRL): A Certificate Revocation List (CRL) is a list of digital certificates that have been revoked before their expiration date by the certificate authority (CA). This list is crucial in public-key cryptography as it ensures that users can verify the validity of certificates and prevent the use of compromised keys. By maintaining and distributing CRLs, CAs provide a mechanism for securing communications and establishing trust in digital transactions.
Cryptocurrency: Cryptocurrency is a digital or virtual form of currency that uses cryptography for security and operates on decentralized networks based on blockchain technology. It enables secure and anonymous transactions without the need for traditional banking systems, making it a popular choice for online transactions and investments.
Decryption: Decryption is the process of converting encoded or encrypted data back into its original, readable format. This is a crucial step in secure communication and information protection, allowing authorized users to access the intended message while ensuring that unauthorized individuals cannot understand the data. The methods of decryption vary depending on the cryptographic technique used, whether it's symmetric or asymmetric encryption, highlighting its importance in maintaining data confidentiality and integrity.
Digital Signature: A digital signature is a cryptographic mechanism that verifies the authenticity and integrity of digital messages or documents. It uses a combination of public and private keys to create a unique signature that can be validated by anyone who has access to the public key, ensuring that the message has not been altered and confirming the identity of the sender.
ECC: Elliptic Curve Cryptography (ECC) is a public-key encryption technique that uses the algebraic structure of elliptic curves over finite fields to create secure keys. This method is gaining popularity due to its efficiency and the smaller key sizes required compared to other public-key systems, such as RSA, while still providing a high level of security. ECC’s strength lies in the mathematical complexity of the elliptic curve discrete logarithm problem, making it difficult for attackers to derive private keys from public keys.
Elliptic Curve Discrete Logarithm Problem (ECDLP): The Elliptic Curve Discrete Logarithm Problem (ECDLP) is a mathematical problem involving elliptic curves, which are used in public-key cryptography. Specifically, it requires finding an integer 'k' given two points on the curve, 'P' and 'Q', where 'Q' is the result of adding 'P' to itself 'k' times. ECDLP is foundational for the security of elliptic curve cryptography, as it underpins the difficulty of deriving private keys from public keys in systems like Bitcoin and other secure communications.
Encryption: Encryption is the process of converting information or data into a code, making it unreadable to anyone who does not possess the key to decrypt it. This process ensures confidentiality and protection of sensitive data during transmission and storage. By employing different encryption methods, security is enhanced for various communication channels, including data in transit over networks and information stored on devices.
Homomorphic encryption: Homomorphic encryption is a form of encryption that allows computations to be performed on encrypted data without needing to decrypt it first. This unique property enables data privacy during processing, which is especially important in scenarios involving sensitive information, as it permits operations on the ciphertext to yield an encrypted result that, when decrypted, matches the result of operations performed on the plaintext. This type of encryption has significant implications for public-key cryptography and is also linked to obfuscation techniques that protect data while allowing its use in various applications.
Key Compromise: Key compromise occurs when a cryptographic key is disclosed to unauthorized parties, potentially allowing them to access encrypted data or impersonate legitimate users. This event can undermine the security provided by public-key cryptography, as it allows attackers to decrypt messages or create fraudulent signatures, thereby eroding trust in the communication process. Key compromise highlights the importance of key management and the need for robust security measures to protect private keys.
Key Escrow: Key escrow is a security management system where the cryptographic keys used for encrypting data are held in escrow by a trusted third party. This allows for authorized access to encrypted data in cases where the original key is lost or forgotten, balancing privacy and access control. Key escrow is often discussed in relation to public-key cryptography, where keys are used for secure communications and digital signatures.
Key Exchange: Key exchange is a method used in cryptography to securely share cryptographic keys between parties so that they can communicate securely. This process is crucial for establishing a shared secret key, especially in symmetric-key cryptography, while in public-key cryptography, it allows two parties to exchange keys without needing to meet in person or share secrets over an insecure channel. Effective key exchange mechanisms ensure that even if the key exchange process is intercepted, the actual keys remain secure from unauthorized access.
Key pair: A key pair consists of two mathematically related keys used in public-key cryptography: a public key and a private key. The public key is shared openly and can be used by anyone to encrypt messages intended for the owner of the key pair, while the private key is kept secret and is used to decrypt those messages. This relationship enables secure communication, digital signatures, and authentication processes.
Man-in-the-middle attack: A man-in-the-middle attack is a cybersecurity breach where a malicious actor secretly intercepts and relays messages between two parties who believe they are communicating directly with each other. This type of attack exploits vulnerabilities in communication protocols, allowing the attacker to capture sensitive information or manipulate the conversation without either party's knowledge.
Martin Hellman: Martin Hellman is a renowned cryptographer best known for his pioneering work in public-key cryptography, which revolutionized secure communications over the internet. He co-invented the Diffie-Hellman key exchange protocol, allowing two parties to securely share a secret key over an insecure channel. This groundbreaking concept differentiated public-key cryptography from symmetric-key methods, enabling a more scalable and secure approach to encryption.
Online Certificate Status Protocol (OCSP): Online Certificate Status Protocol (OCSP) is a protocol used for obtaining the revocation status of a digital certificate in real-time. It allows clients to query a designated OCSP server to determine whether a specific certificate is still valid or has been revoked, providing a more efficient alternative to traditional methods like Certificate Revocation Lists (CRLs). OCSP plays a vital role in public-key infrastructure (PKI) by ensuring that users can trust the validity of digital certificates during secure transactions.
Padding Oracle Attack: A padding oracle attack is a type of cryptographic attack that exploits the way certain encryption systems handle padding in block ciphers. By leveraging error messages that indicate whether padding is correct or not, an attacker can gain information about the plaintext and decrypt data without needing the key. This attack highlights vulnerabilities in systems that do not properly validate padding, allowing attackers to potentially compromise sensitive data.
Post-quantum cryptography: Post-quantum cryptography refers to cryptographic algorithms that are designed to be secure against the potential threats posed by quantum computers. As quantum computing advances, traditional cryptographic methods, especially public-key cryptography, may become vulnerable to attacks that can break current encryption schemes. Post-quantum cryptography aims to develop new algorithms that can withstand these future quantum attacks while maintaining the efficiency and functionality of existing systems.
Private Key: A private key is a secret number that is used in cryptography, specifically within public-key cryptography systems, to decrypt messages or create digital signatures. The private key is paired with a public key, and while the public key can be shared openly to encrypt data, the private key must remain confidential to ensure the security and integrity of the encrypted information.
Public key: A public key is a cryptographic key that can be freely shared and is used in asymmetric encryption to encrypt data and verify digital signatures. Unlike a private key, which is kept secret, the public key allows anyone to encrypt messages intended for a specific recipient or verify a signature, thereby enabling secure communication and authentication without needing to exchange sensitive information beforehand.
Public Key Infrastructure (PKI): Public Key Infrastructure (PKI) is a framework that uses public key cryptography to secure communications and manage digital identities through the issuance, renewal, and revocation of digital certificates. It provides the necessary tools for secure data exchange, ensuring that both parties in a communication can verify each other's identities and protect sensitive information. PKI relies on a combination of hardware, software, policies, and standards to facilitate secure authentication and authorization processes.
Public-key cryptography: Public-key cryptography is a cryptographic system that uses a pair of keys: a public key, which can be shared openly, and a private key, which is kept secret. This system allows users to securely exchange information over an insecure channel, enabling functions such as encryption and digital signatures. The beauty of public-key cryptography lies in its ability to provide confidentiality, integrity, and authenticity in communications without the need for prior sharing of secret keys.
RSA: RSA is an asymmetric cryptographic algorithm used for secure data transmission, widely recognized for its role in public-key cryptography. It operates on the principle of generating a key pair: a public key for encryption and a private key for decryption. RSA enables secure communication by allowing users to share their public keys openly while keeping their private keys confidential, ensuring that only the intended recipient can read the message.
S/MIME: S/MIME, or Secure/Multipurpose Internet Mail Extensions, is a standard for public key encryption and digital signatures to secure email communication. It allows users to send encrypted messages and verify the identity of the sender through digital certificates. By utilizing public-key cryptography, S/MIME ensures that only intended recipients can read the message content while also providing authenticity and integrity.
Secure Hash Function: A secure hash function is a cryptographic algorithm that takes an input (or 'message') and produces a fixed-size string of bytes that appears random. It is designed to be a one-way function, making it computationally infeasible to reverse the process and retrieve the original input. This property is crucial for maintaining data integrity and authentication in various security protocols, especially in public-key cryptography, where it ensures that data has not been altered during transmission.
SSL/TLS: SSL (Secure Sockets Layer) and TLS (Transport Layer Security) are cryptographic protocols designed to provide secure communication over a computer network. They ensure data integrity, confidentiality, and authenticity between two communicating applications, primarily through the use of encryption and secure connections. By creating a secure channel, SSL/TLS protocols play a crucial role in protecting sensitive information transmitted over the internet.
Timing Attack: A timing attack is a type of side-channel attack that involves measuring the time it takes to perform cryptographic operations in order to gain information about secret keys or other sensitive data. By analyzing variations in the time taken to execute algorithms, attackers can infer valuable information that compromises security, particularly in systems using public-key cryptography. This attack highlights the need for constant-time algorithms that do not reveal information based on execution time differences.
Whitfield Diffie: Whitfield Diffie is a renowned cryptographer best known for his pioneering work in public-key cryptography, which revolutionized the way secure communication is achieved over insecure channels. His most significant contribution, alongside Martin Hellman, was the development of the Diffie-Hellman key exchange protocol, which allows two parties to securely share a secret key without needing to exchange it directly. This groundbreaking work laid the foundation for many modern encryption systems and highlighted the critical differences between symmetric and public-key cryptography.
X.509: x.509 is a standard that defines the format of public key certificates used in digital communications, allowing for secure identity verification and encryption. This standard plays a crucial role in the infrastructure of public-key cryptography and facilitates digital signatures by providing a way to bind an individual's identity to their public key through a certificate issued by a trusted Certificate Authority (CA). By establishing trust, x.509 enables secure online transactions and communication.
© 2024 Fiveable Inc. All rights reserved.
AP® and SAT® are trademarks registered by the College Board, which is not affiliated with, and does not endorse this website.