1. Home
  2. Explore
  3. Computer Science
  4. Number Theory for Cryptography

Study methods

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

Number Theory for Cryptography

  • 44Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Modular Basics
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What is modular arithmetic primarily concerned with?

Tap to flipClick to flipspace

Computing the remainder obtained when an integer is divided by a positive modulus.

Or swipe the card

44 cards

  1. What is modular arithmetic primarily concerned with?

    Computing the remainder obtained when an integer is divided by a positive modulus.

  2. How is a mod Na \bmod NamodN defined for a positive modulus NNN?

    a mod N=ra \bmod N = ramodN=r, where a=qN+ra = qN + ra=qN+r and 0≤r≤N−10 \le r \le N-10≤r≤N−1.

  3. What is the result of 5 mod 45 \bmod 45mod4?

    111.

  4. What is the result of −11 mod 3-11 \bmod 3−11mod3 under the standard remainder convention?

    111.

  5. What range must the remainder have when computing a mod Na \bmod NamodN?

    The remainder must satisfy 0≤r≤N−10 \le r \le N-10≤r≤N−1.

  6. How can modular arithmetic be visualized using a clock with NNN marks?

    The clock represents the possible remainders 0,1,…,N−10,1,\ldots,N-10,1,…,N−1; counting from 000 identifies the remainder of a positive number modulo NNN.

  7. How should a negative integer be represented on the modular clock?

    Count in the anticlockwise direction from 000.

  8. What does it mean for aaa to be congruent to bbb modulo NNN?

    It means aaa and bbb have the same remainder when divided by NNN, written a≡b(modN)a \equiv b \pmod Na≡b(modN).

  9. What is an equivalent divisibility test for a≡b(modN)a \equiv b \pmod Na≡b(modN)?

    a≡b(modN)a \equiv b \pmod Na≡b(modN) if and only if NNN completely divides a−ba-ba−b.

  10. What computer science applications motivate the study of modular arithmetic in this lecture?

    Modular arithmetic is especially useful in cryptography, including modular exponentiation used in cryptographic algorithms.

  11. If a mod N=a′a \bmod N=a'amodN=a′ and b mod N=b′b \bmod N=b'bmodN=b′, how can (a+b) mod N(a+b) \bmod N(a+b)modN be computed?

    (a+b) mod N=(a′+b′) mod N(a+b) \bmod N=(a'+b') \bmod N(a+b)modN=(a′+b′)modN.

  12. If a mod N=a′a \bmod N=a'amodN=a′ and b mod N=b′b \bmod N=b'bmodN=b′, how can (a−b) mod N(a-b) \bmod N(a−b)modN be computed?

    (a−b) mod N=(a′−b′) mod N(a-b) \bmod N=(a'-b') \bmod N(a−b)modN=(a′−b′)modN.

  13. If a mod N=a′a \bmod N=a'amodN=a′ and b mod N=b′b \bmod N=b'bmodN=b′, how can (ab) mod N(ab) \bmod N(ab)modN be computed?

    (ab) mod N=(a′b′) mod N(ab) \bmod N=(a'b') \bmod N(ab)modN=(a′b′)modN.

  14. What is the general strategy for simplifying modular addition, subtraction, or multiplication?

    First reduce each operand modulo NNN, perform the operation on the smaller residues, and reduce the result modulo NNN if needed.

  15. Why do modular arithmetic operations permit operands to be reduced before the operation?

    Because addition, subtraction, and multiplication preserve congruence modulo NNN.

  16. How can the addition rule be proved using quotient-remainder representations?

    Write a=q1N+a′a=q_1N+a'a=q1​N+a′, b=q2N+b′b=q_2N+b'b=q2​N+b′, and a′+b′=q3N+ra'+b'=q_3N+ra′+b′=q3​N+r. Then a+b=(q1+q2+q3)N+ra+b=(q_1+q_2+q_3)N+ra+b=(q1​+q2​+q3​)N+r, so both expressions have remainder rrr modulo NNN.

  17. What is the efficient way to compute 1234567828⋅901 mod 1001234567828 \cdot 901 \bmod 1001234567828⋅901mod100 using operand reduction?

    Reduce the operands first: 1234567828 mod 100=281234567828 \bmod 100=281234567828mod100=28 and 901 mod 100=1901 \bmod 100=1901mod100=1. Thus the result is 28⋅1 mod 100=2828\cdot1\bmod100=2828⋅1mod100=28.

  18. Why is modular division not generally defined in the same way as modular addition or multiplication?

    The quotient a/ba/ba/b may not be an integer, so its remainder modulo NNN may be undefined.

  19. Why can 31 mod 4\frac{3}{1}\bmod413​mod4 be evaluated but 35 mod 4\frac{3}{5}\bmod453​mod4 cannot be evaluated directly?

    31=3\frac{3}{1}=313​=3 is an integer, so its residue is 333; 35=0.6\frac{3}{5}=0.653​=0.6 is not an integer, so its modulo-444 remainder is not defined.

  20. What does ac≡bc(modN)ac \equiv bc \pmod Nac≡bc(modN) imply about aaa and bbb?

    It does not necessarily imply a≡b(modN)a \equiv b \pmod Na≡b(modN).

  21. Why is cancellation of a factor ccc not always valid modulo NNN?

    Multiplication modulo NNN can map different residues to the same residue, so acacac and bcbcbc may be congruent even when aaa and bbb are not.

  22. Under what general circumstance may cancellation in a modular congruence be possible?

    Only when additional conditions on the factor and modulus are satisfied; it is not valid automatically.

  23. Which modular arithmetic algorithms are considered in the lecture?

    Algorithms for modular addition, subtraction, multiplication, and exponentiation.

  24. What parameter is used to measure the complexity of modular arithmetic algorithms?

    The number of bits, nnn, needed to represent the input integers aaa, bbb, and the modulus NNN.

  25. What type of running time is preferred for algorithms operating on nnn-bit integers?

    Polynomial running time in nnn.

  26. What is the complexity of modular addition, subtraction, and multiplication for nnn-bit inputs?

    Each can be performed using a polynomial number of bit operations in nnn.

  27. How is modular addition implemented at the bit level?

    Add corresponding bits of the two nnn-bit operands while handling carries, then reduce the resulting value modulo NNN.

  28. Why is repeated modular multiplication a poor method for computing ab mod Na^b\bmod NabmodN?

    It performs approximately bbb modular multiplications, and an nnn-bit exponent bbb can be as large as 2n2^n2n, making the method exponential in nnn.

  29. Why does the numerical magnitude of an nnn-bit exponent matter for complexity?

    An nnn-bit exponent can have magnitude on the order of 2n2^n2n, so an algorithm whose iteration count depends on the exponent value is exponential in the input length.

  30. What is the square-and-multiply method used to compute?

    It computes modular exponentiation, such as ab mod Na^b\bmod NabmodN, in polynomial time.

  31. Why is the method called square and multiply?

    Each iteration squares the current power of aaa, and conditionally multiplies that power into an accumulator.

  32. What is the binary representation of 535353?

    53=(110101)253=(110101)_253=(110101)2​.

  33. How can a53a^{53}a53 be expressed using powers selected by its binary representation?

    a53=a32a16a4aa^{53}=a^{32}a^{16}a^4aa53=a32a16a4a.

  34. In square-and-multiply exponentiation, which powers of aaa are accumulated for an exponent of 535353?

    The powers a1a^1a1, a4a^4a4, a16a^{16}a16, and a32a^{32}a32 are accumulated; powers corresponding to 000 bits, such as a2a^2a2 and a8a^8a8, are skipped.

  35. How are successive powers of aaa generated in square-and-multiply?

    Start with a1a^1a1 and repeatedly square modulo NNN: a1,a2,a4,a8,a16,a32,…a^1,a^2,a^4,a^8,a^{16},a^{32},\ldotsa1,a2,a4,a8,a16,a32,….

  36. What is the role of the accumulator in square-and-multiply?

    It stores the running product of the powers of aaa selected by the 111 bits of the exponent.

  37. When does square-and-multiply perform a conditional accumulator update?

    It updates the accumulator when the current bit of the exponent is 111; it skips the update when the bit is 000.

  38. How many compulsory squarings are required for an exponent represented using nnn bits?

    At most nnn compulsory squarings.

  39. What is the worst-case number of modular multiplications in square-and-multiply?

    At most 2n2n2n: up to nnn compulsory squarings and up to nnn conditional accumulator multiplications.

  40. How does square-and-multiply compare with the naive method for a 102410241024-bit exponent?

    The naive method may require on the order of 210242^{1024}21024 modular multiplications, whereas square-and-multiply requires only a number proportional to the exponent's bit length, about 102410241024 squarings plus conditional multiplications.

  41. How does the square-and-multiply algorithm obtain the exponent's binary representation during execution?

    Repeatedly test whether the current exponent xxx is odd, record the least significant bit as 111 if odd or 000 if even, then update xxx by integer division by 222.

  42. What are the main variables in the square-and-multiply pseudocode?

    The base, exponent xxx, modulus NNN, accumulator yyy, and current power zzz.

  43. What happens to the current power zzz after each iteration of square-and-multiply?

    It is squared modulo NNN to produce the next higher power of the base.

  44. When does the square-and-multiply loop terminate?

    It terminates when the remaining exponent variable xxx becomes 000.

Card 1 of 44
Card 1 of 44

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent