Key Terms
| Term | Definition | Exam Context/Example |
|---|---|---|
| Public Key Cryptography (Asymmetric encryption) | A cryptographic system where each person’s key is separated into a public key (for encryption), available to everyone, and a secret key (for decryption), which is kept private by the owner. This allows for secure communication and key exchange without pre-sharing secrets. | Used for secure access to websites or online shopping where pre-exchanging keys is infeasible. |
| Symmetric Key Encryption | A cryptographic system where one key is used for both encryption and decryption. Parties must agree on a common secret key beforehand. | Used to guarantee confidentiality and integrity after a secure channel (e.g., established by public-key methods) is set up. Symmetric-key encryption is more efficient than public-key encryption for long messages. |
| Public Key () | The key in an asymmetric system that is distributed publicly and is used to encrypt messages intended for the owner. | In RSA, the public key is . In ElGamal, . |
| Private Key (Secret Key, ) | The key in an asymmetric system that must be kept secret and is used to decrypt ciphertexts. | In RSA, the private key is . In ElGamal, . |
| One-way Functions | Functions that are easy to compute, but hard to invert. Computation is efficient, but finding the pre-image is practically infeasible. | Examples include pre-image resistant hash functions, multiplication of two large prime numbers (factoring), and Discrete Exponentiation. |
| Trapdoor Functions | One-way functions that possess trapdoor information. The inverse is easy to compute only if specific secret information (the trapdoor) is known. | The RSA function is a trapdoor function, where the trapdoor information is the decryption exponent (derived from the prime factors and ). |
| Discrete Exponentiation | The operation . It is a function that is efficiently computable. | Calculating can be done efficiently using the Square and Multiply algorithm in steps (where is the exponent). |
| Discrete Logarithm Function | The inverse function of discrete exponentiation (). It is (believed to be) hard to compute efficiently for sufficiently large primes. | Inverting the equation to find is an example of computing a discrete logarithm. The hardness of this operation is the basis for ElGamal encryption. |
| Diffie-Hellman Key Exchange | A public-key method for key agreement (exchange) that allows two parties (Alice and Bob) to establish a fresh, shared secret key. They compute and , resulting in an equal key, . | The key exchange is analogous to mixing colors, where mixing is easy but separating the mixed color is hard. Eve knows but must compute . |
| RSA Cryptosystem | A widely used public-key cryptosystem (Rivest, Shamir, Adleman) based on the difficulty of factoring large composite numbers. It provides encryption and digital signatures. | Key generation involves choosing large primes and , computing (the modulus), and calculating related exponents and . |
| RSA Modulus () | Calculated as , where and are large random primes of approximately equal size. | The security of RSA depends on the difficulty of finding the factors and from the public modulus . |
| Textbook RSA | The basic definition of the RSA scheme, where encryption is and decryption is . | Textbook RSA is deterministic (encrypting the same message twice yields the same ciphertext) and is not CPA-secure. |
| CPA-secure (Chosen-plaintext attack secure) | An encryption scheme is CPA-secure if an adversary cannot do better than random guessing to win the chosen-plaintext attack game. | No deterministic encryption scheme is CPA-secure. Encryption must be randomized, typically by using encoding schemes like OAEP. |
| Hybrid Encryption | A method to encrypt long messages by combining public-key encryption with symmetric-key encryption. | The public-key scheme (e.g., RSA) is used to encrypt the symmetric key (), and the symmetric-key scheme (e.g., AES) is used to encrypt the message () using . |
| Optimal Asymmetric Encryption Padding (OAEP) | A more secure encoding scheme used in RSA encryption. OAEP randomizes the plaintext before encryption. | Using OAEP prevents attacks like Bleichenbacher’s 1-Million-Chosen-Ciphertext Attack and prevents the low encryption exponent attack. |
| Digital Signature | The digital counterpart of a handwritten signature. The signature must depend on the message and a secret known only to the signer, and it must be verifiable by an unbiased third party using the signer’s public key. | In basic RSA signing, Alice computes the signature using her secret key , and Bob verifies it by checking if . |
| Hash-then-decrypt paradigm | A method for digital signatures where a collision resistant hash function () is first applied to the message (), and then the hash value is signed instead of the original message. | Alice’s RSA signature is . Bob verifies if . This prevents existential forgery attacks associated with basic RSA signatures. |
| Prime Residue Class Group Modulo () | The set of residue classes , consisting of elements in that have multiplicative inverses (units). | The order of is given by the Euler phi function . |
| Euler Phi Function () | Also called the Euler Totient Function, it is the number of integers in the interval which are prime to . | Used in RSA key generation to find such that , where . |
| Modular Exponentiation | The efficient computation of (usually modulo a number ). | This calculation is performed using the square-and-multiply method. If the calculation is done modulo a prime , the exponent can be reduced modulo (by Fermat’s Theorem). |
| Elliptic Curve Discrete Logarithm Problem | The problem of finding such that , given points and on an elliptic curve. | This is the hard problem upon which Elliptic Curve Cryptography (ECC) security is based. is easy to compute using the Double and Add algorithm if is known. |
| Elliptic Curve Digital Signature Algorithm (ECDSA) | The elliptic curve analogue of the Digital Signature Algorithm (DSA). It uses the properties of points on an elliptic curve defined over a finite field. | Key generation involves choosing a secret key and publishing , where is the base point of prime order . |
Public vs Private Keys
Trapdoor Functions
The concept of a Trapdoor Function is foundational to public-key cryptography, acting as a one-way mathematical lock that can only be easily opened if special information is known.
Concept of a Trapdoor One-Way Function
A trapdoor one-way function is a special type of one-way function:
- One-Way Function: This is a function that is easy to compute in one direction, but is hard to invert (finding the pre-image is practically infeasible). Examples of candidates for one-way functions include the multiplication of two large prime numbers and Discrete Exponentiation.
- Trapdoor Property: A trapdoor function is a one-way function that possesses trapdoor information. If this specific secret information (the trapdoor) is known, the inverse of the function becomes easy to compute.
The RSA function, , is an example of a trapdoor function.
How Trapdoor Functions Enable Asymmetric Encryption
The trapdoor one-way function allows public-key cryptography to separate the encryption and decryption processes:
- Public Key (The Function): The function itself, , is the public key. This function is computable by an efficient algorithm and is publicly announced. When Alice wants to send a message () to Bob, she uses Bob’s public key () to compute the ciphertext () using the encryption function: .
- Private Key (The Trapdoor): The secret information () that allows the function to be easily inverted is called the trapdoor information. This secret key is known only to the owner (Bob).
- Decryption: Bob uses his secret key () to efficiently compute the pre-image () from the ciphertext (). Since Bob is the only one who knows the secret key, he is the only one who can decrypt the message.
In essence, the public key allows anyone to securely “lock” a message using the easy-to-compute direction of the trapdoor function, while the private key acts as the hidden trapdoor that enables the decryption (reversal) to be done efficiently.
Computational Infeasibility of Reversal
It is “computationally infeasible” for an adversary (without the private key) to reverse the process because inverting the one-way function requires solving a fundamentally hard problem.
In the context of the RSA cryptosystem, the trapdoor function is based on the difficulty of factoring large composite numbers.
- The Hard Problem (Factorization): RSA key generation involves multiplying two large prime numbers, and , to get a composite modulus . While multiplication is “easy” (efficiently computable by a computer), factoring to find and is “hard” due to the exponential time required as the size of the numbers increases.
- The Private Key’s Role: The factors and are used to calculate the private decryption exponent . Knowing (the trapdoor information) makes the inverse operation (decryption) easy.
- Infeasibility without the Key: An adversary (Eve) knows and the public exponent , along with the ciphertext . To find the message , Eve would either have to compute the -th root of modulo or successfully factor to find and . It is widely believed that no efficient algorithm exists for these operations when and are sufficiently large. The time needed for a computer to factor these huge numbers can increase to hundreds or thousands of years, thus making the process “computationally infeasible”.
RSA Encryption Rule Set
1. To send a secret message () to Alice, which key do I use?
You must use Alice’s Public Key () to encrypt the message.
- Rule: The encryption function takes the plaintext message () and Alice’s public key, , to produce the ciphertext () using modular exponentiation: .
- Context: Alice’s public key is distributed publicly and available to everyone. This allows anyone, including you, to encrypt a message intended only for Alice.
2. To decrypt that message, which key does Alice use?
Alice must use Alice’s Private Key (Secret Key, ) to decrypt the message.
- Rule: The decryption function takes the ciphertext () and Alice’s private key, , to recover the plaintext message () using modular exponentiation: .
- Context: Alice’s private key () must be kept secret and is only known to her (the owner). This ensures that only Alice can recover the original message.
3. Crucial: Can I decrypt the message with the same key I used to encrypt it? Explain why not.
No, you cannot decrypt the message using the same public key used for encryption.
Explanation (Asymmetric System and One-Way Functions):
- Asymmetric Nature: RSA is an asymmetric encryption scheme, meaning that the key used for encryption (the public key, ) is intentionally different from the key used for decryption (the private key, ). The keys are linked, but distinct.
- Trapdoor Function: The RSA encryption process is based on a trapdoor one-way function.
- One-Way (Encryption): Encrypting the message () is the easy direction of the function, and anyone with the public key can perform it efficiently.
- Trapdoor (Decryption): Reversing this process (finding from , or computing the -th root modulo ) is designed to be computationally infeasible without the specific secret information, or trapdoor.
- Key Requirement: The private key () acts as the trapdoor information. This key is mathematically constructed based on the factorization of the modulus ( and ), which is kept secret. Without access to the private key , attempting to reverse the encryption using only the public information ( and ) requires solving a fundamentally hard problem (either factoring or computing the -th root modulo ), a process that takes a computer an exponentially large amount of time, rendering it computationally infeasible.
The Algorithms: RSA & Diffie-Hellman
The security of the key public-key cryptosystems, RSA and Diffie-Hellman (and its derivative, ElGamal), rests upon different mathematical problems that are currently considered computationally infeasible to solve efficiently.
Comparison of Hard Problems
| Cryptosystem | Mathematical Hard Problem | Description of the Hard Problem |
|---|---|---|
| RSA Cryptosystem | Integer Factorization Problem (IFP) | The security of RSA depends on the difficulty of factoring large composite numbers () into their two large prime factors ( and ). |
| Diffie-Hellman (DH) and ElGamal | Discrete Logarithm Problem (DLP) | The security of DH key exchange and ElGamal encryption relies on the difficulty of extracting discrete logarithms (DLP). Given , finding the exponent (the discrete logarithm) is hard. |
| ElGamal Variation | Diffie–Hellman Problem (DHP) | The security of ElGamal encryption specifically depends on the Diffie–Hellman problem: the difficulty of computing from and alone. An efficient algorithm to compute discrete logarithms would solve the DHP. |
Why These Problems are Considered ‘Hard’
Both the Integer Factorization Problem (IFP) and the Discrete Logarithm Problem (DLP) are considered “hard” because the known algorithms required to solve them take an exponential amount of time relative to the size of the input numbers on classical computers. This makes their computation practically infeasible when the numbers (keys) are sufficiently large.
1. Hardness of Integer Factorization (Securing RSA)
Multiplication (the forward process: ) is easy and can be performed efficiently, often in less than a second even for very large numbers. Conversely, determining the prime factors ( and ) of a very large composite number () requires complex algorithms and trial and error.
- As the size of the number to be factored grows, the time needed for the calculation increases rapidly.
- Factoring extremely large numbers (such as those used for RSA moduli, which are over 300 digits long) would require a computer to run for hundreds or thousands of years, making it a “hard” problem.
The fact that the RSA function () is hard to invert without knowing the secret factors ( and ) makes it a trapdoor function, providing the basis for RSA’s security.
2. Hardness of Discrete Logarithms (Securing Diffie-Hellman/ElGamal)
Discrete Exponentiation (the forward process: ) is easy and can be performed efficiently using algorithms like the Square and Multiply method. However, computing the inverse function, the discrete logarithm, is believed to be hard.
- Inverting the modular exponentiation requires testing all elements until the equation is satisfied. This results in an algorithm with exponential running time because the modulus is exponential in the binary length of .
- While better algorithms exist for specific cases (like the baby-step giant-step algorithm mentioned in a lab context), no algorithm is known that runs efficiently for all moduli on classical computers.
- The computational effort required to solve the DLP is analogous to trying to reverse a mixed color to find the exact original colors used to create it.
Diffie-Helman Key Exchange
The Diffie-Hellman Key Exchange is a public-key method for key agreement that allows two parties, Alice and Bob, to establish a fresh, shared secret key over an insecure, public channel, even though they have never met. The process relies on mathematical operations that are easy to perform in one direction (Discrete Exponentiation) but computationally infeasible to reverse (Discrete Logarithm Problem).
Analogy: Mixing Colours as a One-Way Function
The underlying trick of Diffie-Hellman is often explained using a paint-mixing analogy, which models the behavior of a one-way function:
- Public Agreement (Public Channel): Alice and Bob first agree publicly on a fixed, public color (analogous to the generator ). Anyone, including Eve, knows this starting color.
- Private Secret Selection: Alice and Bob both randomly select their own secret private colors (analogous to secret exponents and ) and keep them hidden.
- Mixing and Sharing (Public Channel): Alice mixes her secret private color with the public color to create her mixture. Bob does the same to create his mixture. They send their respective mixtures to the other party over the public channel.
- Shared Secret Key:
- Alice takes Bob’s mixture and adds her own secret private color to it.
- Bob takes Alice’s mixture and adds his own secret private color to it.
- Result: Both Alice and Bob arrive at the exact same final color, which is their shared secret.
Why Eve Cannot Determine the Secret: Eve, who is always listening, can see the public color and both mixtures that were exchanged. However, the trick works because it is easy to mix two colors to make a third, but hard to reverse a mixed color to find the exact original private colors used. Eve needs one of the private colors to create the final secret color, making it infeasible for her to obtain the secret key.
Diffie-Hellman Key Exchange Mathematical Steps
The mathematical steps replicate the colour analogy using Discrete Exponentiation:
Setup (Public Information):
- Alice and Bob agree on a group and a generator of that group, which are fixed and public. (In modular arithmetic, this often involves a large prime and a generator of the group .)
Steps to Establish the Shared Key :
| Step | Alice’s Action (Secret ) | Bob’s Action (Secret ) | Public Information (Eve knows) |
|---|---|---|---|
| 1. Choose Secrets | Randomly chooses a secret exponent . | Randomly chooses a secret exponent . | |
| 2. Compute & Exchange | Computes (her public component) and sends to Bob. | Computes (his public component) and sends to Alice. | |
| 3. Final Computation | Computes the shared secret key . | Computes the shared secret key . |
Result:
- Since the laws of exponents dictate that equals , which is the same as or , Alice’s calculated key () and Bob’s calculated key () are equal (), giving them a shared secret key.
Why Eve Cannot Determine the Secret:
- Eve knows , , , and , but must compute .
- Calculating the exponentiation () is easy using algorithms like Square and Multiply.
- However, solving for the secret exponent from or from requires computing the discrete logarithm function (the inverse of discrete exponentiation), which is believed to be hard for classical computers when the numbers are sufficiently large. This computational difficulty of finding the shared secret from the publicly known components is known as the Diffie–Hellman Problem.
Practical Application: Hybrid Encryption
The concept of Hybrid Encryption is a highly efficient and widely adopted solution that combines the strengths of both public-key (asymmetric) and symmetric-key cryptography to ensure secure communication of large volumes of data.
Explanation of Hybrid Encryption
Hybrid encryption is a method used to encrypt long messages by combining public-key encryption with symmetric-key encryption.
In a hybrid scheme, the public-key method (like RSA or ElGamal) is used to establish a fresh, temporary secret key, while the symmetric-key method (like AES) is used to encrypt the bulk of the data.
Why Public-Key Cryptography is Slower
Public-key cryptography (Asymmetric encryption) is generally much slower and less efficient than symmetric-key encryption.
- Asymmetric Encryption: Schemes like RSA rely on complex, computationally intensive mathematical problems, such as modular exponentiation (). While specialized algorithms exist (like the Square-and-Multiply method) to make the computation of efficient, the overall process is inherently complex.
- Symmetric Encryption: Symmetric methods use a single key for both encryption and decryption and are designed to be highly optimized and executed very efficiently.
The advantage of employing a hybrid approach is that symmetric-key encryption is much more efficient than public-key encryption for encrypting the actual message data.
Standard Hybrid Encryption Workflow (RSA + AES)
The standard hybrid encryption workflow involves two distinct encryption phases:
-
Public-Key Encryption (RSA) for Key Exchange (Confidentiality of the Key):
- The sender (Alice) generates a random, temporary symmetric key (), often called a “Session Key” (e.g., a 256-bit AES key).
- Alice uses the recipient’s Public Key () (e.g., Bob’s RSA key) to encrypt this small key (). This results in the first ciphertext component, .
- The public-key scheme is used here specifically to securely distribute the symmetric key, which is difficult to do otherwise over an insecure channel.
-
Symmetric-Key Encryption (AES) for Message Encryption (Confidentiality of the Data):
- Alice uses the newly generated symmetric key () to encrypt the actual large message () (e.g., a large file or conversation) using the efficient symmetric algorithm (e.g., AES-256). This results in the second ciphertext component, .
- The entire ciphertext sent to the recipient consists of both components: (), or .
-
Decryption Workflow:
- The recipient (Bob) first uses his Private Key () to decrypt the small public-key ciphertext () and recover the symmetric session key ().
- Once he has , Bob uses this key to decrypt the large symmetric-key ciphertext () and recover the original message ().
Necessity for Performance
This two-step approach is necessary for performance because it maximizes security while minimizing the use of computationally expensive operations:
- Public-key schemes (like RSA) are used only for the short operation of key distribution. This step is computationally expensive but applied only once to a tiny piece of data (the session key).
- Symmetric-key schemes (like AES) are used for the large operation of data encryption. Since symmetric encryption is significantly faster, it can handle bulk data (long messages or large files) with far greater efficiency than an asymmetric scheme could.
Thus, hybrid encryption leverages the public-key scheme’s ability to establish a secret securely without pre-sharing information, and the symmetric-key scheme’s efficiency in encrypting large amounts of data.
Analogy: Think of public-key encryption (RSA) as a massive, heavy armored truck (slow but secure) used only to deliver a single, specialized, lightweight key (the session key). Once that key is delivered, it is used to open the front door of a warehouse where lightning-fast conveyor belts (symmetric encryption/AES) handle the actual huge volume of cargo (the message data).
Exam Style Questions
Short Answer Questions
| Question | Answer | Citation |
|---|---|---|
| 1. Hard Problems in Public Key Cryptography | What are the two distinct, fundamental mathematical problems that form the security basis for most modern public-key cryptosystems (e.g., RSA and ElGamal)? | The two hard problems are the difficulty of factoring large numbers (which secures RSA),, and the difficulty of extracting discrete logarithms (which secures ElGamal/Diffie-Hellman),,. |
| 2. CPA Security and Textbook RSA | Why is “Textbook RSA” considered insecure against a Chosen-Plaintext Attack (CPA)? What characteristic of the encryption scheme makes it vulnerable? | Textbook RSA is considered insecure because it is deterministic,,. If the same message () is encrypted twice, the two ciphertexts are identical,. This allows an adversary (Eve) to choose probable messages, encrypt them herself using the public key (), and compare the result to the challenge ciphertext to guess the message,. |
| 3. Function of the RSA Trapdoor | In the context of trapdoor functions, what specific piece of information acts as the “trapdoor” in the RSA cryptosystem, and what function does it enable? | The trapdoor information is the decryption exponent (),. It enables the efficient computation of the inverse function (decryption),,. |
| 4. Diffie-Hellman Key Exchange Goal | What is the purpose of the Diffie-Hellman Key Exchange, and what four specific values must an adversary (Eve) know to attempt to compute the shared secret key ()? | The purpose is a public-key method for key agreement that allows two parties to establish a fresh, shared secret key,. Eve knows the group (), the generator (), and the two publicly exchanged values ( and ),. |
| 5. Elliptic Curve Encryption Basis | Elliptic Curve Cryptography (ECC) is analogous to systems based on Discrete Logarithms. What operation is computationally easy in ECC, and what is the corresponding “hard problem” that secures it? | The operation that is easy to compute is scalar multiplication (given a number and a point , computing ),. The corresponding hard problem is the Elliptic Curve Discrete Logarithm Problem (ECDLP), which means given and (), it is hard to find the number ,,. |
Scenario-Based Long-Form Questions
1. RSA Key Security and Factorization
Alice sets up the RSA cryptosystem. She generates two large primes, and , and computes the RSA modulus .
- Explain why the multiplication step () is considered “easy” while reversing it (factoring ) is “hard,” and why this contrast is essential for RSA security.
- The decryption exponent is derived such that . If an adversary (Eve) manages to discover the value of the Euler Totient Function, , explain how this compromises the entire security of Alice’s private key (), even without directly factoring .
Answer:
-
Easy Multiplication vs. Hard Factorization:
- The multiplication step () is considered “easy” because efficient algorithms exist to compute it, requiring relatively little time even for large numbers,.
- Reversing this process (factoring ) is “hard” because the time required for known factorization algorithms increases rapidly as the number size grows. For huge numbers, it may require hundreds or thousands of years to complete the calculation.
- This contrast is essential because it forms the basis of the one-way function used in RSA,. The public key allows anyone to perform the easy, forward calculation (encryption), while the secret factors ( and ) provide the trapdoor needed for the owner to perform the hard, inverse calculation (decryption),.
-
Compromise via :
- If Eve knows the modulus and the public exponent , she only needs to calculate the secret decryption exponent ,.
- The exponent is defined as the multiplicative inverse of modulo , meaning ,.
- Since the extended Euclidean algorithm efficiently computes from and ,, knowing bypasses the need to solve the factoring problem entirely.
- Once Eve has , she possesses the secret key () and the trapdoor information,, allowing her to decrypt any ciphertext intended for Alice,. Furthermore, knowing and allows an adversary to efficiently compute the prime factors and as well.
2. Hybrid Encryption and Performance Necessity
A company needs to transmit large, long documents securely over the internet. They decide to use a Hybrid Encryption scheme combining RSA and AES.
- Describe the standard workflow required to encrypt the document and allow the recipient (Bob) to decrypt it, specifying where the RSA keys and the AES key are used.
- Justify why this combined approach is necessary, focusing on the comparative efficiency and complexity of the two key types.
Answer:
-
Hybrid Encryption Workflow (RSA + AES):
- Generation and Encryption of Session Key: The sender (Alice) generates a random, temporary symmetric key () (a Session Key),. Alice uses Bob’s Public Key () (the RSA key) to encrypt this small session key, resulting in ,.
- Encryption of Message: Alice then uses the efficient symmetric algorithm (AES) and the session key () to encrypt the actual large message (), resulting in ,.
- Decryption: Bob receives the combined ciphertext (). He uses his Private Key () (the RSA key) to decrypt and recover the Session Key (). Then, he uses the recovered Session Key () to decrypt (the large file) using AES, thereby recovering the original message ().
-
Necessity and Efficiency Justification:
- This hybrid approach is necessary because symmetric-key encryption is much more efficient than public-key encryption.
- Public-key schemes (RSA) are computationally expensive because they rely on complex mathematical operations (like modular exponentiation) derived from fundamentally hard problems (factoring). If the entire large message were encrypted using RSA, the process would be very slow.
- Symmetric-key schemes (AES) are designed to be fast and efficient for bulk data handling,.
- Therefore, the hybrid model uses the public key (RSA) only for the short operation of securely distributing the session key over the public channel. The symmetric key (AES), which is fast, is then used to handle the time-consuming task of encrypting the large amount of data, maximizing both security and performance.