INTERNAL Assessment Asign1
INTERNAL Assessment Asign1
cryp
togr
aphy
a) Describe how Bob would decrypt a ciphertext, given values for m and n.
b) Decrypt the following ciphertext, which was obtained using the preceding method of
encryption:
Ctxt: MYAMRARUYIQTENCTORAHROYWDSOYEOUARRGDERNOGW
15. Let DES(a,k) represent the encryption of plaintext a with key k using the DES
cryptosystem. Suppose c = DES(a,k) and cc = DES(a',k'), where (') denotes bitwise
complement. Prove that cc = c' (i.e., if we complement the plaintext and the key, then the
ciphertext is also complemented). Note that this can be proved using only the "high-level"
description of DES -- the actual structure of S-boxes and other system components are
irrelevant.
16. Suppose we are told that the plaintext: conversation
yields the ciphertext : HIARRTNUYTUS
where the Hill Cipher is used but the keysize m is not specified. Determine the encryption
matrix.
17. A generalization of the Caesar cipher, known as the affine Caesar cipher, has the following
form:
For each plaintext letter p, substitute the ciphertext letter
C: C = E([a, b], p) = (ap + b) mod 26
a. Are there any limitations on the value of b? Explain why or why not.
b. Determine which values of a are not allowed.
c. Provide a general statement of which values of a are and are not allowed. Justify your
statement.
18. The following ciphertext was generated using a simple substitution algorithm:
Write an algorithm to convert it to plain text.
"hzsrnqc klyy wqc flo mflwf ol zqdn nsoznj wskn lj xzsrbjnf, wzsxz gqv zqhhnf ol ozn
glco zlfnco hnlhrn; nsoznj jnrqosdnc lj fnqj kjsnfbc, wzsxz sc xnjoqsfrv gljn efeceqr.
zn rsdnb qrlfn sf zsc zlecn sf cqdsrrn jlw, wzsoznj flfn hnfnojqonb. q csfyrn blgncosx
cekksxnb ol cnjdn zsg. zn pjnqmkqconb qfb bsfnb qo ozn xrep, qo zlejc
gqozngqosxqrrv ksanb, sf ozn cqgn jllg, qo ozn cqgn oqprn, fndnj oqmsfy zsc gnqrc
wsoz loznj gngpnjc, gexz rncc pjsfysfy q yenco wsoz zsg; qfb wnfo zlgn qo naqxorv
gsbfsyzo, lfrv ol jnosjn qo lfxn ol pnb. zn fndnj ecnb ozn xlcv xzqgpnjc wzsxz ozn
jnkljg hjldsbnc klj soc kqdlejnb gngpnjc. zn hqccnb onf zlejc leo lk ozn ownfov-klej sf
cqdsrrn jlw, nsoznj sf crnnhsfy lj gqmsfy zsc olsrno."
19. This problem explores the use of a one-time pad version of the Vigenère cipher. In this
scheme, the key is a stream of random numbers between 0 and 26.
For example, if the key is 3 19 5 . . . , then the first letter of plaintext is encrypted with a
shift of 3 letters, the second with a shift of 19 letters, the third with a shift of 5 letters,
and so on.
a. Encrypt the plaintext sendmoremoney with the key stream 3 11 5 7 17 21 0 11 14 8 7 13 9
b. Using the ciphertext produced in part (a), find a key so that the ciphertext decrypts to the
plaintext cashnotneeded.
20. Consider a block encryption algorithm that encrypts blocks of length n, and let N = 2n. Say
we have t plaintext–ciphertext pairs Pi, Ci = E(K, Pi), where we assume that the key K
selects one of the N! possible mappings.
Imagine that we wish to find K by exhaustive search. We could generate key K′ and test
whether Ci = E(K′, Pi) for 1 … i … t.
If K′ encrypts each Pi to its proper Ci, then we have evidence that K = K′. However, it may
be the case that the mappings E(K, # ) and E(K′, # ) exactly agree on the t plaintext–cipher
text pairs Pi, Ci and agree on no other pairs.
a. What is the probability that E(K, # ) and E(K′, # ) are in fact distinct mappings?
b. What is the probability that E(K, # ) and E(K′, # ) agree on another t′ plain text cipher text
pairs where 0 … t′ … N- t?