Docsity

Computer and Network Security - Assignment 2 with Solutions | CMSC 414, Assignments of Computer Science

Toggle sidebar
bg1
udaya shankar Page 1 of 2 3/10/2009
CMSC 414: HW 2-S09 Solution and Grading
___________________________________________________________
1. (text 5.1) Would it be reasonable to compute an RSA signature on a long message m
by signing m mod-n (i.e., using (m mod-n)
d
mod-n as the signature).
No. Recall that RSA restricts the message to be signed to be smaller than n.
If m is larger than n, then message m and message (m mod-n) would have the same
signature. So it would be easy to generate different messages that have the same
signature.
___________________________________________________________
2. (text 5.6) Why do MD4, MD5, and SHA-1 require padding of messages that are
already a multiple of 512-bits?
Otherwise it would be easiy to find two messages with the same hash. Let M' be any
message that is not a multiple of 512 bits. Let M be M' padded as in MD4, so M is a
multiple of 512 bits. If no padding is used for M (because it is a multiple of 512 bits) then
MD4(M) would be the same as MD4(M').
___________________________________________________________
3. (text 6.8) Given your RSA signature on m
1
and m
2
, how can one compute your
signature on m
1j
โ‹…m
2k
for any positive integers j and k.
Let s
1
be the signature of m
1
, i.e., s
1
= m
1d
mod-n.
Let s
2
be the signature of m
2
, i.e., s
2
= m
2d
mod-n.
Signature(m
1j
) = s
1j
mod-n [because (m
1j
)
d
mod-n = (m
1d
)
j
mod-n].
Signature(m
1
โ‹…m
2
) = s
1
โ‹…s
2
mod-n [because (m
1
โ‹…m
2
)
d
mod-n = (m
1d
)โ‹…(m
2d
) mod-n].
Signature(m
1j
โ‹…m
2k
) = s
1j
โ‹…s
2k
mod-n [from above].
___________________________________________________________
pf2

Partial preview of the text

Download Computer and Network Security - Assignment 2 with Solutions | CMSC 414 and more Assignments Computer Science in PDF only on Docsity!

udaya shankar Page 1 of 2 3/10/

CMSC 414: HW 2-S09 Solution and Grading

___________________________________________________________

  1. (text 5.1) Would it be reasonable to compute an RSA signature on a long message m by signing m mod-n (i.e., using (m mod-n)d^ mod-n as the signature).

No. Recall that RSA restricts the message to be signed to be smaller than n.

If m is larger than n, then message m and message (m mod-n) would have the same signature. So it would be easy to generate different messages that have the same signature.


  1. (text 5.6) Why do MD4, MD5, and SHA-1 require padding of messages that are already a multiple of 512-bits?

Otherwise it would be easiy to find two messages with the same hash. Let M' be any message that is not a multiple of 512 bits. Let M be M' padded as in MD4, so M is a multiple of 512 bits. If no padding is used for M (because it is a multiple of 512 bits) then MD4(M) would be the same as MD4(M').


  1. (text 6.8) Given your RSA signature on m 1 and m 2 , how can one compute your signature on m 1 jโ‹…m 2 k^ for any positive integers j and k.

Let s 1 be the signature of m 1 , i.e., s 1 = m 1 d^ mod-n. Let s 2 be the signature of m 2 , i.e., s 2 = m 2 d^ mod-n. Signature(m 1 j) = s 1 j^ mod-n [because (m 1 j)d^ mod-n = (m 1 d)j^ mod-n]. Signature(m 1 โ‹…m 2 ) = s 1 โ‹…s 2 mod-n [because (m 1 โ‹…m 2 )d^ mod-n = (m 1 d)โ‹…(m 2 d) mod-n]. Signature(m 1 jโ‹…m 2 k) = s 1 jโ‹…s 2 k^ mod-n [from above].


udaya shankar Page 2 of 2 3/10/

___________________________________________________________

  1. Using the efficient algorithm, compute 131^25 mod-15.

25 = (11001) 2 [25 = 16 + 8 + 1] 131 (1)^ mod-15 = 11 131 (10)^ mod-15 = 11โ‹…11 mod-15 = 121 mod-15 = 1 131 (11)^ mod-15 = 1โ‹…11 mod-15 = 11 mod-15 = 11 131 (110)^ mod-15 = 11โ‹…11 mod-15 = 121 mod-15 = 1 131 (1100)^ mod-15 = 1โ‹…1 mod-15 = 1 131 (11000)^ mod-15 = 1โ‹…1 mod-15 = 1 131 (11001)^ mod-15 = 1โ‹…11 mod-15 = 11 So 131^25 mod-15 = 11


  1. Suppose a plaintext file of 5 MB is encrypted with a secret-key algorithm (e.g., DES, AES), and the resulting file is compressed with a lossless compression algorithm (e.g., zip), and the resulting file is 3 MB. What does this imply about the plaintext, about the encryption algorithm, and about the compression algorithm.

It implies that the encryption algorithm is weak. A good algorithm would randomize the plaintext sufficiently so that the compression algorithm would not be able to find structure to exploit.

It does not imply anything about the plaintext or the compression algorithm.


  1. In secret-key encryption, a small key size (e.g., 16 bits instead of 64 bits) weakens the encryption. Does using a small data block size (e.g., 16 bits instead of 64 bits) weaken the encryption?

No. An attacker without the key still has to search through the key space to extract plaintext from ciphertext. Consider an extreme case: let the data block size be 8 bits , let the plaintext consist of blocks m 0 , m 1 , m 2 , โ€ฆ, and the ciphertext consist of blocks c 0 , c 1 , c 2 , โ€ฆ The attacker knows that each cipherblock comes from one of 256 plaintext values. But this does not help deciphering the ciphertext because there would be no correlation between the different ciphertext blocks.