Final Exam CMPE

advertisement
Final Exam CMPE-553 30.12.2004 (120 min, 100% – 35 points)
St. Name, Surname______________________________________ St.Id#_____________
Open books, notes!! Open books, notes!! Open books, notes!! Open books, notes!!
Instructor Alexander Chefranov
Task 1. (10%) AES. Show that Inverse S-box(1,1)=E3 (Table 5.4b), using algorithm
(p.153, Textbook; Slide 1, Lecture Notes).
Apply to (11) inverse transform (p.153, Textbook) – result is (EB)
Find multiplicative inverse of (EB) – it is (E3). Example of similar finding of
multiplicative inverse is given in Solutions to Quiz 29.12.04
Task 2. (10%) Triple and Double DES. Estimate expected number of draws required to
draw one red ball out of a bin containing 2 red balls and 3 blue balls, if balls are not
replaced.
2
Task 3. (10%) Blowfish. Assume K1=0x12345678, K2=0x9abcdef0. Show values of P1,
P2 after termination of Step 2 of generation of P-array and S-boxes (p.180, Textbook;
Slides 5, 6, Lecture Notes).
K1=(0001 0010 0011 0100 0101 0110 0111 1000)
P1= (0010 0100 0011 1111 0110 1010 1000 1000)
P1=P1  K1=
(0011 0110 0000 1011 0011 1100 1111 0000)
K2=(1001 1010 1011 1100 1101 1110 1111 0000)
P2= (1000 0101 1010 0011 0000 1000 1101 0011)
P2=P2  K2=
(0001 1111 0001 1111 1101 0110 0010 0011)
Task 4. (10%) RC5. Assume, that t=3, w=16. Show result of initialization of array S
using algorithm (p. 187, Textbook; Slide 12, Lecture Notes).
S[0]=b7e1
S[1]=s[0]+9e37=b7e1+9e37=5618
S[2]=5618+9e37=f44f
Task 5. (10%) RC4. Assume that w-element state array S is used, w=8 (instead of 256).
Initially, S[w]={7,5,6,4,0,3,1,2}. Show 3 first outputs C of stream cipher encryption
(Figure 6.8) using generator RC4 (p.195, Textbook; Slide 6, Lecture Notes), if
M=0x12345678. Show details of calculations.
I=j=0
I=1;j=5;s= {7,3,6,4,0,5,1,2};t=0;k=7
I=2;j=3;s= {7,3,4,6,0,5,1,2};t=2;k=4
I=3;j=1;s= {7,6,4,3,0,5,1,2};t=1;k=6
M=(0001 0010 0011 ..)
C1=(000)  (111)=(111)
C2=(100)  (010)=(110)
C3=(100)  (110)=(010)
Task 6. (10%) RSA. Assume that p=7, q=7. Generate keys for RSA algorithm. Show
encryption and decryption process for plain value M=5.
N=pq=49
 (n)  ( p  1)( q  1)  36 (actually, it is 42; that’s why, it is required that p<>q)
e=5;d=29: ed mod 36 = 145 mod 36 =1
c= 5 5 mod 49 =(27*5*5) mod 49 = (37*5) mod 49 = 38
38 29 =?
38 2 mod49=23
38 4 mod49=39
388 mod49=2
3816 mod49=4
38 24 mod49=26
38 28 mod49=34
38 29 mod49=18<>5, because of not correct p,q values
Task 7. (10%) Distribution of public keys. What for N2 is used in the message (6)
(Figure 10.3) and why the message is encrypted by KUa?
N2 is used to assure B that he interacts with A (it should be returned back to B from A)
KUa is used to ensure secret transfer of data to A (they may be opened only using KRa)
Task 8. (10%) Distribution of secret keys. Can encryption of message (4) (Figure 10.6)
in the reverse order – EKRa[EKUb[Ks]] - lead to
1. Loss of confidentiality?
2. Not recognized corruption of data?
3. Ability of impersonation?
Why?
1. No, because data can be opened only by KRb (and public key KUa, of course)
2. No, because in the case of data corruption result of decryption will be not
intelligible
3. No, because if somebody else, excepting A, will transmit data (EKUb[Ks]) to B,
encrypted on his private key, B, however, will try to recover data by use of KUa,
and he will not get intelligible result of decryption after application of his private
key
Task 9. (10%) Diffie-Hellman Key Exchange. Let q=13. Give an example of secret key
exchange. Provide all details.
Primitive root is 2.
Xa=2, Ya=4
Xb=3, Yb=8
K= (Ya ) Xb  4 3 mod 13  12 (calculated by B)
K= (Yb) Xa  8 2 mod 13  12 (calculated by A)
Task 10. (10%) Message Authentication. Consider Figure 11.10. Assume b=4, n=2,
IV=3. Transformation f is defined by S-box S1 (Table 3.3): use 2 least significant bits
(LSB) of respective entry. Assume L=2, Y=0xab. Calculate CVL. Provide all details of
your calculations.
CV1=LSB(S1(3,10),2)=3
CV2=LSB(S1(3,11),2)=LSB(14,2)=2
Download