FINAL EXAM CMPE-553 27.05.2005 (120 min, 35 points) St. Name, Surname______________________________________ St.Id#_____________ Open books, notes!! Open books, notes!! Open books, notes!! Open books, notes!! Calculators are allowed only for such operations as: +, -, *, /, mod !!! Instructor Alexander Chefranov Task 1. (5 points) Solve equation 5x=77 mod 257 Show all intermediate steps. Use Extended Euclid algorithm. Find 5-1 by Extended Euclid: A=(1,0,257), B=(0,1,5) Q=51 T=A-QB=(1,-51,2) A=(0,1,5) B=(1,-51,2) Q=2 T=A-QB=(-1,103,1) 5-1=103. Actually, 5*103=515=1 mod 257 X=(5-1*77) mod 257 = 7931 mod 257 = 221 Actually, 5*221=1105 =77 mod 57 Task 2. (5 points) Find gcd(287, 427) Show all intermediate steps. Use Euclid algorithm Gcd(287, 427) = gcd(427, 287)=gcd(287, 427 mod 287) = gcd(287, 140)= gcd(140, 7)= gcd(7,0) = 7 Task 3. (5 points) Find multiplicative inverse for b(x)= ( x 7 x 3 1) mod( x 8 x 4 x 3 x 1) in GF(28) Show all intermediate steps A=(1,0, x 8 x 4 x 3 x 1 ), B=(0,1, x 7 x 3 1 ) Q=A3/B3=x T=A-QB=(1,x, x 3 1 ) A=(0,1, x 7 x 3 1 ) B=(1,x, x 3 1 ) Q= x 4 x 1 T=A-QB=( x 4 x 1 , x 5 x 2 x 1 ,x) A=(1,x, x 3 1 ) B=( x 4 x 1 , x 5 x 2 x 1 ,x) Q= x 2 T=A-QB=( x 6 x 3 x 2 1 , x 7 x 4 x 3 x 2 x ,1) Hence, inverse is x 7 x 4 x 3 x 2 x . Actually, ( x 7 x 4 x 3 x 2 x )( x 7 x 3 1 ) = ( x14 x11 x 9 x 8 x 6 x 5 x 4 x 3 x 2 x ) mod ( x 8 x 4 x 3 x 1 )=1 Task 4. (4 points) Explain why Triple DES uses EDE sequence (not EEE, for example)? For back compatibility with DES: taking, for example, K1=K2, in E K1 (D K2 (EK3(P))) we come to DES encryption with the key K3. Task 5. (3 points) Explain why Pw constants used in RC5 for different values of w, have same first digits They are got by w left shift of the fractional part of e, hence, all of them will have same most significant bits. Task 6. (3 points) Explain, what is the benefit of the way of P and S initialization used in Blowfish (what are the reasons for such way of initialization?) Thorough mangling of bits, and counter measure against brute force attack, because for each new key trial, full initialization should be performed Task 7. (5 points) Assume that p=5, q=11. Encrypt and decrypt message M=4 using RSA. Show all intermediate steps N=55, Fi=40 E=3 (say), then by Extended Euclid d=27. Actually, 3*27=81=1 mod 40 Then C=ME= 43=64 mod 55 = 9 And for decryption: CD= 927=9*(92 mod 55)*(98 mod 55)*(916 mod 55)=9*26*36*31= mod 55 = ((234 mod 55)*(1116 mod 55)) mod 55 = (14*16) mod 55= 224 mod 55 =4=M Task 8. (5 points) Apply Diffie-Hellman key exchange algorithm for q=13. Show session key calculated by both parties. Show all intermediate steps Let alfa=2: 21=2, 22=4, 23=8, 24=3, 25=6, 26=12, 27=11, 28=9, 29=5, 210=10, 211=7, 212=1 All numbers 1..12 are obtained, hence, 2 is a primitive root for q=13. Let Xa=2, then Ya=22=4 Let Xb=3, then Yb=23=8 Then key, calculated by A: K=YbXamod q =82mod 13= 12 Key, calculated by B: K= YaXbmod q =43mod 13= 12