Number Theory for Cryptography
- 38Unfamiliar
- 0Learning
- 0Familiar
- 0Mastered
What is the definition of amodN when N is a positive modulus?
38 questions
- 1
What is the definition of amodN when N is a positive modulus?
Model answer
amodN is the unique remainder r such that a=qN+r for some integer q, where 0≤r≤N−1.
Explanation
The modulus operation assigns every integer a remainder in the standard range from 0 through N−1.
- 2
Compute 5mod4 and −11mod3.
Model answer
5mod4=1 and −11mod3=1.
Explanation
5=1(4)+1, while −11=(−4)(3)+1.
- 3
Why is −11mod3 equal to 1 rather than −2?
Model answer
Although −2 is also congruent to −11 modulo 3, the standard remainder must lie in the range 0 to N−1, so the answer is 1.
Explanation
For modulus 3, valid remainders are only 0, 1, and 2.
- 4
How can a clock with N marks be used to visualize modular arithmetic for positive and negative integers?
Model answer
For a positive integer, count clockwise from 0; for a negative integer, count anticlockwise. The mark where the counting stops is the remainder modulo N.
Explanation
The clock represents the possible remainders 0,1,…,N−1 and their repeating cycle.
- 5
Define the statement a≡b(modN).
Model answer
a is congruent to b modulo N if amodN and bmodN are equal.
Explanation
Congruent integers produce the same remainder when divided by the same modulus.
- 6
State the divisibility condition equivalent to a≡b(modN).
Model answer
a≡b(modN) if and only if N completely divides a−b.
Explanation
Equivalently, there is an integer k such that a−b=kN.
- 7
If amodN=a′ and bmodN=b′, how can (a+b)modN be computed?
Model answer
(a+b)modN=(a′+b′)modN.
Explanation
The operands may be reduced modulo N before addition without changing the final remainder.
- 8
If amodN=a′ and bmodN=b′, how can (a−b)modN be computed?
Model answer
(a−b)modN=(a′−b′)modN.
Explanation
Subtraction respects modular equivalence, so reducing both operands first is valid.
- 9
If amodN=a′ and bmodN=b′, how can (ab)modN be computed?
Model answer
(ab)modN=(a′b′)modN.
Explanation
Multiplication also respects modular equivalence.
- 10
Explain the general principle behind the modular addition, subtraction, and multiplication rules.
Model answer
You may first reduce each operand modulo N, perform the operation on the smaller residues, and reduce the result again if necessary.
Explanation
This procedure has the same effect as performing the operation on the original operands and then reducing modulo N.
- 11
Use modular reduction to compute (12328⋅4501)mod100.
Model answer
Since 12328mod100=28 and 4501mod100=1, the result is (28⋅1)mod100=28.
Explanation
Reducing the operands first avoids multiplying the original large numbers.
- 12
Why is ordinary modular division not always well-defined?
Model answer
The quotient a/b may not be an integer, and the modulus operation is defined for integer values using integer remainders.
Explanation
For example, 3/5=0.6, so 0.6mod4 is not defined under the given definition.
- 13
Use the example a=3, b=5, and N=4 to show why reducing operands before division does not work.
Model answer
Reducing gives 3mod4=3 and 5mod4=1, so 3/1mod4=3, but 3/5=0.6 and 0.6mod4 is not well-defined.
Explanation
Thus, division does not obey the same reduce-first rule as addition, subtraction, and multiplication.
- 14
Does ac≡bc(modN) always imply a≡b(modN)?
Model answer
No. Congruent products do not always permit cancellation of the common factor c.
Explanation
Cancellation is valid only under additional conditions; it cannot be assumed in modular arithmetic.
- 15
What does modular cancellation mean, and why must it be used cautiously?
Model answer
Modular cancellation means removing a common factor from both sides of a congruence, but this is valid only in certain cases and is not a general modular rule.
Explanation
The lecture emphasizes that c cannot necessarily be canceled from ac≡bc(modN).
- 16
What modular arithmetic operations are discussed as algorithmic problems?
Model answer
The operations are modular addition, modular subtraction, modular multiplication, and modular exponentiation.
Explanation
The lecture focuses on algorithms for these operations, especially exponentiation.
- 17
Why is modular exponentiation especially important in computer science?
Model answer
Modular exponentiation is a central operation in cryptographic algorithms.
Explanation
Its efficiency is particularly important because cryptographic computations often use very large integers.
- 18
What parameter is used to measure the complexity of modular arithmetic algorithms in this lecture?
Model answer
Complexity is measured by the number of bit operations as a function of n, the number of bits needed to represent the input integers and modulus.
Explanation
The inputs a, b, and N are treated as n-bit integers.
- 19
What type of running time is preferred for algorithms operating on n-bit integers?
Model answer
Polynomial running time in n is preferred; exponential and subexponential running times are undesirable.
Explanation
The relevant input-size parameter is the bit length, not the numerical magnitude of the integers.
- 20
Why can modular addition, subtraction, and multiplication be performed in polynomially many bit operations?
Model answer
Binary addition, subtraction, and multiplication can be carried out using a polynomial number of operations on the input bits, followed by modular reduction, which is also polynomial.
Explanation
The lecture describes bit-by-bit arithmetic with carries and operations on n-bit values.
- 21
Why is repeated modular multiplication a poor algorithm for computing abmodN?
Model answer
It performs approximately b modular multiplications, and an n-bit exponent b can have magnitude as large as 2n, making the running time exponential in n.
Explanation
The number of required multiplications depends on the numerical value of b, not merely its bit length.
- 22
Why does an n-bit exponent potentially make naive modular exponentiation infeasible?
Model answer
An n-bit exponent can be exponentially large in its representation length, so performing one multiplication for each unit of the exponent may require exponentially many operations.
Explanation
For example, a 1024-bit exponent can be close to 21024.
- 23
What is the square-and-multiply method used to compute?
Model answer
It computes abmodN in polynomial time by processing the binary representation of the exponent.
Explanation
The method replaces a linear number of multiplications in the numerical exponent with a number of steps proportional to its bit length.
- 24
Why is the method called square and multiply?
Model answer
At every iteration, the current power is squared to obtain the next power of a, and it is optionally multiplied into an accumulator when the relevant exponent bit is 1.
Explanation
Squaring is compulsory, whereas multiplication into the accumulator depends on the binary exponent bit.
- 25
How does the binary representation of an exponent determine which powers of a are used?
Model answer
A binary bit of 1 indicates that the corresponding power of a is included in the product, while a bit of 0 indicates that it is skipped.
Explanation
For example, 53 has binary representation 110101, corresponding to powers 1, 4, 16, and 32.
- 26
Express a53 as a product of powers of a using the binary representation of 53.
Model answer
Because 53=32+16+4+1, a53=a32a16a4a.
Explanation
The powers included correspond exactly to the positions containing 1 in the binary representation 110101.
- 27
In what order does the described square-and-multiply algorithm process the exponent bits?
Model answer
It processes the bits from least significant bit to most significant bit.
Explanation
The least significant bit is obtained first by testing whether the current exponent is odd.
- 28
How are successive powers of a generated in square-and-multiply?
Model answer
Starting with a1, each next power is obtained by squaring the current power modulo N: a,a2,a4,a8,….
Explanation
Each squaring doubles the exponent of the current power while keeping values reduced modulo N.
- 29
What is the role of the accumulator in square-and-multiply?
Model answer
The accumulator stores the product of the powers of a corresponding to the exponent bits processed so far.
Explanation
When the current exponent bit is 1, the current power is multiplied into the accumulator modulo N.
- 30
How many modular multiplications are required in the worst case by square-and-multiply for an n-bit exponent?
Model answer
At most 2n modular multiplications are required: up to n compulsory squarings and up to n conditional accumulator multiplications.
Explanation
The worst case occurs when every bit of the exponent is 1.
- 31
How does square-and-multiply improve on the naive method for an exponent with n bits?
Model answer
The naive method may require exponentially many multiplications in n, whereas square-and-multiply requires only O(n) modular multiplications.
Explanation
This is the central efficiency improvement that makes modular exponentiation practical for large cryptographic inputs.
- 32
What are the inputs and output of the square-and-multiply pseudocode?
Model answer
The inputs are a base a, an exponent x, and a modulus N; the output is axmodN.
Explanation
The algorithm maintains intermediate powers and an accumulator while processing x.
- 33
What do the variables y and z represent in the square-and-multiply algorithm?
Model answer
y is the accumulator holding the partial or final result, and z stores the current power of the base.
Explanation
The algorithm updates y conditionally and updates z by repeated squaring.
- 34
How does the algorithm determine the next bit of the exponent when processing from least significant to most significant bit?
Model answer
It checks whether the current exponent x is odd by testing whether xmod2=1; then it updates x to obtain the next bit.
Explanation
Repeated parity tests and reductions by 2 generate the binary representation from right to left.
- 35
What conditional update is performed when the current exponent bit is 1?
Model answer
The accumulator is updated by multiplying it by the current power of the base, with the multiplication performed modulo N.
Explanation
A bit of 1 means that the corresponding power contributes to the exponent decomposition.
- 36
What compulsory update is performed after each exponent bit is processed?
Model answer
The current power is squared modulo N to obtain the next higher power, and the exponent is updated to expose its next binary bit.
Explanation
The squaring step generates powers whose exponents are successive powers of 2.
- 37
When does the square-and-multiply algorithm terminate?
Model answer
It terminates when the remaining exponent value becomes 0.
Explanation
At that point, all binary bits of the original exponent have been processed and the accumulator contains the result.
- 38
Why is modular reduction performed after each squaring and multiplication in the algorithm?
Model answer
Reducing after each operation keeps intermediate values manageable while preserving the final result modulo N.
Explanation
The modular multiplication rule guarantees that intermediate operands may be reduced before further operations.

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