Compute the exponentiation x^e mod 29 of x = 5 with both variants of e from above* for n = 4. Use the square-and-multiply algorithm and show each step of your computation.
*above, referring to the formulas e = 2^n + 1 and e = 2^n -1
Algorithm
result = 1;
while(e>0){
if (e is odd)
result = (result*x) % 29;
e = e/2
x = (x*x) % 29;
}
print(result)
x^e mod 29 where x= 5 n=4;
method 1
e = 2^n+1 = (2^4+1) = 17;
(1)Here e is odd hence result = (1*5)%29 = 5
e = 17/2 = 8
x = (5*5)%29 = 25
(2)Here e is even
e = 8/2 = 4
x = (25*25)%29 = 625%29 = 16
(3)Here e is even
e = 4/2 = 2
x = (16*16)%29 = 256%29 = 24
(4)Here e is even
e = 2/2 = 1
x = (24*24)%29 = 576%29 = 25
(5)Here e is odd hence result = (5*25)%29 = 125%29 = 9
e = 1/2 =0
Result = 9;
method 2
e = 2^n-1 = (2^4-1) = 15;
(1)Here e is odd hence result = (1*5)%29 = 5
e = 15/2 = 7
x = (5*5)%29 = 25
(2)Here e is odd hence result = (5*25)%29 = 125%29 = 9
e = 7/2 = 3
x = (25*25)%29 = 625%29 = 16
(3)Here e is odd hence result = (9*16)%29 = 144%29 = 28
e = 3/2 = 1
x = (16*16)%29 = 256%29 = 24
(4)Here e is odd hence result = (28*24)%29 = 672%29 = 5
e = 1/2 = 0
Result = 5;
Compute the exponentiation x^e mod 29 of x = 5 with both variants of e from...
Computing RSA by hand. Let p = 13, q = 23, e = 17 be your initial parameters. You may use a calculator for this problem, but you should show all intermediate results. Key generation: Compute N and Phi(N). Compute the private key k_p = d = e^-1 mod Phi(N) using the extended Euclidean algorithm. Show all intermediate results. Encryption: Encrypt the message m = 31 by applying the square and multiply algorithm (first, transform the exponent to binary representation)....
An exponentiation cipher encodes a message A using a ciphertext C = Ae (mod p) where p is a prime number and e is an integer exponent. (Here A and C are also integers.) You are given integers A, C, e and p, and you would like to determine whether C is a valid ciphertext for message A. (a) Formulate this problem as a language EC. (b) Explain why the following algorithm for EC does not run in polynomial time:...
1. Apply both the left-to-right and right-to-left binary exponentiation algorithms to compute a^ 25. 7. For each of the following lists, construct both an AVL tree and a 2-3 tree (use ascending and alphabetical order as applicable): ( a) 3 6 5 1 2 4 (b) A B C D E F (c) Z Y X W V W
o-8. (15 points) Bob's simple toy RSA eryptosystem has public key kyub(n, e) (65,5), where n =p,-5x13-65 and e-5. I. Describe the key pair generation procedure for Bob to generate his private key kor- d. With the above given parameters, use EEA to calculate d 2. Describe RSA encryption procedure that Alice uses to encrypt her plaintext message x to its above given parameters, what will be y? ciphertext y before sending the message to Bob. Suppose Alice's message x-...
9. Use the construction in the proof of the Chinese remainder theorem to find a solution to the system of congruences X 1 mod 2 x 2 mod 3 x 3 mod 5 x 4 mod 11 10. Use Fermats little theorem to find 712 mod 13 11. What sequence of pseudorandom numbers is generated using the linear congruential generator Xn+1 (4xn + 1) mod 7 with seed xo 3? 9. Use the construction in the proof of the Chinese...
If a public key has the value (e, n)-(13,77) (a) what is the totient of n, or (n)? (b) Based on the answer from part (a), what is the value of the private key d? (Hint: Remember that d * e-1 mod (n), and that d < ф(n)) You may use an exhaustive search or the Modified Euclidean Algorithm for this. Show all steps performed. For both (c) and (d), use the Modular Power Algorithm, showing all steps along the...
Question 3 Given the input list [72, 29, 18, 4, 5, 64, 37, 2, 13, 10, 23, 51, 95] Show every step of how the Selection Sort algorithm would proceed to sort this list in ascending order. Your solution goes here • You may wish to change the format of this Markdown cells into a Raw cell instead Question 4 Given the input list [72, 29, 18, 4, 5, 64, 37, 2, 13, 10, 23, 51, 95] • Show every...
please answer question #5 and show steps 5. Solving Quadratics (mod p). Use #1 (a) above and the quadratic formula (mod p) to find a pair of solutions (if possible) for each of the following quadratic equations (1), 2r2 +3 -4- (mod 7) (ii), 3r2-2r +1 0 (mod 19) (ii). 3z2 2r -0 (mod 23) 1. Euler's Criterion. (a). Use Euler's Criterion to the Legendre symbols below: (iv). (10/23) (b). Assume a is a quadratic residue mod p, and assume...
Parts a through d are connected and all involve the numbers 29 and 8. a) Find the gcd of 29 and 8 using the Euclidean algorithm. Show each step. b) Find a solution to 29s + 8t = 1. Remember to use the "backsolving" method and your work in Part a. To start you off, here are the first two steps: 1 = 3 - 2 = 3 - (5 - 3) c) Let's call your solutions in Part b...
Discrete Mathematics - RSA Algorithm and Mod These are problems concerning the RSA algorithm and Modulo. A. In RSA, suppose bob chooses p = 3 and q = 43. Determine one correct value of the public exponent e, your choice should be the smallest positive integer that is greater than 1. Justify your answer. B. For the e's value you chose above, compute the corresponding secret exponent d. Show your work. C. Compute 540Mod13 D. Compute 5-1Mod11