1.24. Let N, g, and A be positive integers (note that N need not be prime). Prove that the following algorithm, which is a low-storage variant of the square- and-multiply algorithm described in Section 1.3.2, returns the value gª (mod N). (In Step 4 we use the notation [x] to denote the greatest integer function, i.e., round x down to the nearest integer.) 1. 2. Input. Positive integers N, g, and A. Set a = g and b = 1. Loop while A > 0. 3. If A = 1 (mod 2), set b = b. a (mod N). 4. Set a a² (mod N) and A = = [A/2]. 5. If A > 0, continue with loop at Step 2. 6. Return the number b, which equals gª (mod N).

Elements Of Modern Algebra
8th Edition
ISBN:9781285463230
Author:Gilbert, Linda, Jimmie
Publisher:Gilbert, Linda, Jimmie
Chapter2: The Integers
Section2.7: Introduction To Coding Theory (optional)
Problem 12E: Suppose that the check digit is computed as described in Example . Prove that transposition errors...
icon
Related questions
Question

1.3.2 also attached 

1.24. Let N, g, and A be positive integers (note that N need not be prime).
Prove that the following algorithm, which is a low-storage variant of the square-
and-multiply algorithm described in Section 1.3.2, returns the value gª (mod N).
(In Step 4 we use the notation [x] to denote the greatest integer function, i.e.,
round x down to the nearest integer.)
1.
2.
Input. Positive integers N, g, and A.
Set a g and b = 1.
=
Loop while A > 0.
3. If A 1 (mod 2), set b = b. a (mod N).
a² (mod N) and A = [A/2].
4.
5. If A
0, continue with loop at Step 2.
6. Return the number 6, which equals g (mod N).
Set a
=
Transcribed Image Text:1.24. Let N, g, and A be positive integers (note that N need not be prime). Prove that the following algorithm, which is a low-storage variant of the square- and-multiply algorithm described in Section 1.3.2, returns the value gª (mod N). (In Step 4 we use the notation [x] to denote the greatest integer function, i.e., round x down to the nearest integer.) 1. 2. Input. Positive integers N, g, and A. Set a g and b = 1. = Loop while A > 0. 3. If A 1 (mod 2), set b = b. a (mod N). a² (mod N) and A = [A/2]. 4. 5. If A 0, continue with loop at Step 2. 6. Return the number 6, which equals g (mod N). Set a =
1.3.2 The fast powering algorithm
In some cryptosystems that we will study, for example the RSA and Diffie-
Hellman cryptosystems, Alice and Bob are required to compute large powers
of a number g modulo another number N, where N may have hundreds of
digits. The naive way to compute gª is by repeated multiplication by g. Thus
91 = g (mod N),
92 = 9.91 (mod N), 93 9.92 (mod N),
94 = 9.93 (mod N), 959.94 (mod N),....
It is clear that gA = gª (mod N), but if A is large, this algorithm is completely
impractical. For example, if A≈ 21000, then the naive algorithm would take
longer than the estimated age of the universe! Clearly if it is to be useful, we
need to find a better way to compute gª (mod N).
The idea is to use the binary expansion of the exponent A to convert
the calculation of g4 into a succession of squarings and multiplications. An
example will make the idea clear, after which we give a formal description of
the method.
Transcribed Image Text:1.3.2 The fast powering algorithm In some cryptosystems that we will study, for example the RSA and Diffie- Hellman cryptosystems, Alice and Bob are required to compute large powers of a number g modulo another number N, where N may have hundreds of digits. The naive way to compute gª is by repeated multiplication by g. Thus 91 = g (mod N), 92 = 9.91 (mod N), 93 9.92 (mod N), 94 = 9.93 (mod N), 959.94 (mod N),.... It is clear that gA = gª (mod N), but if A is large, this algorithm is completely impractical. For example, if A≈ 21000, then the naive algorithm would take longer than the estimated age of the universe! Clearly if it is to be useful, we need to find a better way to compute gª (mod N). The idea is to use the binary expansion of the exponent A to convert the calculation of g4 into a succession of squarings and multiplications. An example will make the idea clear, after which we give a formal description of the method.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 3 images

Blurred answer