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

  • 41Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: Modular Definitions

What is the defining requirement for the remainder rrr in a mod Na \bmod NamodN when NNN is positive?

41 questions

  1. 1

    What is the defining requirement for the remainder rrr in a mod Na \bmod NamodN when NNN is positive?

    1. A

      The remainder must be smaller than the quotient produced by division

    2. B

      The remainder must be strictly greater than 000 and less than NNN

    3. C

      The remainder must be in the range from 000 through N−1N-1N−1

    4. D

      The remainder must have the same sign as the original integer

    Correct answer
    C

    The remainder must be in the range from 000 through N−1N-1N−1

    Explanation

    For a positive modulus NNN, the remainder rrr is defined so that 0≤r≤N−10 \le r \le N-10≤r≤N−1 and a=qN+ra = qN+ra=qN+r for some integer quotient qqq.

  2. 2

    Which equation correctly represents the definition of a mod Na \bmod NamodN?

    1. A

      a=qN+ra=qN+ra=qN+r, where 0≤r≤N−10 \le r \le N-10≤r≤N−1

    2. B

      a=q+ra=q+ra=q+r, where 0≤r≤N−10 \le r \le N-10≤r≤N−1

    3. C

      a=qN−ra=qN-ra=qN−r, where 0≤r≤N0 \le r \le N0≤r≤N

    4. D

      a=q+rNa=q+rNa=q+rN, where 0≤q≤N−10 \le q \le N-10≤q≤N−1

    Correct answer
    A

    a=qN+ra=qN+ra=qN+r, where 0≤r≤N−10 \le r \le N-10≤r≤N−1

    Explanation

    The quotient-remainder relationship is a=qN+ra=qN+ra=qN+r, with the remainder restricted to 0≤r≤N−10 \le r \le N-10≤r≤N−1.

  3. 3

    What is the value of 5 mod 45 \bmod 45mod4?

    1. A

      222

    2. B

      111

    3. C

      333

    4. D

      000

    Correct answer
    B

    111

    Explanation

    Since 5=1⋅4+15=1\cdot4+15=1⋅4+1, the remainder is 111, so 5 mod 4=15 \bmod 4=15mod4=1.

  4. 4

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

    1. A

      222

    2. B

      −2-2−2

    3. C

      111

    4. D

      000

    Correct answer
    C

    111

    Explanation

    The remainder must be in the range 000 through 222. Since −11=(−4)⋅3+1-11=(-4)\cdot3+1−11=(−4)⋅3+1, −11 mod 3=1-11 \bmod 3=1−11mod3=1.

  5. 5

    How can modular arithmetic with a positive integer be visualized using a clock with NNN marks?

    1. A

      Count clockwise from 000 and stop at the mark reached after counting the integer

    2. B

      Start at 111 and count only the marks that are prime numbers

    3. C

      Divide the integer by the number of marks and use the quotient as the answer

    4. D

      Count counterclockwise from NNN and stop at the mark reached after counting the integer

    Correct answer
    A

    Count clockwise from 000 and stop at the mark reached after counting the integer

    Explanation

    For a positive value, begin at 000 and count clockwise around the clock. The stopping position gives the remainder modulo NNN.

  6. 6

    How does the clock visualization change when computing the modulus of a negative integer?

    1. A

      The negative sign is ignored before counting

    2. B

      The count proceeds counterclockwise from 000

    3. C

      The count proceeds clockwise from 000 as usual

    4. D

      The count begins at N−1N-1N−1 and proceeds clockwise

    Correct answer
    B

    The count proceeds counterclockwise from 000

    Explanation

    The lecture describes using the same clock process in the counterclockwise direction for negative integers.

  7. 7

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

    1. A

      They have the same quotient when divided by NNN

    2. B

      They have the same remainder when divided by NNN

    3. C

      Their product is divisible by NNN

    4. D

      Their sum is equal to NNN

    Correct answer
    B

    They have the same remainder when divided by NNN

    Explanation

    The notation a≡b(modN)a \equiv b \pmod Na≡b(modN) means that aaa and bbb produce the same remainder upon division by NNN.

  8. 8

    Which condition is equivalent to a≡b(modN)a \equiv b \pmod Na≡b(modN)?

    1. A

      a−ba-ba−b is completely divisible by NNN

    2. B

      ababab is equal to NNN

    3. C

      aaa and bbb have equal quotients modulo NNN

    4. D

      a+ba+ba+b is completely divisible by NNN

    Correct answer
    A

    a−ba-ba−b is completely divisible by NNN

    Explanation

    Two integers are congruent modulo NNN if and only if their difference a−ba-ba−b is divisible by NNN.

  9. 9

    Suppose a mod N=a′a \bmod N=a'amodN=a′ and b mod N=b′b \bmod N=b'bmodN=b′. Which expression correctly computes (a+b) mod N(a+b)\bmod N(a+b)modN?

    1. A

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

    2. B

      (a′b′) mod N(a'b')\bmod N(a′b′)modN

    3. C

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

    4. D

      (a′+b′)N(a'+b')N(a′+b′)N

    Correct answer
    A

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

    Explanation

    Addition is compatible with reduction: (a+b) mod N=((a mod N)+(b mod N)) mod N=(a′+b′) mod N(a+b)\bmod N=((a\bmod N)+(b\bmod N))\bmod N=(a'+b')\bmod N(a+b)modN=((amodN)+(bmodN))modN=(a′+b′)modN.

  10. 10

    Suppose a mod N=a′a \bmod N=a'amodN=a′ and b mod N=b′b \bmod N=b'bmodN=b′. Which expression correctly computes (a−b) mod N(a-b)\bmod N(a−b)modN?

    1. A

      (a′b′) mod N(a'b')\bmod N(a′b′)modN

    2. B

      (a−b)N(a-b)N(a−b)N

    3. C

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

    4. D

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

    Correct answer
    D

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

    Explanation

    Subtraction can be performed after reducing both operands: (a−b) mod N=(a′−b′) mod N(a-b)\bmod N=(a'-b')\bmod N(a−b)modN=(a′−b′)modN.

  11. 11

    Suppose a mod N=a′a \bmod N=a'amodN=a′ and b mod N=b′b \bmod N=b'bmodN=b′. Which expression correctly computes (ab) mod N(ab)\bmod N(ab)modN?

    1. A

      (a′b′) mod N(a'b')\bmod N(a′b′)modN

    2. B

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

    3. C

      (a′b′)N(a'b')N(a′b′)N

    4. D

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

    Correct answer
    A

    (a′b′) mod N(a'b')\bmod N(a′b′)modN

    Explanation

    Multiplication is compatible with modular reduction, so (ab) mod N=(a′b′) mod N(ab)\bmod N=(a'b')\bmod N(ab)modN=(a′b′)modN.

  12. 12

    What is the main practical advantage of reducing operands before performing modular addition or multiplication?

    1. A

      It makes division by every nonzero operand valid

    2. B

      It changes the mathematical result to a larger representative

    3. C

      It eliminates the need to perform the final modular reduction

    4. D

      It replaces potentially large operands with smaller equivalent remainders

    Correct answer
    D

    It replaces potentially large operands with smaller equivalent remainders

    Explanation

    Reducing operands first preserves the final modular result while often making the intermediate arithmetic much easier.

  13. 13

    Let a=128a=128a=128 and b=201b=201b=201, with modulus 100100100. Using modular reduction before multiplication, what is (ab) mod 100(ab)\bmod 100(ab)mod100?

    1. A

      565656

    2. B

      111

    3. C

      292929

    4. D

      282828

    Correct answer
    D

    282828

    Explanation

    Reduce first: 128 mod 100=28128\bmod100=28128mod100=28 and 201 mod 100=1201\bmod100=1201mod100=1. Therefore, (ab) mod 100=(28⋅1) mod 100=28(ab)\bmod100=(28\cdot1)\bmod100=28(ab)mod100=(28⋅1)mod100=28.

  14. 14

    Why does the same reduction-before-operation principle work for addition, subtraction, and multiplication?

    1. A

      Every operation produces a result smaller than NNN automatically

    2. B

      Terms divisible by NNN contribute remainder 000 after the operation

    3. C

      The quotient of every operand is always equal to 111

    4. D

      Modular arithmetic treats all operations as ordinary division

    Correct answer
    B

    Terms divisible by NNN contribute remainder 000 after the operation

    Explanation

    Writing each operand as a multiple of NNN plus its remainder shows that the multiples of NNN vanish under final reduction, leaving the result obtained from the reduced operands.

  15. 15

    Which operation does the lecture identify as not always well-defined in ordinary modular arithmetic?

    1. A

      Subtraction

    2. B

      Addition

    3. C

      Multiplication

    4. D

      Division

    Correct answer
    D

    Division

    Explanation

    Modular division is not always well-defined because the quotient of two integers may be a fraction, and ordinary modular remainders are defined for integers.

  16. 16

    Why is 35 mod 4\frac{3}{5}\bmod 453​mod4 not ordinarily well-defined under the lecture's definition?

    1. A

      35\frac{3}{5}53​ is not an integer

    2. B

      The modulus must be larger than both operands

    3. C

      333 is smaller than the modulus

    4. D

      555 is not relatively prime to the modulus

    Correct answer
    A

    35\frac{3}{5}53​ is not an integer

    Explanation

    The standard modular remainder operation is defined for integers. Since 35=0.6\frac{3}{5}=0.653​=0.6 is not an integer, its remainder modulo 444 is not defined in this framework.

  17. 17

    What invalid inference does the lecture warn against in modular arithmetic?

    1. A

      Adding the same number to both sides of a congruence

    2. B

      Reducing both sides of a congruence modulo NNN

    3. C

      Multiplying both sides of a congruence by the modulus

    4. D

      Canceling a common factor from both sides without checking conditions

    Correct answer
    D

    Canceling a common factor from both sides without checking conditions

    Explanation

    From ac≡bc(modN)ac\equiv bc\pmod Nac≡bc(modN), one cannot always conclude a≡b(modN)a\equiv b\pmod Na≡b(modN). Cancellation is valid only under additional conditions.

  18. 18

    If ac≡bc(modN)ac\equiv bc\pmod Nac≡bc(modN), what can safely be concluded without additional assumptions?

    1. A

      NNN divides ccc always holds

    2. B

      The two products have the same remainder modulo NNN

    3. C

      a≡b(modN)a\equiv b\pmod Na≡b(modN) always holds

    4. D

      c≡1(modN)c\equiv1\pmod Nc≡1(modN) always holds

    Correct answer
    B

    The two products have the same remainder modulo NNN

    Explanation

    The given congruence directly means that acacac and bcbcbc have the same remainder modulo NNN. It does not automatically permit cancellation of ccc.

  19. 19

    Why is modular division different from modular addition and multiplication in the lecture?

    1. A

      Division is always exponential in the number of bits

    2. B

      Division never produces a remainder in the range 000 through N−1N-1N−1

    3. C

      Addition and multiplication cannot be applied to reduced operands

    4. D

      Division may produce a noninteger, and cancellation may require extra conditions

    Correct answer
    D

    Division may produce a noninteger, and cancellation may require extra conditions

    Explanation

    The lecture emphasizes both that ordinary division may produce a fraction and that common-factor cancellation in congruences is not automatically valid.

  20. 20

    What determines whether cancellation in a congruence is valid?

    1. A

      Whether the canceled factor is larger than the modulus

    2. B

      Whether certain additional conditions involving the factor and modulus hold

    3. C

      Whether both sides have different remainders

    4. D

      Whether the operands are represented in binary

    Correct answer
    B

    Whether certain additional conditions involving the factor and modulus hold

    Explanation

    The lecture states that cancellation can be justified in some cases, but only when certain conditions are satisfied; it is not universally valid.

  21. 21

    What parameter is used to measure the efficiency of the modular arithmetic algorithms discussed?

    1. A

      The numerical value of the largest remainder

    2. B

      The number of digits in the final answer only

    3. C

      The number of bits needed to represent the inputs

    4. D

      The number of prime factors of the modulus

    Correct answer
    C

    The number of bits needed to represent the inputs

    Explanation

    Complexity is measured as a function of the number of bits needed to represent the integers aaa, bbb, and NNN.

  22. 22

    If aaa, bbb, and NNN are nnn-bit integers, what kind of running time is preferred for their modular arithmetic algorithms?

    1. A

      A polynomial function of nnn

    2. B

      A constant function independent of nnn

    3. C

      An exponential function of nnn

    4. D

      A subexponential function with no input dependence

    Correct answer
    A

    A polynomial function of nnn

    Explanation

    The lecture prefers algorithms whose number of bit operations is polynomial in the input bit length nnn, rather than exponential or subexponential approaches.

  23. 23

    Which group of operations is stated to be computable using a polynomial number of bit operations in nnn?

    1. A

      Division, factoring, and primality testing

    2. B

      Clock visualization, division, and cancellation

    3. C

      Addition, subtraction, and modular multiplication

    4. D

      Exponentiation by repeated multiplication only

    Correct answer
    C

    Addition, subtraction, and modular multiplication

    Explanation

    The lecture explicitly states that addition, subtraction, and modular multiplication can all be performed in polynomial time in the bit length nnn.

  24. 24

    How is addition of two nnn-bit integers typically performed at the bit level?

    1. A

      By repeatedly dividing both operands by the modulus

    2. B

      By processing corresponding bits while managing carries

    3. C

      By converting every bit into a decimal fraction

    4. D

      By testing whether each bit position is prime

    Correct answer
    B

    By processing corresponding bits while managing carries

    Explanation

    Binary addition processes the bits of the two operands and handles carries, requiring a number of operations polynomial in nnn.

  25. 25

    Why is repeated modular multiplication for computing ab mod Na^b\bmod NabmodN not generally polynomial time in the input length?

    1. A

      The modulus NNN cannot be represented using binary notation

    2. B

      Each modular multiplication is itself impossible for large inputs

    3. C

      The exponent bbb may have numerical magnitude as large as 2n2^n2n

    4. D

      Reducing after each multiplication changes the exponent

    Correct answer
    C

    The exponent bbb may have numerical magnitude as large as 2n2^n2n

    Explanation

    Although each modular multiplication is polynomial in nnn, an nnn-bit exponent can be numerically as large as approximately 2n2^n2n, causing exponentially many repetitions.

  26. 26

    What is the central problem with the naive method of computing ab mod Na^b\bmod NabmodN by multiplying by aaa repeatedly?

    1. A

      It requires the exponent to be written in decimal form

    2. B

      It cannot reduce intermediate results modulo NNN

    3. C

      It performs a number of modular multiplications proportional to the numerical value of bbb

    4. D

      It uses fewer multiplications than necessary

    Correct answer
    C

    It performs a number of modular multiplications proportional to the numerical value of bbb

    Explanation

    The naive method requires roughly b−1b-1b−1 modular multiplications, and bbb can be exponentially large relative to its nnn-bit representation.

  27. 27

    Why is modular exponentiation especially important in the context of the lecture?

    1. A

      It replaces all uses of prime numbers in number theory

    2. B

      It makes modular division valid for every modulus

    3. C

      It is the only operation that can define a remainder

    4. D

      It is a central operation in cryptographic algorithms

    Correct answer
    D

    It is a central operation in cryptographic algorithms

    Explanation

    The lecture identifies modular exponentiation as a very important or central operation in cryptographic algorithms.

  28. 28

    What is the main idea of the square-and-multiply method?

    1. A

      Represent the exponent in binary and selectively accumulate powers of the base

    2. B

      Divide the modulus by the exponent before each multiplication

    3. C

      Multiply the base by itself once for every decimal digit of the exponent

    4. D

      Replace the exponent with its remainder modulo the base

    Correct answer
    A

    Represent the exponent in binary and selectively accumulate powers of the base

    Explanation

    Square-and-multiply uses the binary representation of the exponent. It generates successive powers by squaring and multiplies selected powers when the corresponding exponent bit is 111.

  29. 29

    Why is the method called square and multiply?

    1. A

      It repeatedly squares the current power and optionally multiplies it into an accumulator

    2. B

      It squares every bit and adds the resulting decimal values

    3. C

      It multiplies only when two adjacent exponent bits are equal

    4. D

      It squares the modulus and multiplies the exponent

    Correct answer
    A

    It repeatedly squares the current power and optionally multiplies it into an accumulator

    Explanation

    Each iteration performs a compulsory squaring to obtain the next power of the base and may perform an optional multiplication into the accumulator.

  30. 30

    What is the binary representation of the exponent 535353?

    1. A

      1001012100101_21001012​

    2. B

      1011012101101_21011012​

    3. C

      1101012110101_21101012​

    4. D

      1110012111001_21110012​

    Correct answer
    C

    1101012110101_21101012​

    Explanation

    Since 53=32+16+4+153=32+16+4+153=32+16+4+1, its binary representation is 1101012110101_21101012​.

  31. 31

    Which decomposition of a53a^{53}a53 follows from the binary representation 1101012110101_21101012​?

    1. A

      a53=a1a8a16a32a^{53}=a^1a^8a^{16}a^{32}a53=a1a8a16a32

    2. B

      a53=a1a4a16a32a^{53}=a^1a^4a^{16}a^{32}a53=a1a4a16a32

    3. C

      a53=a2a4a8a32a^{53}=a^2a^4a^8a^{32}a53=a2a4a8a32

    4. D

      a53=a1a2a8a16a^{53}=a^1a^2a^8a^{16}a53=a1a2a8a16

    Correct answer
    B

    a53=a1a4a16a32a^{53}=a^1a^4a^{16}a^{32}a53=a1a4a16a32

    Explanation

    The 111 bits in 1101012110101_21101012​ correspond to 111, 444, 161616, and 323232, so a53=a1a4a16a32a^{53}=a^1a^4a^{16}a^{32}a53=a1a4a16a32.

  32. 32

    In square-and-multiply, what does a 000 bit in the binary exponent indicate?

    1. A

      The modulus should be replaced by zero

    2. B

      The algorithm must terminate immediately

    3. C

      The current power of the base must be squared twice

    4. D

      The corresponding power of the base is excluded from the accumulator

    Correct answer
    D

    The corresponding power of the base is excluded from the accumulator

    Explanation

    A 000 bit means that the corresponding power does not appear in the binary decomposition of the exponent, so it is not accumulated.

  33. 33

    How is the next higher power of the base generated in each square-and-multiply iteration?

    1. A

      By multiplying the current power by the modulus

    2. B

      By squaring the current power modulo NNN

    3. C

      By dividing the current power by the exponent

    4. D

      By adding the current power to the modulus

    Correct answer
    B

    By squaring the current power modulo NNN

    Explanation

    Starting with a1a^1a1, squaring successively produces a2a^2a2, a4a^4a4, a8a^8a8, and so on, with each operation performed modulo NNN.

  34. 34

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

    1. A

      It stores the binary representation of the modulus

    2. B

      It stores the product of the selected powers of the base

    3. C

      It records only the quotient from each division

    4. D

      It determines whether the current exponent is prime

    Correct answer
    B

    It stores the product of the selected powers of the base

    Explanation

    The accumulator stores the running product of those powers of aaa whose corresponding exponent bits are 111.

  35. 35

    When does square-and-multiply perform its optional accumulation step?

    1. A

      Only after all exponent bits have been processed

    2. B

      Whenever the current exponent bit is 000

    3. C

      Only when the modulus is odd

    4. D

      Whenever the current exponent bit is 111

    Correct answer
    D

    Whenever the current exponent bit is 111

    Explanation

    The current power is multiplied into the accumulator when the corresponding bit of the exponent is 111.

  36. 36

    For an exponent with nnn binary bits, what is the worst-case number of modular multiplications in square-and-multiply according to the lecture?

    1. A

      At most nnn

    2. B

      At most n+1n+1n+1

    3. C

      At most 2n2n2n

    4. D

      At most 2n2^n2n

    Correct answer
    C

    At most 2n2n2n

    Explanation

    There are nnn compulsory squarings and, in the worst case, nnn optional accumulations when all bits are 111, giving at most 2n2n2n modular multiplications.

  37. 37

    Why does square-and-multiply have polynomial complexity in the exponent's bit length?

    1. A

      It performs at most a linear number of modular multiplications in the number of exponent bits

    2. B

      It avoids all modular reductions during the computation

    3. C

      It requires the modulus to contain only one bit

    4. D

      It performs a number of multiplications proportional to the exponent's numerical value

    Correct answer
    A

    It performs at most a linear number of modular multiplications in the number of exponent bits

    Explanation

    The method performs at most about 2n2n2n modular multiplications for an nnn-bit exponent, rather than a number proportional to the potentially exponential numerical value of the exponent.

  38. 38

    How can the binary representation of an exponent be generated algorithmically?

    1. A

      Repeatedly divide the exponent by the modulus and record each quotient

    2. B

      Subtract the modulus until the exponent becomes zero

    3. C

      Repeatedly divide the exponent by 222 and record each remainder

    4. D

      Square the exponent until it becomes odd

    Correct answer
    C

    Repeatedly divide the exponent by 222 and record each remainder

    Explanation

    Repeated division by 222 produces remainders of 000 or 111, which give the binary digits from least significant bit to most significant bit.

  39. 39

    In the pseudocode, what does testing whether x mod 2=1x\bmod 2=1xmod2=1 determine?

    1. A

      Whether the current least significant bit of xxx is 111

    2. B

      Whether the modulus has an odd number of bits

    3. C

      Whether the accumulator is already reduced

    4. D

      Whether the base is larger than the exponent

    Correct answer
    A

    Whether the current least significant bit of xxx is 111

    Explanation

    An odd value of xxx has least significant binary bit 111; an even value has least significant bit 000.

  40. 40

    What update advances the exponent-processing loop toward its next binary bit?

    1. A

      Replace xxx with x/2x/2x/2 after determining its parity

    2. B

      Replace xxx with x−1x-1x−1 only when it is even

    3. C

      Replace xxx with xNxNxN after each multiplication

    4. D

      Replace xxx with x2x^2x2 after each squaring

    Correct answer
    A

    Replace xxx with x/2x/2x/2 after determining its parity

    Explanation

    After reading the current least significant bit, the algorithm divides xxx by 222 to shift to the next bit.

  41. 41

    Which two operations occur during each iteration of the square-and-multiply pseudocode?

    1. A

      A compulsory division and a conditional modulus change

    2. B

      A compulsory addition and a conditional subtraction

    3. C

      A compulsory squaring and a conditional accumulator update

    4. D

      A compulsory factorization and a conditional primality test

    Correct answer
    C

    A compulsory squaring and a conditional accumulator update

    Explanation

    Each iteration squares the current power to obtain the next one, and conditionally multiplies that power into the accumulator when the current exponent bit is 111.

Question 1 of 41
Question 1 of 41

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent