RSA and public-key cryptography concepts (intro) - Discrete Math

Start this quiz

  1. Frank implements RSA with p=13p = 13, q=17q = 17, and e=5e = 5. He receives two ciphertexts: c1=100c_1 = 100 (encrypting m1m_1) and c2=150c_2 = 150 (encrypting m2m_2). If Frank wants to decrypt the product m1⋅m2m_1 \cdot m_2 without individually decrypting c1c_1 and c2c_2, what ciphertext should he decrypt?
    Answer: c1⋅c2 mod 221=136c_1 \cdot c_2 \bmod 221 = 136 using the multiplicative property with proper reduction RSA has the multiplicative homomorphic property: if c1≡m1e(modn)c_1 ≡ m_1^e \pmod{n} and c2≡m2e(modn)c_2 ≡ m_2^e \pmod{n}, then c1⋅c2≡(m1⋅m2)e(modn)c_1 \cdot c_2 ≡ (m_1 \cdot m_2)^e \pmod{n}. So decrypting c1⋅c2(modn)c_1 \cdot c_2 \pmod{n} gives m1⋅m2m_1 \cdot m_2. Here n=13×17=221n = 13 \times 17 = 221, so we need 100×150 mod 221=15000 mod 221=136100 \times 150 \bmod 221 = 15000 \bmod 221 = 136. Choice A incorrectly assumes additive homomorphism. Choice B forgets to reduce modulo nn. Choice D invents a non-existent exponential property.
  2. In a simplified RSA scenario, Eve intercepts Alice's public key (n,e)=(21,5)(n, e) = (21, 5) and wants to factor nn to break the system. After successfully finding p=3p = 3 and q=7q = 7, what private exponent dd should Eve compute to decrypt Alice's messages?
    Answer: d=17d = 17 since 5×17≡1(mod12)5 \times 17 ≡ 1 \pmod{12} The private exponent dd satisfies ed≡1(modϕ(n))ed ≡ 1 \pmod{\phi(n)}. With p=3p = 3 and q=7q = 7, we have ϕ(n)=ϕ(21)=(3−1)(7−1)=12\phi(n) = \phi(21) = (3-1)(7-1) = 12. We need 5d≡1(mod12)5d ≡ 1 \pmod{12}. Testing: 5×17=85=7×12+1≡1(mod12)5 \times 17 = 85 = 7 \times 12 + 1 ≡ 1 \pmod{12}, so d=17d = 17. Choice A incorrectly assumes d=ed = e. Choice B computes the congruence modulo nn instead of ϕ(n)\phi(n). Choice C has the wrong value of dd since 5×5=25≡1(mod12)5 \times 5 = 25 ≡ 1 \pmod{12} is false (25=2×12+125 = 2 \times 12 + 1 but we need 25≡125 \equiv 1, which gives 25 mod 12=125 \bmod 12 = 1, but this doesn't help since we need 5×5 mod 12=15 \times 5 \bmod 12 = 1, and 25 mod 12=125 \bmod 12 = 1 is true, making this explanation confusing - the real issue is d=5d=5 is wrong).
  3. In an RSA system, Charlie chooses primes p=11p = 11 and q=13q = 13, giving n=143n = 143. He selects public exponent e=7e = 7. When Charlie encrypts the message m=22m = 22, which statement about the outcome is accurate?
    Answer: The encryption succeeds normally since gcd⁡(22,143)=11>1\gcd(22, 143) = 11 > 1 but RSA handles this case Here φ(143)=10×12=120\varphi(143) = 10 \times 12 = 120 and gcd⁡(7,120)=1\gcd(7, 120) = 1, so e=7e = 7 is valid, with private exponent d=103d = 103 since 7×103=721=6×120+17 \times 103 = 721 = 6 \times 120 + 1. The message shares the factor 11 with nn, because 22=2×1122 = 2 \times 11, but RSA does not require gcd⁡(m,n)=1\gcd(m, n) = 1: because nn is a product of distinct primes, the Chinese Remainder Theorem shows (me)d≡m(modn)(m^e)^d \equiv m \pmod{n} for every mm from 0 to 142, so encryption and decryption both work. Saying the message cannot be encrypted confuses a proof shortcut (Euler's theorem) with a requirement; the real concern is that such a message reveals a factor of nn. The exponent is not invalid, and RSA needs m<nm < n, not m<nm < \sqrt{n}.
  4. Frank implements RSA with n=33n = 33 and e=3e = 3. He encrypts three consecutive messages m,m+1,m+2m, m+1, m+2 and observes that the first message mm produces a ciphertext equal to mm itself. What property must mm satisfy?
    Answer: mm must be one of the values where m3−m≡0(mod33)m^3 - m \equiv 0 \pmod{33} A message is a fixed point of encryption when m3≡m(mod33)m^3 \equiv m \pmod{33}, which is the same as m3−m=m(m−1)(m+1)≡0(mod33)m^3 - m = m(m - 1)(m + 1) \equiv 0 \pmod{33}. Since 33=3×1133 = 3 \times 11, solve modulo each prime. Modulo 3, every residue works, because m3≡m(mod3)m^3 \equiv m \pmod{3} by Fermat's little theorem. Modulo 11, the product is 0 only when m≡0,1m \equiv 0, 1 or 1010. Combining these with the Chinese Remainder Theorem gives 3×3=93 \times 3 = 9 fixed points: m∈{0,1,10,11,12,21,22,23,32}m \in \{0, 1, 10, 11, 12, 21, 22, 23, 32\}. Since Frank saw mm encrypt to itself, mm must be one of the values with m3−m≡0(mod33)m^3 - m \equiv 0 \pmod{33}. There is no unique fixed point, and 1 is only one of nine. The condition modulo ϕ(33)=20\phi(33) = 20 confuses Euler's theorem, which governs exponents, with the message itself, and fixed points such as 0, 11 and 12 are not even coprime to 33. The required property is m3−m≡0(mod33)m^3 - m \equiv 0 \pmod{33}.
  5. Paula implements a simplified RSA variant where she uses n=15=3×5n = 15 = 3 \times 5, e=7e = 7, and computes d=3d = 3 (since 7×3=21≡1(mod8)7 \times 3 = 21 ≡ 1 \pmod{8} where ϕ(15)=8\phi(15) = 8). When she encrypts m=2m = 2, she gets c=27 mod 15=8c = 2^7 \bmod 15 = 8. However, when she tries to decrypt c=8c = 8, what result does she obtain?
    Answer: m=83 mod 15=2m = 8^3 \bmod 15 = 2, successfully recovering the original message RSA encryption relies on modular exponentiation, where encryption uses the public key (n,e)(n, e) and decryption uses the private key (n,d)(n, d). The fundamental property is that med≡m(modn)m^{ed} \equiv m \pmod{n} when ed≡1(modϕ(n))ed \equiv 1 \pmod{\phi(n)}. To decrypt the ciphertext c=8c = 8, you compute 83 mod 158^3 \bmod 15. Let's calculate this step by step: 82=64≡4(mod15)8^2 = 64 \equiv 4 \pmod{15} (since 64=4×15+464 = 4 \times 15 + 4) 83=8×82=8×4=32≡2(mod15)8^3 = 8 \times 8^2 = 8 \times 4 = 32 \equiv 2 \pmod{15} (since 32=2×15+232 = 2 \times 15 + 2) The decryption successfully recovers the original message m=2m = 2, confirming that choice D is correct. Choice A contains a calculation error, claiming 83=178^3 = 17, which is mathematically impossible since 83=5128^3 = 512, not 17. Choice B incorrectly states that 83≡8(mod15)8^3 \equiv 8 \pmod{15}, suggesting encryption is its own inverse, but our calculation shows 83≡28^3 \equiv 2, not 8. Choice C gives the wrong result of 14 and incorrectly attributes this to the small modulus size, when in fact RSA works correctly even with small parameters like n=15n = 15. Study tip: When solving RSA problems, always verify that ed≡1(modϕ(n))ed \equiv 1 \pmod{\phi(n)} first, then carefully compute modular exponentiation step by step. Small examples like this help you understand the mechanics before tackling larger, real-world RSA parameters.
  6. Henry implements a variant where he uses n=35=5×7n = 35 = 5 \times 7 but mistakenly chooses e=6e = 6 as his public exponent. When he tries to compute the corresponding private exponent dd, what problem does he encounter?
    Answer: No integer dd satisfies 6d≡1(mod24)6d ≡ 1 \pmod{24} since gcd⁡(6,24)=6≠1\gcd(6, 24) = 6 ≠ 1 For RSA to work, we need gcd⁡(e,ϕ(n))=1\gcd(e, \phi(n)) = 1. Here ϕ(35)=ϕ(5×7)=4×6=24\phi(35) = \phi(5 \times 7) = 4 \times 6 = 24, and gcd⁡(6,24)=6≠1\gcd(6, 24) = 6 ≠ 1. Therefore, the modular inverse of 66 modulo 2424 doesn't exist, and no private exponent dd can be computed. Choice B uses the wrong modulus (nn instead of ϕ(n)\phi(n)). Choice C is incorrect because when a modular inverse doesn't exist, there are zero solutions, not multiple. Choice D assumes d=ed = e, which isn't generally true and doesn't address the fundamental issue.
  7. Grace generates RSA keys using p=11p = 11 and q=13q = 13. She chooses e=7e = 7 and correctly computes d=103d = 103. However, she accidentally uses d′=23d' = 23 (which is d mod 120d \bmod 120) as her private exponent. What happens when she attempts to decrypt a ciphertext c=50c = 50?
    Answer: Decryption succeeds normally since d′≡d(modϕ(n))d' ≡ d \pmod{\phi(n)} and ϕ(143)=120\phi(143) = 120 Since ϕ(143)=ϕ(11×13)=10×12=120\phi(143) = \phi(11 \times 13) = 10 \times 12 = 120, and d′=23≡103(mod120)d' = 23 ≡ 103 \pmod{120}, we have d′≡d(modϕ(n))d' ≡ d \pmod{\phi(n)}. The RSA decryption formula cd(modn)c^d \pmod{n} depends only on d mod ϕ(n)d \bmod \phi(n), so using d′=23d' = 23 instead of d=103d = 103 produces identical results. Choice B incorrectly assumes the reduction changes the mathematical relationship. Choice C suggests a wrong answer would result. Choice D misunderstands why the decryption works.
  8. In the RSA cryptosystem, Alice chooses primes p=7p = 7 and q=11q = 11, computes n=pq=77n = pq = 77, and selects e=13e = 13 as her public exponent. When Bob encrypts the message m=5m = 5 using Alice's public key, what is the resulting ciphertext cc?
    Answer: c=26c = 26 To encrypt, Bob computes c≡me(modn)≡513(mod77)c ≡ m^e \pmod{n} ≡ 5^{13} \pmod{77}. Using repeated squaring: 51=55^1 = 5, 52=255^2 = 25, 54=625≡9(mod77)5^4 = 625 ≡ 9 \pmod{77}, 58=81≡4(mod77)5^8 = 81 ≡ 4 \pmod{77}. Since 13=8+4+113 = 8 + 4 + 1, we have 513≡4×9×5=180≡26(mod77)5^{13} ≡ 4 \times 9 \times 5 = 180 ≡ 26 \pmod{77}. Choice B results from computing 511(mod77)5^{11} \pmod{77} (using ϕ(n)\phi(n) instead of ee). Choice C comes from 513(mod60)5^{13} \pmod{60} (using ϕ(n)\phi(n) as modulus). Choice D is 56(mod77)5^6 \pmod{77} (arithmetic error in exponent).
  9. In a public-key infrastructure, three users have the following RSA public keys: Alice (nA,eA)=(33,3)(n_A, e_A) = (33, 3), Bob (nB,eB)=(55,3)(n_B, e_B) = (55, 3), and Carol (nC,eC)=(77,3)(n_C, e_C) = (77, 3). If they all use the same public exponent e=3e = 3 and someone broadcasts the same message mm to all three, what vulnerability might this create?
    Answer: An attacker can use the Chinese Remainder Theorem to recover m3m^3 and then find mm This describes Håstad's broadcast attack. With the same message mm encrypted to three users with e=3e = 3, an attacker obtains c1≡m3(mod33)c_1 ≡ m^3 \pmod{33}, c2≡m3(mod55)c_2 ≡ m^3 \pmod{55}, and c3≡m3(mod77)c_3 ≡ m^3 \pmod{77}. Since gcd⁡(33,55)=gcd⁡(33,77)=gcd⁡(55,77)=1\gcd(33,55) = \gcd(33,77) = \gcd(55,77) = 1 and 33×55×77>m333 \times 55 \times 77 > m^3 for typical message sizes, the Chinese Remainder Theorem can recover m3m^3, and then m=m33m = \sqrt[3]{m^3}. Choice A incorrectly focuses on factorization. Choice C wrongly suggests the moduli share factors (they don't). Choice D invents a non-applicable attack method.
  10. Iris implements RSA with n=39n = 39 and discovers that her choice of public exponent e=5e = 5 creates a system where the private exponent d=5d = 5 as well. What mathematical property of this system makes it insecure?
    Answer: The condition e2≡1(modϕ(39))e^2 \equiv 1 \pmod{\phi(39)} reduces RSA to a simple involution cipher First check the numbers: 39=3×1339 = 3 \times 13, so ϕ(39)=2×12=24\phi(39) = 2 \times 12 = 24, and e⋅d=25≡1(mod24)e \cdot d = 25 \equiv 1 \pmod{24}, so d=5d = 5 is valid. Because e2≡1(modϕ(39))e^2 \equiv 1 \pmod{\phi(39)}, the private exponent equals the public one: encrypting twice returns the original message, so encryption is an involution and anyone holding the public key can decrypt. That is the weakness. Saying every ciphertext equals its plaintext is false: for example 25=32≢2(mod39)2^5 = 32 \not\equiv 2 \pmod{39}. Saying n=39n = 39 is not a product of two distinct primes is false, since 39=3×1339 = 3 \times 13. Linking e=de = d to Fermat's factoring method is wrong, because Fermat's method depends on the two primes being close together, not on the exponents.
  11. Henry analyzes an RSA system where the public key is (n,e)=(55,17)(n, e) = (55, 17) and notices that messages m=21m = 21 and m=34m = 34 both encrypt to the same ciphertext. What does this observation reveal?
    Answer: This is impossible in a correctly implemented RSA system with the given parameters Check whether the encryption map can send two different messages to the same ciphertext. Here n=55=5×11n = 55 = 5 \times 11, so φ(55)=4×10=40\varphi(55) = 4 \times 10 = 40, and gcd⁡(17,40)=1\gcd(17, 40) = 1. A decryption exponent dd with 17d≡1(mod40)17d \equiv 1 \pmod{40} exists (d=33d = 33), and because 55 is squarefree, m17d≡m(mod55)m^{17d} \equiv m \pmod{55} for every mm, including messages that share a factor with 55. So encryption is a one-to-one map on {0,1,…,54}\{0, 1, \ldots, 54\}. In fact 2117≡2121^{17} \equiv 21 and 3417≡34(mod55)34^{17} \equiv 34 \pmod{55}, so the two ciphertexts differ and the reported collision cannot happen. Both messages are coprime to 55: gcd⁡(21,55)=1\gcd(21, 55) = 1 and gcd⁡(34,55)=1\gcd(34, 55) = 1, so they are not invalid. The two messages are not congruent mod 55, since 34−21=1334 - 21 = 13. There is no collision vulnerability in correctly implemented RSA with these parameters; the observation points to an error in the computation.
  12. Oscar uses RSA with n=143=11×13n = 143 = 11 \times 13 and e=7e = 7. He wants to encrypt the message m=12m = 12 but first checks whether this creates any security vulnerabilities. What should be his primary concern?
    Answer: Since gcd⁡(12,143)=11≠1\gcd(12, 143) = 11 ≠ 1, the encrypted message may leak information about the factorization Since gcd⁡(12,143)=gcd⁡(12,11×13)=11≠1\gcd(12, 143) = \gcd(12, 11 \times 13) = 11 ≠ 1, the message shares a factor with nn. This is problematic because: (1) anyone computing gcd⁡(m,n)\gcd(m, n) learns a factor of nn, and (2) the RSA decryption may not work correctly since the mathematical foundations assume gcd⁡(m,n)=1\gcd(m, n) = 1. Choice A is wrong because encryption is still mathematically possible. Choice C incorrectly focuses on the magnitude rather than the GCD issue. Choice D ignores the fundamental security vulnerability.
  13. Diana receives the ciphertext c=41c = 41 encrypted with her RSA public key (n,e)=(55,3)(n, e) = (55, 3). Given that her private key is d=27d = 27, what is the original plaintext message mm?
    Answer: m=16m = 16 using the Chinese Remainder Theorem optimization To decrypt, compute m≡cd(modn)≡4127(mod55)m ≡ c^d \pmod{n} ≡ 41^{27} \pmod{55}. Since n=55=5×11n = 55 = 5 \times 11, we can use CRT: 4127≡127≡1(mod5)41^{27} ≡ 1^{27} ≡ 1 \pmod{5} and 4127≡827(mod11)41^{27} ≡ 8^{27} \pmod{11}. Since ϕ(11)=10\phi(11) = 10 and 27≡7(mod10)27 ≡ 7 \pmod{10}, we get 87≡5(mod11)8^7 ≡ 5 \pmod{11}. Using CRT to combine x≡1(mod5)x ≡ 1 \pmod{5} and x≡5(mod11)x ≡ 5 \pmod{11} gives x=16x = 16. Choice A gives an incorrect direct computation result. Choice C incorrectly reduces dd modulo ϕ(55)=40\phi(55) = 40. Choice D misapplies Fermat's Little Theorem.
  14. Alice generates an RSA key pair with modulus n=77n = 77 and public exponent e=13e = 13. Bob encrypts the message m=5m = 5 using Alice's public key. If Bob's encrypted message is c≡26(mod77)c \equiv 26 \pmod{77}, what happens when Alice attempts to decrypt using her private key d=37d = 37?
    Answer: Alice successfully recovers the original message m=5m = 5 To verify: cd≡2637(mod77)c^d \equiv 26^{37} \pmod{77}. Since n=77=7×11n = 77 = 7 \times 11, we have ϕ(77)=6×10=60\phi(77) = 6 \times 10 = 60. We can verify ed≡13×37≡481≡1(mod60)ed \equiv 13 \times 37 \equiv 481 \equiv 1 \pmod{60}. Computing 2637(mod77)26^{37} \pmod{77} using Euler's theorem and modular exponentiation yields 5. Choice B reflects a common error in computing the private key. Choice C suggests confusion about proper RSA modulus formation. Choice D incorrectly identifies a problem with the message - since gcd⁡(5,77)=1\gcd(5, 77) = 1, this is valid.
  15. Jack implements RSA with n=91=7×13n = 91 = 7 \times 13 and accidentally reveals that his private exponent is d=61d = 61. An adversary who intercepts this information wants to determine Jack's public exponent ee. What is the most efficient approach?
    Answer: Factor n=91n = 91 first, then solve ed≡1(modϕ(91))ed ≡ 1 \pmod{\phi(91)} directly When you encounter RSA problems involving finding one exponent given the other, you need to understand the fundamental relationship: ed≡1(modϕ(n))ed \equiv 1 \pmod{\phi(n)}, where ϕ(n)\phi(n) is Euler's totient function. The most efficient approach is D because it follows the logical sequence RSA requires. First, you factor n=91=7×13n = 91 = 7 \times 13. Then you calculate ϕ(91)=(7−1)(13−1)=6×12=72\phi(91) = (7-1)(13-1) = 6 \times 12 = 72. Finally, you solve 61e≡1(mod72)61e \equiv 1 \pmod{72} using the extended Euclidean algorithm to find ee. A is incorrect because it uses the wrong modulus. The equation 61e≡1(mod91)61e \equiv 1 \pmod{91} is mathematically wrong—RSA requires the modulus to be ϕ(n)\phi(n), not nn itself. B reverses the logical order inefficiently. While ed−1=kϕ(91)ed - 1 = k\phi(91) is mathematically correct, you'd still need to know ϕ(91)\phi(91) first, which requires factoring nn. The "verify by factoring" step should come first, not last. C is computationally wasteful. Testing small values might work for tiny examples like this, but it doesn't scale and ignores the mathematical structure that makes RSA work. You'd be guessing rather than calculating. Strategy tip: In RSA problems, always remember that the exponents are related through ϕ(n)\phi(n), not nn. When you need to find ϕ(n)\phi(n) and nn is composite, factoring nn is your essential first step. This pattern appears frequently in cryptography problems.
  16. Grace discovers that in an RSA system with n=91n = 91 and e=5e = 5, the message m=3m = 3 encrypts to c=61c = 61. She wants to verify this is correct by checking the decryption. If the private key is d=29d = 29, what should 6129 mod 9161^{29} \bmod 91 equal?
    Answer: 3, confirming the encryption-decryption cycle works correctly In RSA, decryption should recover the original message. Since n=91=7×13n = 91 = 7 \times 13, we have ϕ(91)=6×12=72\phi(91) = 6 \times 12 = 72. We can verify that ed=5×29=145≡1(mod72)ed = 5 \times 29 = 145 \equiv 1 \pmod{72}. By the RSA correctness property, cd≡(me)d≡med≡m1≡m(modn)c^d \equiv (m^e)^d \equiv m^{ed} \equiv m^1 \equiv m \pmod{n}. Therefore 6129≡3(mod91)61^{29} \equiv 3 \pmod{91}. Choice B would indicate a fixed point, which 61 is not. Choice C suggests an impossible relationship. Choice D incorrectly applies modular complement properties.
  17. In an RSA digital signature scheme, Alice signs a message hash h=42h = 42 using her private key with n=77n = 77, d=37d = 37. The resulting signature is s=49s = 49. When Bob verifies this signature using Alice's public key (n,e)=(77,13)(n, e) = (77, 13), what value should he obtain?
    Answer: Bob computes se mod n=4913 mod 77=42s^e \bmod n = 49^{13} \bmod 77 = 42, matching the original hash In RSA signatures, Alice computes s≡hd(modn)s ≡ h^d \pmod{n}, and Bob verifies by checking that se≡h(modn)s^e ≡ h \pmod{n}. Here, Bob computes 4913 mod 7749^{13} \bmod 77. Using repeated squaring: 491=4949^1 = 49, 492≡3549^2 ≡ 35, 494≡4249^4 ≡ 42, 498≡2149^8 ≡ 21. Since 13=8+4+113 = 8 + 4 + 1, we get 4913≡21×42×49≡42(mod77)49^{13} ≡ 21 \times 42 \times 49 ≡ 42 \pmod{77}, which equals the original hash. Choice B suggests the result should equal the signature itself. Choice C reverses the verification process. Choice D uses multiplication instead of exponentiation.
  18. In RSA key generation, Charlie selects p=17p = 17 and q=19q = 19. He correctly computes n=323n = 323 and ϕ(n)=288\phi(n) = 288. Which of the following values would be a valid choice for his public exponent ee?
    Answer: e=25e = 25 because gcd⁡(25,288)=1\gcd(25, 288) = 1 and 25<28825 < 288 For RSA, the public exponent ee must satisfy gcd⁡(e,ϕ(n))=1\gcd(e, \phi(n)) = 1 and 1<e<ϕ(n)1 < e < \phi(n). Since ϕ(n)=288=25×32\phi(n) = 288 = 2^5 \times 3^2 and 25=5225 = 5^2, we have gcd⁡(25,288)=1\gcd(25, 288) = 1, making e=25e = 25 valid. Choice A is wrong because ee must be coprime to ϕ(n)\phi(n), not divisible by it (gcd⁡(144,288)=144≠1\gcd(144, 288) = 144 ≠ 1). Choice B fails because e=pe = p means gcd⁡(17,288)=1\gcd(17, 288) = 1 but using a prime factor creates security vulnerabilities. Choice D violates the requirement e<ϕ(n)e < \phi(n).

Start this quiz