CSC474/574 - Information Systems Security: Homework1 Solutions Sketch

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

CSC474/574 - Information Systems Security:

Homework1 Solutions Sketch


September 20, 2004
1. Consider slide 12 in the handout for topic 2.2. Prove that the decryp-
tion process of a one-round Feistel cipher is the same as the input of the
corresponding encryption process. That is, (L

2
, R

2
) = (L
0
, R
0
).
Ans.
R
0
= L
1
= R
2
= R

0
= L

1
= R

2
L

2
= R

1
= L

F(R

0
, K
1
) = L
2

F(R
2
, K
1
) = R
1

F(R
0
, K
1
) = L
0
2. Random J. Protocol-Designer has been told to design a scheme to
prevent messages from being modied by an intruder. Random J. decides
to append to each message a hash of that message. Why doesnt this solve
the problem?
Ans.
Anybody can generate and append a hash to any message. A malicious
adversary can easily modify the message and append the recomputed hash
value. This modication goes undetected at the receiving end.
3. How many DES keys, on the average, encrypt a particular plaintext
block to a particular ciphertext block?
Ans.
There are 2
56
possible keys and 2
64
possible ciphertext blocks for a particu-
lar plaintext block. So only about 2
5664
= 1/256 of the possible ciphertext
blocks can be obtained with a DES key.
1
4. Alice developed a message authentication code (MAC) based on
DES. Her algorithm works as follows: For a given input message M, rep-
resent M as M = (X1 X2 ... Xm), where Xi is a 64-bit block and
represents concatenation. Compute Delta(M) = X1 X2 ... Xm,
where represents bit-wise XOR. Then the MAC for M is computed as
C
K
(M) = E
K
(Delta(M)), where E is DES encryption algorithm and K is
the secret key. Unfortunately, this scheme is vulnerable. Describe an attack
against it.
Ans.
A possible attack on this scheme could be a word reordering attack. A
reordering attack is possible because it yields the same hash as the orig-
inal message. An intruder can easily create a message M and compute
W = Delta(M) Delta(M

) where Delta(M

W) = Delta(M).
5. Lets assume that someone does triple encryption by using EEE with
CBC on the inside. Suppose an attacker modies bit x of ciphertext block
n. How does this aect the decrypted plaintext? (See Figure 4-16 and re-
lated text for triple EDE DES with CBC on the inside. But note that the
question is about triple EEE DES with CBC on the inside)
Ans.
Triple encryption using EEE with CBC on the inside is three successive CBC
encryptions. A modication to ciphertext block n propagates to plaintext
blocks n through n+3. No other plaintext blocks are aected.
6. How do you decrypt the encryption specied in 5.2.3.2 Mixing In the
plaintext?
Ans.
The decryption process proceeds as follows:
b
n
= MD(K
AB
| c
n1
)
b
n1
= MD(K
AB
| c
n2
)
.
.
b
ni
= MD(K
AB
| c
ni1
)
2
.
.
b
2
= MD(K
AB
| c
1
)
b
1
= MD(K
AB
| IV )
p
n
= c
n

b
n
p
n1
= c
n1

b
n1
.
.
p
1
= c
1

b
1
In short, knowing K
AB
, c
i
and IV, b
i
can be generated. Then it is easy
to compute p
i
= c
i

b
i
7. A and B want to establish a secure communication channel between
them. They do not care about the condentiality of the messages being
transmitted, but they do want to ensure the integrity and authenticity of
the messages. Answer the following questions by drawing diagrams that
show the procedures of sending and receiving messages. Assume A and B
share a common key K.
a) How can they achieve their goal only with secret key cryptography?
Ans.
Sender Recipient : M E
K
(M)
b) How can they achieve their goal only with hash function (e.g., MD5)?
Ans.
Sender Recipient : {M E
K
(H(M))}
c) Can they get non-repudiation? (2 points) If yes, how? If no, why?
Ans.
No, it is not possible to achieve non-repudiation with the help of just a com-
monly shared key because a sender can repudiate a previously authenticated
message by claiming that the shared secret was somehow compromised. It
3
is also possible that the recipient who has a copy of the shared secret key
might have forged the signature.
d) Describe a way A and B can get non-repudiation. Explain your as-
sumption and draw a diagram to show the procedure.
Ans.
Using digital signatures
8. The DSA algorithm requires a random number each time a digital
signature is generated. Demonstrate that the DSA algorithm is vulnerable
if this random number is used twice.
Ans.
If k
1
= k
2
, then r
1
= r
2
and
s
1
= [k
1
(H(M
1
) + xr)] mod q and
s
2
= [k
1
(H(M
2
) + xr)] mod q .
Then k = (s
1
s
2
)
1
[H(M
1
)H(M
2
)] mod q.
So the private key x can be obtained from s
1
or s
2
above.
9. Manually complete the following operations. Explain your reason for
each step.
(a) 1234
16
mod 17
1234
16
mod 17 = 1
since 17 is a prime and gcd(1234, 17) = 1 we can use Fermat theorem.
(b) 54
51
mod 17
Since 17 is a prime and gcd(54, 17) = 1 and (17) = 16
54
51
mod 17 = (54mod17)
(51mod16)
mod 17 = 3
3
mod 17 = 27 mod 17 = 10
(c) 53
97
mod 51
53
97
mod 51 = (53 mod 51)
(97mod(51))
mod 51 = 2
(97mod(17)(3))
mod
51 = 2
(97mod32)
mod 51 = 2
1
mod 51 = 2
(d) gcd (33, 121)
gcd (33, 121) = gcd (121, 33) = gcd (33, 22) = gcd (22, 11) = gcd (11, 0) = 11
4
(e) 2
1
mod 17
2
1
mod 17 = 8 mod 17 = 9
using the extended Euclid algorithm, Y 3 = 1 = gcd(2, 17) and Y 2 = 8 =
2
1
mod 17
(f) log
2,5
(4)
log
2,5
(4) = 2
since:
2
0
mod 5 = 1
2
1
mod 5 = 2
2
2
mod 5 = 4
2
3
mod 5 = 3
2
4
mod 5 = 1
Another method is to solve for x from 2
x
mod 5 4 mod 5 2
2
mod
5 x = 2
10. Consider the polynomial x
p1
= 1 (mod p), where p is a prime
number. It has at most p - 1 roots (because it is a polynomial of degree p -
1). Show exactly the roots of this polynomial using Fermat Theorem.
Ans.
roots of x
p1
= 1 (mod p) = {1, 2, 3,..., p-2, p-1}
According to Fermat theorem, x
p1
= 1 (mod p) for all x such that gcd (x,
p) = 1. and since p is prime, 1 x p 1 are relative primes to p.
11. Assume that p is a prime number and a is a positive integer not
divisible by p. Prove that {a mod p, 2a mod p,..., (p-1)a mod p} = {1, 2,...,
(p-1)}.
Ans.
Assume a mod p, 2a mod p,..., (p-1)a mod p = {1, 2,..., (p-1)}
Then there exists x and y in {1, 2,..., (p-1)} such that x = y and xa ya
(mod p).
i.e., xa = ya + kp and can be rewritten as (x-y)a = kp.
Factoring left side yields p
m
1
1
...p
m
k
k
= kp
Then since a is not divisible by p, p is not on the left side which contradicts
that p is on the right side. So we can prove that {a mod p, 2a mod p, ...,
(p-1)a mod p} = {1, 2, ..., (p-1)}.
5

You might also like