1. Home
  2. Explore
  3. Computer Science
  4. RSA Public Key Cryptography

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

RSA Public Key Cryptography

  • 26Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: RSA Fundamentals

What is the primary function of the private key in an RSA digital signature scheme?

26 questions

  1. 1

    What is the primary function of the private key in an RSA digital signature scheme?

    1. A

      It is used to verify the authenticity of a digital signature.

    2. B

      It is publicly shared to establish secure communication channels.

    3. C

      It is used to sign a document, creating a digital signature.

    4. D

      It is used to encrypt data so only the public key can decrypt it.

    Correct answer
    C

    It is used to sign a document, creating a digital signature.

    Explanation

    In RSA, the private key is used to sign something, creating a digital signature. The public key is then used to verify that signature.

  2. 2

    Which of the following values are components of the public key in an RSA system?

    1. A

      The private exponent 'd' and the public exponent 'e' are used.

    2. B

      The exponent 'e' and the modulus 'n' are public key components.

    3. C

      The primes 'p' and 'q' are publicly shared as key components.

    4. D

      The exponent 'd' and the modulus 'n' are public key components.

    Correct answer
    B

    The exponent 'e' and the modulus 'n' are public key components.

    Explanation

    The public key in RSA consists of the exponent 'e' and a very large number 'n'. These values are not secrets and are publicly available.

  3. 3

    What is the typical value for the public exponent 'e' in RSA, as mentioned in the content?

    1. A

      The value of 'e' is typically 65537, a commonly chosen prime.

    2. B

      The value of 'e' is typically a randomly generated 2000-bit number.

    3. C

      The value of 'e' is usually set to the prime number 2.

    4. D

      The value of 'e' is derived from the product of 'p' and 'q'.

    Correct answer
    A

    The value of 'e' is typically 65537, a commonly chosen prime.

    Explanation

    The content explicitly states that 'e' is usually 65537, referring to it as the 'best number ever'.

  4. 4

    How is the large modulus 'n' typically calculated when generating an RSA key pair?

    1. A

      The modulus 'n' is the product of two randomly chosen prime numbers (p and q).

    2. B

      The modulus 'n' is derived from the public exponent 'e' and the private exponent 'd'.

    3. C

      The modulus 'n' is generated as a single random 4000-bit number.

    4. D

      The modulus 'n' is calculated as the sum of two large prime numbers.

    Correct answer
    A

    The modulus 'n' is the product of two randomly chosen prime numbers (p and q).

    Explanation

    The modulus 'n' is calculated by multiplying two prime numbers, 'p' and 'q', which are generated using primality tests and random number generation.

  5. 5

    What is the recommended bit length for the modulus 'n' in RSA keys for security?

    1. A

      The modulus 'n' usually ranges from 100 to 200 bits in size.

    2. B

      The modulus 'n' is often 2000 bits or even 4000 bits long.

    3. C

      The modulus 'n' is typically 512 bits in length for secure use.

    4. D

      The modulus 'n' should ideally be about 128 bits long.

    Correct answer
    B

    The modulus 'n' is often 2000 bits or even 4000 bits long.

    Explanation

    The content mentions that 'n' is going to be somewhere like 2000 bits, maybe even 4000 bits long, indicating the need for large numbers for security.

  6. 6

    What intermediate information is typically deleted after generating an RSA key pair?

    1. A

      The private key 'd' is deleted after 'n' is created.

    2. B

      The public exponent 'e' and the modulus 'n' are usually deleted.

    3. C

      The public key 'e' is deleted, and only 'n' is kept.

    4. D

      The prime numbers 'p' and 'q' are deleted from storage.

    Correct answer
    D

    The prime numbers 'p' and 'q' are deleted from storage.

    Explanation

    After calculating the private key using 'p', 'q', 'e', and other math, the intermediate information like 'p' and 'q' is essentially deleted for security.

  7. 7

    What is the main security risk if an attacker can recalculate the private key 'd'?

    1. A

      The attacker could only decrypt public messages, not sign them.

    2. B

      The attacker could impersonate the server by signing documents as it.

    3. C

      The attacker could only access the server's public network traffic.

    4. D

      The attacker could only verify signatures, not create new ones.

    Correct answer
    B

    The attacker could impersonate the server by signing documents as it.

    Explanation

    If an attacker can recalculate 'd', they can sign things as that server, essentially pretending to be that server, which is a huge problem.

  8. 8

    What is the primary goal of an attacker who has only the public key components 'e' and 'n' in RSA?

    1. A

      Their goal is to publicly announce that 'n' is a weak modulus.

    2. B

      Their goal is to calculate the private exponent 'd' from 'e' and 'n'.

    3. C

      Their goal is to create a new, stronger public key for the server.

    4. D

      Their goal is to guess the value of the public exponent 'e' quickly.

    Correct answer
    B

    Their goal is to calculate the private exponent 'd' from 'e' and 'n'.

    Explanation

    As an attacker given 'e' and 'n', the goal is to calculate 'd', the private key.

  9. 9

    What mathematical step is crucial for an attacker to derive the private key 'd' after factoring 'n'?

    1. A

      Calculating the square root of 'n' to find the primes 'p' and 'q'.

    2. B

      Calculating the sum of 'p' and 'q' to find a new modulus.

    3. C

      Calculating Euler's totient of 'n', which is ϕ(n)=(p−1)(q−1)\phi(n) = (p-1)(q-1)ϕ(n)=(p−1)(q−1).

    4. D

      Calculating the prime factorization of 'e' to simplify it.

    Correct answer
    C

    Calculating Euler's totient of 'n', which is ϕ(n)=(p−1)(q−1)\phi(n) = (p-1)(q-1)ϕ(n)=(p−1)(q−1).

    Explanation

    Once 'n' is factored into 'p' and 'q', the attacker can calculate Euler's totient of 'n', given by the formula ϕ(n)=(p−1)(q−1)\phi(n) = (p-1)(q-1)ϕ(n)=(p−1)(q−1), which is essential for deriving 'd'.

  10. 10

    What is the formula used to calculate the private exponent 'd' once Euler's totient of 'n' is known?

    1. A

      The formula used is d=e+ϕ(n)d = e + \phi(n)d=e+ϕ(n).

    2. B

      The formula used is d=e⋅ϕ(n)−1d = e \cdot \phi(n) - 1d=e⋅ϕ(n)−1.

    3. C

      The formula used is d⋅e≡0(modϕ(n))d \cdot e \equiv 0 \pmod{\phi(n)}d⋅e≡0(modϕ(n)).

    4. D

      The formula used is e⋅d≡1(modϕ(n))e \cdot d \equiv 1 \pmod{\phi(n)}e⋅d≡1(modϕ(n)).

    Correct answer
    D

    The formula used is e⋅d≡1(modϕ(n))e \cdot d \equiv 1 \pmod{\phi(n)}e⋅d≡1(modϕ(n)).

    Explanation

    The formula provided is e⋅d≡1(modϕ(n))e \cdot d \equiv 1 \pmod{\phi(n)}e⋅d≡1(modϕ(n)), which is used to find 'd' as the multiplicative inverse of 'e' modulo ϕ(n)\phi(n)ϕ(n).

  11. 11

    Why is it normally impossible for an attacker to compute Euler's totient of 'n'?

    1. A

      Because the attacker does not know the prime factors 'p' and 'q'.

    2. B

      Because the modulus 'n' is too small for accurate totient calculation.

    3. C

      Because the public key 'e' is kept secret from attackers.

    4. D

      Because the calculation requires advanced quantum computing methods.

    Correct answer
    A

    Because the attacker does not know the prime factors 'p' and 'q'.

    Explanation

    An attacker cannot compute Euler's totient of 'n' because they do not know the secret prime factors 'p' and 'q', which are required for the formula (p−1)(q−1)(p-1)(q-1)(p−1)(q−1).

  12. 12

    What is considered the fastest way for an attacker to calculate the private key 'd' in RSA?

    1. A

      Factoring the modulus 'n' into its prime components 'p' and 'q'.

    2. B

      Guessing random values for 'p' and 'q' until a match is found.

    3. C

      Using a brute-force attack on all possible values of 'd'.

    4. D

      Calculating Euler's totient of 'n' without 'p' or 'q' information.

    Correct answer
    A

    Factoring the modulus 'n' into its prime components 'p' and 'q'.

    Explanation

    The content explicitly states that the fastest way to calculate the totient of 'n' and hence the private key is to factor 'n' into 'p' and 'q'.

  13. 13

    Why is factoring a very large 'n' (e.g., 2000-bit) generally considered difficult?

    1. A

      The factoring process requires knowing the private key 'd' beforehand.

    2. B

      The modulus 'n' is always a prime number, making factorization impossible.

    3. C

      There are no known efficient algorithms for large number factorization.

    4. D

      Modern computers are not fast enough to handle such large numbers.

    Correct answer
    C

    There are no known efficient algorithms for large number factorization.

    Explanation

    Factoring very large numbers like 2000-bit or 4000-bit 'n' is considered very difficult because there aren't many good algorithms to do it unless 'p' and 'q' are chosen badly.

  14. 14

    Which scenario makes RSA factorization significantly easier for an attacker?

    1. A

      If 'p' and 'q' are prime numbers that are very close to each other.

    2. B

      If 'p' and 'q' are derived from the same initial random seed.

    3. C

      If 'p' and 'q' are prime numbers that are extremely far apart.

    4. D

      If 'p' and 'q' are chosen such that they have an even sum.

    Correct answer
    A

    If 'p' and 'q' are prime numbers that are very close to each other.

    Explanation

    If 'p' and 'q' are generated to be very close together, it becomes intuitively easier to find the factorization, as this reduces the search space for factoring algorithms.

  15. 15

    What is the name of the factorization algorithm mentioned for cracking RSA when 'p' and 'q' are close?

    1. A

      The algorithm is identified as the General Number Field Sieve.

    2. B

      The algorithm is referred to as the Quadratic Sieve Method.

    3. C

      The algorithm is called Fermat's Factorization Algorithm.

    4. D

      The algorithm is known as the Extended Euclidean Algorithm.

    Correct answer
    C

    The algorithm is called Fermat's Factorization Algorithm.

    Explanation

    Fermat's Factorization Algorithm is specifically mentioned as a really good method when 'p' and 'q' are not far apart.

  16. 16

    How does Fermat's Factorization Algorithm represent the composite number 'n'?

    1. A

      It represents 'n' as a single prime multiplied by an integer, n=a⋅kn = a \cdot kn=a⋅k.

    2. B

      It represents 'n' as the difference of two square numbers, n=a2−b2n = a^2 - b^2n=a2−b2.

    3. C

      It represents 'n' as the sum of two cube numbers, n=a3+b3n = a^3 + b^3n=a3+b3.

    4. D

      It represents 'n' as the product of three prime numbers, n=pqrn = pqrn=pqr.

    Correct answer
    B

    It represents 'n' as the difference of two square numbers, n=a2−b2n = a^2 - b^2n=a2−b2.

    Explanation

    Fermat's Factorization Algorithm utilizes the neat trick that a composite number 'n' can be expressed as the difference of two square numbers, n=a2−b2n = a^2 - b^2n=a2−b2.

  17. 17

    What is the algebraic expansion of the difference of two squares a2−b2a^2 - b^2a2−b2?

    1. A

      The expansion is (a+b)(a−b)(a + b)(a - b)(a+b)(a−b).

    2. B

      The expansion is (a2+b2)(a2−b2)(a^2 + b^2)(a^2 - b^2)(a2+b2)(a2−b2).

    3. C

      The expansion is (a−b)(a−b)(a - b)(a - b)(a−b)(a−b).

    4. D

      The expansion is (a+b)(a+b)(a + b)(a + b)(a+b)(a+b).

    Correct answer
    A

    The expansion is (a+b)(a−b)(a + b)(a - b)(a+b)(a−b).

    Explanation

    The difference of two squares a2−b2a^2 - b^2a2−b2 can be rewritten as (a+b)(a−b)(a + b)(a - b)(a+b)(a−b), which is central to Fermat's method.

  18. 18

    What is the initial guess for the variable 'a' in Fermat's Factorization Algorithm?

    1. A

      The initial guess for 'a' is a random integer less than 'n'.

    2. B

      The initial guess for 'a' is the ceiling of the square root of 'n'.

    3. C

      The initial guess for 'a' is half the value of the modulus 'n'.

    4. D

      The initial guess for 'a' is the public exponent 'e'.

    Correct answer
    B

    The initial guess for 'a' is the ceiling of the square root of 'n'.

    Explanation

    The initial guess for 'a' is the integer immediately above the square root of 'n', described as the ceiling function of the square root of 'n'.

  19. 19

    In Fermat's Factorization, what condition must a2−na^2 - na2−n satisfy for a solution to be found?

    1. A

      The result of a2−na^2 - na2−n must be less than the modulus 'n'.

    2. B

      The result of a2−na^2 - na2−n must be an odd number.

    3. C

      The result of a2−na^2 - na2−n must be a perfect square number.

    4. D

      The result of a2−na^2 - na2−n must be a prime number.

    Correct answer
    C

    The result of a2−na^2 - na2−n must be a perfect square number.

    Explanation

    For the algorithm to work, the result of a2−na^2 - na2−n must be a square number, meaning it must have an integer square root.

  20. 20

    What happens if a2−na^2 - na2−n is not a square number in Fermat's Factorization?

    1. A

      The algorithm increments 'n' by one and restarts the process.

    2. B

      The algorithm attempts to factor the value of a2−na^2 - na2−n directly.

    3. C

      The algorithm concludes that 'n' cannot be factored by this method.

    4. D

      The algorithm increments 'a' by one and tries the calculation again.

    Correct answer
    D

    The algorithm increments 'a' by one and tries the calculation again.

    Explanation

    If a2−na^2 - na2−n is not a square number, the algorithm increments 'a' by one and repeats the process, calculating a2−na^2 - na2−n again with the new 'a'.

  21. 21

    What is SageMath described as in relation to Python?

    1. A

      SageMath is an entirely different programming language, unrelated to Python.

    2. B

      SageMath is like Python, but with additional mathematical functionalities.

    3. C

      SageMath is a Python library specifically for machine learning.

    4. D

      SageMath is a stripped-down version of Python for simple calculations.

    Correct answer
    B

    SageMath is like Python, but with additional mathematical functionalities.

    Explanation

    SageMath is described as being 'like it's python but with a bunch more maths in it,' making it suitable for mathematical and cryptographic tasks.

  22. 22

    What characteristic of poorly chosen prime numbers 'p' and 'q' enables Fermat's Factorization to succeed quickly?

    1. A

      The primes 'p' and 'q' having different numbers of binary bits.

    2. B

      Their product 'n' being an odd number is the key characteristic.

    3. C

      One of the primes 'p' or 'q' being a very small single-digit number.

    4. D

      The primes 'p' and 'q' being very similar in value, or 'close together'.

    Correct answer
    D

    The primes 'p' and 'q' being very similar in value, or 'close together'.

    Explanation

    Fermat's Factorization works extremely quickly if 'p' and 'q' are fairly close to each other, such as when their first halves of bits are identical.

  23. 23

    How quickly did the Fermat factorization algorithm find the factors for the example 'n'?

    1. A

      It took many thousands of years to find the factors for 'n'.

    2. B

      It required exactly 100 iterations to find the factors.

    3. C

      It finished almost instantly, within about 10 iterations.

    4. D

      It was unable to factor the large number 'n' successfully.

    Correct answer
    C

    It finished almost instantly, within about 10 iterations.

    Explanation

    The content states that the algorithm finished very quickly, estimating 'about 10 iterations' were needed to hit on the correct 'a', highlighting its efficiency for weak 'n'.

  24. 24

    What algorithm is used by SageMath to calculate the multiplicative inverse for 'd'?

    1. A

      SageMath employs the Extended Euclidean Algorithm for the inverse.

    2. B

      SageMath relies on the Pollard's rho algorithm for the inverse.

    3. C

      SageMath uses the Fast Fourier Transform for inverse calculation.

    4. D

      SageMath applies the Miller-Rabin primality test for the inverse.

    Correct answer
    A

    SageMath employs the Extended Euclidean Algorithm for the inverse.

    Explanation

    The content explicitly mentions that the algorithm used to calculate the multiplicative inverse is the Extended Euclidean Algorithm.

  25. 25

    Why would using Fermat's Factorization on properly generated RSA numbers be ineffective?

    1. A

      It only works for numbers 'n' that are less than 1000 bits long.

    2. B

      It requires prior knowledge of the private exponent 'd' to function.

    3. C

      It is impossibly slow if the primes 'p' and 'q' are very far apart.

    4. D

      It cannot correctly identify prime factors for any valid 'n'.

    Correct answer
    C

    It is impossibly slow if the primes 'p' and 'q' are very far apart.

    Explanation

    If 'p' and 'q' are very far apart, Fermat's Factorization becomes 'impossibly slow', making it impractical for properly generated RSA numbers where 'p' and 'q' are sufficiently separated.

  26. 26

    What is a flawed method for generating 'p' and 'q' that makes them vulnerable to Fermat's Factorization?

    1. A

      Selecting two completely independent random numbers and finding primes.

    2. B

      Picking two numbers of exactly the same bit length for 'p' and 'q'.

    3. C

      Ensuring 'p' and 'q' are both large enough to be 1024 bits long.

    4. D

      Choosing a random number, then finding the next prime up and next prime down.

    Correct answer
    D

    Choosing a random number, then finding the next prime up and next prime down.

    Explanation

    Generating 'p' and 'q' by picking a random number, finding the next prime up, and then finding the next prime down will result in 'p' and 'q' being very close, making them vulnerable.

Question 1 of 26
Question 1 of 26

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent