9.8 Exercises

  1. The ciphertext 5859 was obtained from the RSA algorithm using n=11413n=11413 and e=7467e=7467. Using the factorization 11413=10111311413=101113, find the plaintext.

  2. Bob sets up a budget RSA cryptosystem. He chooses p=23p=23 and q=19q=19 and computes n=437=pqn=437=pq. He chooses the encryption exponent to be e=397e=397. Alice sends Bob the ciphertext c=123c=123. What is the plaintext? (You know pp, qq, and ee).

  3. Suppose your RSA modulus is n=55=5×11n=55=5×11 and your encryption exponent is e=3e=3.

    1. Find the decryption exponent dd.

    2. Assume that gcd(m, 55)=1gcd(m, 55)=1. Show that if cm3(mod 55)cm3(mod 55) is the ciphertext, then the plaintext is mcd(mod 55)mcd(mod 55). Do not quote the fact that RSA decryption works. That is what you are showing in this specific case.

  4. Bob’s RSA modulus is 979=11×89979=11×89 and his encryption exponent is e=587e=587. Alice sends him the ciphertext c=10c=10. What is the plaintext?

  5. The ciphertext 6262 was obtained using RSA with n=667n=667 and e=3e=3. You know that the plaintext is either 9 or 10. Determine which it is without factoring nn.

  6. Alice and Bob are trying to use RSA, but Bob knows only one large prime, namely p=1093p=1093. He sends n=p=1093n=p=1093 and e=361e=361 to Alice. She encrypts her message mm as cme(mod n)cme(mod n). Eve intercepts cc and decrypts using the congruence mcd(mod n)mcd(mod n). What value of dd should Eve use? Your answer should be an actual number. You may assume that Eve knows nn and ee, and she knows that nn is prime.

  7. Suppose you encrypt messages mm by computing cm3(mod 101)cm3(mod 101). How do you decrypt? (That is, you want a decryption exponent dd such that cdm(mod 101)cdm(mod 101); note that 101 is prime.)

  8. Bob knows that if an RSA modulus can be factored, then the system has bad security. Therefore, he chooses a modulus that cannot be factored, namely the prime n=131303n=131303. He chooses his encryption exponent to be e=13e=13, and he encrypts a message mm as cm13(mod n)cm13(mod n). The decryption method is to compute mcd(mod n)mcd(mod n) for some dd. Find dd. (Hint: Fermat’s theorem)

  9. Let pp be a large prime. Suppose you encrypt a message xx by computing yxe(mod p)yxe(mod p) for some (suitably chosen) encryption exponent ee. How do you find a decryption exponent dd such that ydx(mod p)ydx(mod p)?

  10. Bob decides to test his new RSA cryptosystem. He has RSA modulus n=pqn=pq and encryption exponent ee. His message is mm. He sends cme(mod n)cme(mod n) to himself. Then, just for fun, he also sends c(m+q)e(mod n)c(m+q)e(mod n) to himself. Eve knows nn and ee, and intercepts both cc and cc. She guesses what Bob has done. How can she find the factorization of nn? (Hint: Show that cc(mod q)cc(mod q) but not mod pp. What is gcd(cc, n)gcd(cc, n)?)

  11. Let nn be the product of two large primes. Alice wants to send a message mm to Bob, where gcd(m, n)=1gcd(m, n)=1. Alice and Bob choose integers aa and bb relatively prime to ϕ(n)ϕ(n). Alice computes cma(mod n)cma(mod n) and sends cc to Bob. Bob computes dcb(mod n)dcb(mod n) and sends dd back to Alice. Since Alice knows aa, she finds a1a1 such that aa11(mod ϕ(n))aa11(mod ϕ(n)). Then she computes eda1(mod n)eda1(mod n) and sends ee to Bob. Explain what Bob must now do to obtain mm, and show that this works. (Remark: In this protocol, the prime factors of nn do not need to be kept secret. Instead, the security depends on keeping a, ba, b secret. The present protocol is a less efficient version of the three-pass protocol from Section 3.5.)

  12. A bank in Alice Springs (Australia), also known as Alice, wants to send a lot of financial data to the Bank of Baltimore, also known as Bob. They want to use AES, but they do not share a common key. All of their communications will be on public airwaves. Describe how Alice and Bob can accomplish this using RSA.

  13. Naive Nelson uses RSA to receive a single ciphertext cc, corresponding to the message mm. His public modulus is nn and his public encryption exponent is ee. Since he feels guilty that his system was used only once, he agrees to decrypt any ciphertext that someone sends him, as long as it is not cc, and return the answer to that person. Evil Eve sends him the ciphertext 2ec(mod n)2ec(mod n). Show how this allows Eve to find mm.

  14. Eve loves to do double encryption. She starts with a message mm. First, she encrypts it twice with a one-time pad (the same one each time). Then she encrypts the result twice using a Vigenère cipher with key NANANANANANA. Finally, she encrypts twice with RSA using modulus n=pq=7919×17389n=pq=7919×17389 and exponent e=66909025e=66909025. It happens that e21(mod (p1)(q1))e21(mod (p1)(q1)). Show that the final result of all this encryption is the original plaintext. Explain your answer fully. Simply saying something like “decryption is the same as encryption” is not enough. You must explain why.

  15. In order to increase security, Bob chooses nn and two encryption exponents e1e1, e2e2. He asks Alice to encrypt her message mm to him by first computing c1me1(mod n)c1me1(mod n), then encrypting c1c1 to get c2ce21(mod n)c2ce21(mod n). Alice then sends c2c2 to Bob. Does this double encryption increase security over single encryption? Why or why not?

    1. Eve thinks that she has a great strategy for breaking RSA that uses a modulus nn that is the product of two 300-digit primes. She decides to make a list of all 300-digit primes and then divide each of them into nn until she factors nn. Why won’t this strategy work?

    2. Eve has another strategy. She will make a list of all mm with 0m<106000m<10600, encrypt each mm, and store them in a database. Suppose Eve has a superfast computer that can encrypt 10501050 plaintexts per second (this is, of course, well beyond the speed of any existing technology). How many years will it take Eve to compute all 1060010600 encryptions? (There are approximately 3×1073×107 seconds in a year.)

  16. The exponents e=1e=1 and e=2e=2 should not be used in RSA. Why?

  17. Alice is trying to factor n=57677n=57677. She notices that 123441(mod n)123441(mod n) and that 1234223154(mod n)1234223154(mod n). How does she use this information to factor nn? Describe the steps but do not actually factor nn.

  18. Let pp and qq be distinct odd primes, and let n=pqn=pq. Suppose that the integer xx satisfies gcd(x, pq)=1gcd(x, pq)=1.

    1. Show that x12ϕ(n)1(mod p)x12ϕ(n)1(mod p) and x12ϕ(n)1(mod q)x12ϕ(n)1(mod q).

    2. Use (a) to show that x12ϕ(n)1(mod n)x12ϕ(n)1(mod n).

    3. Use (b) to show that if ed1(mod 12ϕ(n))ed1(mod 12ϕ(n)) then xedx(mod n)xedx(mod n). (This shows that we could work with 12ϕ(n)12ϕ(n) instead of ϕ(n)ϕ(n) in RSA. In fact, we could also use the least common multiple of p1p1 and q1q1 in place of ϕ(n)ϕ(n), by similar reasoning.)

  19. Alice uses RSA with n=27046456501n=27046456501 and e=3e=3. Her ciphertext is c=1860867c=1860867. Eve notices that c141(mod n)c141(mod n).

    1. Show that m141(mod n)m141(mod n), where mm is the plaintext.

    2. Explicitly find an exponent ff such that cfm(mod n)cfm(mod n). (Hint: You do not need to factor nn to find ff. Look at the proof that RSA decryption works. The only property of ϕ(n)ϕ(n) that is used is that mϕ(n)1mϕ(n)1.)

  20. Suppose that there are two users on a network. Let their RSA moduli be n1n1 and n2n2, with n1n1 not equal to n2n2. If you are told that n1n1 and n2n2 are not relatively prime, how would you break their systems?

  21. Huey, Dewey, and Louie ask their uncle Donald, “Is n=19887974881n=19887974881 prime or composite?” Donald replies, “Yes.” Therefore, they decide to obtain more information on their own.

    1. Huey computes 13(n1)16739180549(mod n)13(n1)16739180549(mod n). What does he conclude?

    2. Dewey computes 7n11(mod n)7n11(mod n), and he does this by computing

      7(n1)/321992941816(modn)7(n1)/16198877306197(n1)/817(n1)/47(n1)/27(n1)1.
      7(n1)/327(n1)/167(n1)/87(n1)/41992941816(modn)1988773061917(n1)/27(n1)1.

      What information can Dewey obtain from his calculation that Huey does not obtain?

    3. Louie notices that 1985793065521232(mod n)1985793065521232(mod n). What information can Louie compute? (In parts (b) and (c), you do not need to do the calculations, but you should indicate what calculations need to be done.)

  22. You are trying to factor n=642401n=642401. Suppose you discover that

    51610727(mod n)
    51610727(mod n)

    and that

    1877222227(mod n).
    1877222227(mod n).

    Use this information to factor nn.

  23. Suppose you know that 7961272(mod 8051)7961272(mod 8051). Use this information to factor 80518051.

  24. Suppose you discover that

    88052522, 205720223, 64858126, 668676277(mod 2288233).
    88052522, 205720223, 64858126, 668676277(mod 2288233).

    How would you use this information to factor 2288233? Explain what steps you would do, but do not perform the numerical calculations.

  25. Suppose you want to factor an integer nn. You have found some integers x1, x2, x3, x4x1, x2, x3, x4 such that

    x21237(mod n),   x22357(mod n)x2339(mod n),   x2427(mod n).
    x21237(mod n),   x22357(mod n)x2339(mod n),   x2427(mod n).

    Describe how you might be able to use this information to factor nn? Why might the method fail?

  26. Suppose you have two distinct large primes pp and qq. Explain how you can find an integer xx such that

    x249(modpq), x  ±7(modpq).
    x249(modpq), x  ±7(modpq).

    (Hint: Use the Chinese Remainder Theorem to find four solutions to x249(mod pq)x249(mod pq).)

  27. You are told that

    59451768(mod 1891), 518901(mod 1891).
    59451768(mod 1891), 518901(mod 1891).

    Use this information to factor 18911891.

  28. Suppose nn is a large odd number. You calculate 2(n1)/2k(mod n)2(n1)/2k(mod n), where kk is some integer with k  ±1(mod n)k  ±1(mod n).

    1. Suppose k2  1(mod n)k2  1(mod n). Explain why this implies that nn is not prime.

    2. Suppose k21(mod n)k21(mod n). Explain how you can use this information to factor nn.

    1. Bob is trying to set up an RSA cryptosystem. He chooses n=pqn=pq and ee, as usual. By encrypting messages six times, Eve guesses that e61(mod (p1)(q1))e61(mod (p1)(q1)). If this is the case, what is the decryption exponent dd? (That is, give a formula for dd in terms of the parameters nn and ee that allows Eve to compute dd.)

    2. Bob tries again, with a new nn and ee. Alice computes cme(mod n)cme(mod n). Eve sees no way to guess the decryption exponent dd this time. Knowing that if she finds dd she will have to do modular exponentiation, Eve starts computing successive squares: c, c2, c4, c8, (mod n)c, c2, c4, c8, (mod n). She notices that c321(mod n)c321(mod n) and realizes that this means that m321(mod n)m321(mod n). If e=53e=53, what is a value for dd that will decrypt the ciphertext? Prove that this value works.

  29. Suppose two users Alice and Bob have the same RSA modulus nn and suppose that their encryption exponents eAeA and eBeB are relatively prime. Charles wants to send the message mm to Alice and Bob, so he encrypts to get cAmeAcAmeA and cBmeB(mod n)cBmeB(mod n). Show how Eve can find mm if she intercepts cAcA and cBcB.

  30. Bob finally sets up a very secure RSA system. In fact, it is so secure that he decides to tell Alice one of the prime factors of nn; call it pp. Being no dummy, he does not take the message as pp, but instead uses a shift cipher to hide the prime in the plaintext m=p+1m=p+1, and then does an RSA encryption to obtain cme(mod n)cme(mod n). He then sends cc to Alice. Eve intercepts cc, nn and ee, and she knows that Bob has encrypted pp this way. Explain how she obtains pp and qq quickly. (Hint: How does cc differ from the result of encrypting the simple plaintext “1” ?)

  31. Suppose Alice uses the RSA method as follows. She starts with a message consisting of several letters, and assigns a=1, b=2, , z=26a=1, b=2, , z=26. She then encrypts each letter separately. For example, if her message is catcat, she calculates 3e(mod n)3e(mod n), 1e(mod n)1e(mod n), and 20e(mod n)20e(mod n). Then she sends the encrypted message to Bob. Explain how Eve can find the message without factoring nn. In particular, suppose n=8881n=8881 and e=13e=13. Eve intercepts the message

    4461794201520153603.
    4461794201520153603.

    Find the message without factoring 8881.

  32. Let n=3837523n=3837523. Bob Square Messages sends and receives only messages mm such that mm is a square mod nn and gcd(m, n)=1gcd(m, n)=1. It can be shown that m9582301(mod n)m9582301(mod n) for such messages (even though ϕ(n)958230ϕ(n)958230). Bob chooses dd and ee satisfying de1(mod 958230)de1(mod 958230). Show that if Alice sends Bob a ciphertext cme(mod n)cme(mod n) (where mm is a square mod nn, and gcd(m, n)=1gcd(m, n)=1), then Bob can decrypt by computing cd(mod n)cd(mod n). Explain your reasoning.

  33. Show that if x2y2(mod n)x2y2(mod n) and x  ±y(mod n)x  ±y(mod n), then gcd(x+y, n)gcd(x+y, n) is a nontrivial factor of nn.

  34. Bob’s RSA system uses n=2776099n=2776099 and e=421e=421. Alice encrypts the message 27182718 and sends the ciphertext to Bob. Unfortunately (for Alice), 2718101(mod n)2718101(mod n). Show that Alice’s ciphertext is the same as the plaintext. (Do not factor nn. Do not compute m421(mod n)m421(mod n) without using the extra information that 27181012718101. Do not claim that ϕ(2776099=10ϕ(2776099=10; it doesn’t.)

  35. Let n=pqn=pq be the product of two distinct primes.

    1. Let mm be a multiple of ϕ(n)ϕ(n). Show that if gcd(a, n)=1gcd(a, n)=1, then am1(mod p)am1(mod p) and (mod q)(mod q).

    2. Suppose mm is as in part (a), and let aa be arbitrary (possibly gcd(a, n)1gcd(a, n)1). Show that am+1a(mod p)am+1a(mod p) and (mod q)(mod q).

    3. Let ee and dd be encryption and decryption exponents for RSA with modulus nn. Show that aeda(mod n)aeda(mod n) for all aa. This shows that we do not need to assume gcd(a, n)=1gcd(a, n)=1 in order to use RSA.

    4. If pp and qq are large, why is it likely that gcd(a, n)=1gcd(a, n)=1 for a randomly chosen aa?

  36. Alice and Bob are celebrating Pi Day. Alice calculates 230392314(mod 79927)230392314(mod 79927) and Bob calculates 351182314(mod 79927)351182314(mod 79927).

    1. Use this information to factor 7992779927. (You should show how to use the information. Do not do the calculation. The answer is not “Put the number in the computer and then relax for 10 minutes.”)

    2. Given that 79927=257×31179927=257×311 and that 1662314(mod 257)1662314(mod 257) and 252314(mod 311)252314(mod 311), how would you produce the numbers 23039 and 35118 in part (a)? You do not need to do the calculations, but you should state which congruences are being solved and what theorems are being used.

    3. Now that Eve knows that 79927=257×31179927=257×311, she wants to find an x  ±17(mod 79927)x  ±17(mod 79927) such that x2172(mod 79927)x2172(mod 79927). Explain how to accomplish this. Say what the method is. Do not do the calculation.

  37. Suppose n=pqrn=pqr is the product of three distinct primes. How would an RSA-type scheme work in this case? In particular, what relation would ee and dd satisfy?

    Note: There does not seem to be any advantage in using three primes instead of two. The running times of some factorization methods depend on the size of the smallest prime factor. Therefore, if three primes are used, the size of nn must be increased in order to achieve the same level of security as obtained with two primes.

  38. Suppose Bob’s public key is n=2181606148950875138077n=2181606148950875138077 and he has e=7e=7 as his encryption exponent. Alice encrypts the message hi eve = 080900052205=m080900052205=m. By chance, the message mm satisfies m31(mod n)m31(mod n). If Eve intercepts the ciphertext, how can Eve read the message without factoring nn?

  39. Let p=7919p=7919 and q=17389q=17389. Let e=66909025e=66909025. A calculation shows that e21(mod (p1)(q1))e21(mod (p1)(q1)). Alice decides to encrypt the message m=12345m=12345 using RSA with modulus n=pqn=pq and exponent ee. Since she wants the encryption to be very secure, she encrypts the ciphertext, again using nn and ee (so she has double encrypted the original plaintext). What is the final ciphertext that she sends? Justify your answer without using a calculator.

  40. You are told that 71722602(mod 14351)71722602(mod 14351). Use this information to factor 1435114351. You must use this information and you must give all steps of the computation (that is, give the steps you use if you are doing it completely without a calculator).

    1. Show that if gcd(e, 24)=1gcd(e, 24)=1, then e21(mod 24)e21(mod 24).

    2. Show that if n=35n=35 is used as an RSA modulus, then the encryption exponent ee always equals the decryption exponent dd.

    1. The exponent e=3e=3 has sometimes been used for RSA because it makes encryption fast. Suppose that Alice is encrypting two messages, m0=mm0=m and m1=m+1m1=m+1 (for example, these could be two messages that contain a counter variable that increments). Eve does not know mm but knows that the two plaintexts differ by 1. Let c0m30c0m30 and c1m31c1m31 mod nn. Show that if Eve knows c0c0 and c1c1, she can recover mm. (Hint: Compute (c1+2c01)/(c1c0+2)(c1+2c01)/(c1c0+2).)

    2. Suppose that m0=mm0=m and m1=m+bm1=m+b for some publicly known bb. Modify the technique of part (a) so that Eve can recover mm from the ciphertexts c0c0 and c1c1.

  41. Your opponent uses RSA with n=pqn=pq and encryption exponent ee and encrypts a message mm. This yields the ciphertext cme(mod n)cme(mod n). A spy tells you that, for this message, m123451(mod n)m123451(mod n). Describe how to determine mm. Note that you do not know pp, qq, ϕ(n)ϕ(n), or the secret decryption exponent dd. However, you should find a decryption exponent that works for this particular ciphertext. Moreover, explain carefully why your decryption works (your explanation must include how the spy’s information is used). For simplicity, assume that gcd(12345, e)=1gcd(12345, e)=1.

    1. Show that if gcd(b, 1729)=1gcd(b, 1729)=1 then b17281(mod 1729)b17281(mod 1729). You may use the fact that 1729=713191729=71319.

    2. By part (a), you know that 217281(mod 1729)217281(mod 1729). When checking this result, you compute 2541065(mod 1729)2541065(mod 1729) and 21081(mod 1729)21081(mod 1729). Use this information to find a nontrivial factor of 1729.

  42. Suppose you are using RSA (with modulus n=pqn=pq and encrypting exponent ee), but you decide to restrict your messages to numbers mm satisfying m10001(mod n)m10001(mod n).

    1. Show that if dd satisfies de1(mod 1000)de1(mod 1000), then dd works as a decryption exponent for these messages.

    2. Assume that both pp and qq are congruent to 1 mod 1000. Determine how many messages satisfy m10001(mod n)m10001(mod n). You may assume and use the fact that m10001(mod r)m10001(mod r) has 1000 solutions when rr is a prime congruent to 1 mod 1000.

  43. You may assume the fact that m2703001(mod 1113121)m2703001(mod 1113121) for all mm with gcd(m, 1113121)=1gcd(m, 1113121)=1. Let ee and dd satisfy ed1(mod 270300)ed1(mod 270300), and suppose that mm is a message such that 0<m<11131210<m<1113121 and gcd(m, 1113121)=1gcd(m, 1113121)=1. Encrypt mm as cme(mod 1113121)cme(mod 1113121). Show that mcd(mod 1113121)mcd(mod 1113121). Show explicitly how you use the fact that ed1(mod 270300)ed1(mod 270300) and the fact that m2703001(mod 1113121)m2703001(mod 1113121). (Note: ϕ(1113121)270300ϕ(1113121)270300, so Euler’s theorem does not apply.)

  44. Suppose Bob’s encryption company produces two machines, A and B, both of which are supposed to be implementations of RSA using the same modulus n=pqn=pq for some unknown primes pp and qq. Both machines also use the same encryption exponent ee. Each machine receives a message mm and outputs a ciphertext that is supposed to be me(mod n)me(mod n). Machine A always produces the correct output cc. However, Machine B, because of implementation and hardware errors, always outputs a ciphertext c(mod n)c(mod n) such that cme(mod p)cme(mod p) and cme+1(mod q)cme+1(mod q). How could you use machines A and B to find pp and qq? (See Computer Problem 11 for a discussion of how such a situation could arise.) (Hint: cc(mod p)cc(mod p) but not mod qq. What is gcd(cc, n)gcd(cc, n)?)

  45. Alice and Bob play the following game. They choose a large odd integer nn and write n1=2kmn1=2km with mm odd. Alice then chooses a random integer r  ±1(mod n)r  ±1(mod n) with gcd(r, n)=1gcd(r, n)=1. Bob computes x1rm(mod n)x1rm(mod n). Then Alice computes x2x21(mod n)x2x21(mod n). Then Bob computes x3x22(mod n)x3x22(mod n), Alice computes x4x23(mod n)x4x23(mod n), etc. They stop if someone gets ±1(mod n)±1(mod n), and the person who gets ±1±1 wins.

    1. Show that if nn is prime, the game eventually stops.

    2. Suppose nn is the product of two distinct primes and Alice knows this factorization. Show how Alice can choose rr so that she wins on her first play. That is, x1  ±1(mod n)x1  ±1(mod n) but x2±1(mod n)x2±1(mod n).

    1. Suppose Alice wants to send a short message mm but wants to prevent the short message attack of Section 9.2. She tells Bob that she is adjoining 100 zeros at the end of her plaintext, so she is using m1=10100mm1=10100m as the plaintext and sending c1me1c1me1. If Eve knows that Alice is doing this, how can Eve modify the short plaintext attack and possibly find the plaintext?

    2. Suppose Alice realizes that the method of part (a) does not provide security, so instead she makes the plaintext longer by repeating it two times: m||mm||m (where x||yx||y means we write the digits of xx followed by the digits of yy to obtain a longer number). If Eve knows that Alice is doing this, how can Eve modify the short plaintext attack and possibly find the plaintext? Assume that Eve knows the length of mm. (Hint: Express m||mm||m as a multiple of mm.)

  46. This exercise provides some of the details of how the quadratic sieve obtains the relations that are used to factor a large odd integer nn. Let ss be the smallest integer greater than the square root of nn and let f(x)=(x+s)2nf(x)=(x+s)2n. Let the factor base BB consist of the primes up to some bound BB. We want to find squares that are congruent mod nn to a product of primes in BB. One way to do this is to find values of f(x)f(x) that are products of primes in BB. We’ll search over a range 0xA0xA, for some AA.

    1. Suppose 0x<(21)n10x<(21)n1. Show that 0f(x)<n0f(x)<n, so f(x)(mod n)f(x)(mod n) is simply f(x)f(x). (Hint: Show that x+s<x+n+1<2nx+s<x+n+1<2n.) Henceforth, we’ll assume that A<(21)n1A<(21)n1, so the values of xx that we consider have f(x)<nf(x)<n.

    2. Let pp be a prime in BB. Show that if there exists an integer xx with f(x)f(x) divisible by pp, then nn is a square mod pp. This shows that we may discard those primes in BB for which nn is not a square mod pp. Henceforth, we will assume that such primes have been discarded.

    3. Let pBpB be such that nn is a square mod pp. Show that if pp is odd, and p|np|n, then there are exactly two values of xx mod pp such that f(x)0(mod p)f(x)0(mod p). Call these values xp, 1xp, 1 and xp, 2xp, 2. (Note: In the unlikely case that p|np|n, we have found a factor, which was the goal.)

    4. For each xx with 0xA0xA, initialize a register with value logf(x).logf(x). For each prime pBpB, subtract logplogp from the registers of those xx with xxp, 1 or xp, 2(mod p)xxp, 1 or xp, 2(mod p). (Remark: This is the “sieving” part of the quadratic sieve.) Show that if f(x)f(x) (with 0xA0xA) is a product of distinct primes in BB, then the register for xx becomes 0 at the end of this process.

    5. Explain why it is likely that if f(x)f(x) (with 0xA0xA) is a product of (possibly nondistinct) primes in BB, then the final result for the register for xx is small (compared to the register for an xx such that f(x)f(x) has a prime factor not in BB).

    6. Why is the procedure of part (d) faster than trial division of each f(x)f(x) by each element of BB, and why does the algorithm subtract logplogp rather than dividing f(x)f(x) by pp?

    In practice, the sieve also takes into account solutions to f(x)0f(x)0 mod some powers of small primes in BB. After the sieving process is complete, the registers with small entries are checked to see which correspond to f(x)f(x) being a product of primes from BB. These give the relations “square product of primes in BB mod nn” that are used to factor nn.

  47. Bob chooses n=pqn=pq to be the product of two large primes p, qp, q such that gcd(pq, (p1)(q1))=1gcd(pq, (p1)(q1))=1.

    1. Show that ϕ(n2)=nϕ(n)ϕ(n2)=nϕ(n) (this is true for any positive nn).

    2. Let k0k0. Show that (1+n)k1+kn(mod n2)(1+n)k1+kn(mod n2) (this is true for any positive nn).

    3. Alice has message represented as m(mod n)m(mod n). She encrypts mm by first choosing a random integer rr with gcd(r, n)=1gcd(r, n)=1. She then computes

      c(1+n)mrn(mod n2).
      c(1+n)mrn(mod n2).
    4. Bob decrypts by computing mcϕ(n)(mod n2)mcϕ(n)(mod n2). Show that m1+ϕ(n)mn(mod n2)m1+ϕ(n)mn(mod n2). Therefore, Bob can recover the message by computing (m1)/n(m1)/n and then dividing by ϕ(n)(mod n)ϕ(n)(mod n).

    5. Let E(m)E(m) and D(c)D(c) denote encryption and decryption via the method in parts (c) and (d). Show that

      D(E(m1)E(m2))D(E(m1+m2))(modn).
      D(E(m1)E(m2))D(E(m1+m2))(modn).
      (9.1)

      Note: The encryptions probably use different values of the random number rr, so there is more than one possible encryption of a message mm. Part (e) says that, no matter what choices are made for rr, the decryption of E(m1)E(m2)E(m1)E(m2) is the same as the decryption of E(m1+m2)E(m1+m2).

    The preceding is called the Paillier cryptosystem. (Equation 9.1) says that is is possible to do addition on the encrypted messages without knowing the messages. For many years, a goal was to design a cryptosystem where both addition and multiplication could be done on the encrypted messages. This property is called homomorphic encryption, and the first such system was designed by Gentry in 2009. Current research aims at designing systems that can be used in practice.

  48. One possible application of the Paillier cryptosystem from the previous exercise is to electronic voting (but, as we’ll see, modifications are needed in order to make it secure). Bob, who is the trusted authority, sets up the system. Each voter uses m=0m=0 for NO and m=1m=1 for YES. The voters encrypt their mms and send the ciphertexts to Bob.

    1. How does Bob determine how many YES and how many NO votes without decrypting the individual votes?

    2. Suppose an overzealous and not very honest voter wants to increase the number of YES votes. How is this accomplished?

    3. Suppose someone else wants to increase the number of NO votes. How can this be done?

  49. Here is a 3-person encryption scheme based on the same principles as RSA. A trusted entity chooses two large distinct primes pp and qq and computes n=pqn=pq, then chooses three integers k1, k2, k3k1, k2, k3 with k1k2k31(mod (p1)(q1))k1k2k31(mod (p1)(q1)). Alice, Bob, and Carla are given the following keys:

    Alice: (n, k1, k2), Bob: (n, k2, k3), Carla: (n, k1, k3).
    1. Alice has a message that she wants to send to both Bob and Carla. How can Alice encrypt the message so that both of them can read decrypt it?

    2. Alice has a message that she wants to send only to Carla. How can Alice encrypt the message so that Carla can decrypt it but Bob cannot decrypt it?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.226.165.247