Você está na página 1de 10

Assignment 1 CSE-403 Submitted to: Ms.

Upasana

Submitted by: Gulfam ali REG.NO.: 18011953 SECTION-ke063

Qn.-1 Encryption of message using hill cipher Message -"meet me at the usual place at ten rather than eight oclock" Digit representation[12,4,4,19,12,4,0,19,19,7,4,20,18,20,0,11,25,11,0,2,4,0,19,19,4,13,17,0,19,7,4,17,19,7,0, 13,4,8,6,7,19,14,2,11,14,2,10]

Key9 5 4 7

Hill cipher encryption is C=PKmod26 Encrypting the 2 letters at a time C1,C2= 9 12 4 * 5 4 7 mod 26

=(138 76)mod 26 = (8 24) =(i y) By using the method the encrypted message will become Encrypted message[8,24,1,19,8,24,17,3,24,21,6,0,2,4,3,25,20,21,10,14,10,16,6,1,23,3,23,16,24,21,17,5,24,2 1,13,13,24,20,11,21,7,18,21,7,6,18,20,20] Encrypted letters- iybt iy rd yvg acecz uvkok qg bxd xqyvrf yvnn yulvh svhgsuu (b) inverse of matrix k Det(k)=43 Adj(k)= 7 -5 -4 9

So Inverse(k)= 1/43 7 -5 -4 9

Decryption of the cipher text P=D(Inverse(k)mod26) So the resulting plaintext will be "meet me at the usual place at ten rather than eight oclock" Qn.-2

The substitution for this plaintext is such that

5=s,3=p,=e,=d,0=a,)=t,6=f,*=k,;=l,4=h,8=g, 2=c,.=m,=n,]=p,:=q,(=j,9=I,?=o,=r,1=u
So the encrypted message will be

Speedpasttfklhgcfthemthetlgafklhgdgdgdgnfattg sllpgklqekgdgpjggtskdlhfjlggkifkolgtkejlhgstlsk dcqkejlhisfkcjskehtgngklhaficgstltfdgtheeleilujei lhgagulgqgeulhgdgslhthgsdscggafkujeilhgljgglhj eophlhgthelufulquggleol


Qn.-3 (a) Cryptanalysis- cryptanalysis attacks rely on the nature of the algorithm plus perhaps some knowledge of plaintext or cipher text. This type of attack exploits the characteristics of the algorithm to attempt to deduce a specific plain text or to deduce the key. DIFFERENTIAL CRYPTANALYSIS ATTACK -The differential cryptanalysis attack is complex; provides a complete description. The rationale behind differential cryptanalysis is to observe the behaviour of pairs of text blocks evolving along each round of the cipher, instead of observing the evolution of a single text block. Consider the original plaintext block m to consist of two halves m0,m1 .Each round of DES maps the right-hand input into the left-hand output and sets the right-hand output to be a function of the

left-hand input and the sub key for this round. So, at each round, only one new 32-bit block is created. If we label each new block mi(2<=i<=17), then the intermediate message halves are related as follows: mi+1 = mi-1 { f(mi, Ki), i = 1, 2, , 16 In differential cryptanalysis, we start with two messages, and, with a known XOR difference delta m = m XOR m and consider the difference between the intermediate message halves: Delta m=mi-1 XORmi-1 =[mi-1 XOR f(mi,ki)] XOR [mi-1 XOR f(mI,ki)] Delta mi-1 XOR [(f(mi,ki) XOR f(mI,ki)] Linear Cryptanalysis This attack is based on finding linear approximations to describe the transformations performed in DES.This method can find a DES key given 2^43 known plaintexts, as compared to 2^47 chosen plaintexts for differential cryptanalysis. Although this is a minor improvement, because it may be easier to acquire known plaintext rather than chosen plaintext, it still leaves linear cryptanalysis infeasible as an attack on DES. So far, little work has been done by other groups to validate the linear cryptanalytic approach. e.g For a cipher with -bit plaintext and ciphertext blocks and an -bit key, let the plaintext block be labelled P[1], P[n], the cipher text block C[1], C[n], and the key K[1], , K[m]. Then A[I,j,..,k]=A[i] XOR A[j] XOR..XOR A[k]. The objective of linear cryptanalysis is to find an effective linear equation of the form: P(a1,a2,a3..aa) XOR C[b1,b2,b3bb]=K[c1,c2,c3.cc]. Qn.-3 (b) Given key sizes (32, 56, 128, 168 bit keys): Number of alternative keys for 32 bit (i) Alternatives key 2^32=4294967296 (ii) Time required at 1 decryption/s Suppose 2^56 take 1sec to decrypt then time taken=(1/2^56)*2^32=1/2^22sec =(2.38*10^-7)10^-6 s Number of alternative keys for 56 bit (i) Alternatives key 2^56=72057594037927936 (ii) Time required at 1 decryption/s Suppose 2^56 take 1sec to decrypt then time taken=(1/2^56)*2^56=1sec =1*10^-6 s Number of alternative keys for 128 bit

(i) Alternatives key 2^128 (ii) Time required at 1 decryption/s Suppose 2^56 take 1sec to decrypt then time taken=(1/2^56)*2^128 =2^56sec =2^56*10^-6 s Number of alternative keys for 32 bit (i) Alternatives key 2^168 (ii) Time required at 1 decryption/s Suppose 2^56 take 1sec to decrypt then time taken=(1/2^56)*2^168 =2^122sec =2^122*10^-6 s

Qn.-4 Plain text= 0123456789ABCDEF Key = 0123456789ABCDEF

(a). taking the binary representation of key 00000001 00100011 10001001 10101011 Applying the PC-1 01000101 11001101 01100111 11101111

The key will be now 1111000 0110011 1010101 0110011

0010101 0011110

0100000 0000000

Now taking the C0 and D0 of 28 bit each C0 1111000 0110011 0010101 0100000 D0 1010101 0110011 0011110 0000000 Applying the one left shift to get C1 and D1 C1 1110000 1100110 0101010 1000001 D1 0101010 1100110 0111100 0000001

Now applying the PC-2 on C1 and D1

Now the key for Round k1 00001011 00000010 01100111

10011011

01001001

10100101

(b).Taking the bit representation of plain text


00000001 10001001 00100011 10101011 01000101 11001101 01100111 11101111

Applying the initial permutation on input plaintext

Now the plaintext becomes IP. And the IP is 11001100 00000000 11001100 11110000 10101010 11110000

11111111 10101010

Splitting the IP L0 11001100 00000000 11001100 11111111 (32 bit) R0 11110000 10101010 11110000 10101010 (32 bit) (c). Applying the expansion on R0

Now the R0 become E (R0) of 48 bit 01111010 00010101 01010101 01111010 (d). Calculating E(R0 0111101 ) 0 K1 0000101 1 A 0111000 1 the A= E(R0) XOR K1 0001010 010101 011110 1 01 10 0000001 011001 100110 0 11 11 0001011 001100 111000 1 10 01

00010101

01010101

000101 01 010010 01 010111 00

0101010 1 1010010 1 1111000 0

(e). S-box substitution Combining the above result in 6 bit form for S-box substitution 01110 01000 01110 11001 11100 01010 11001 11000 0 1 0 0 0 1 1 0 Calculating the S-box value

S-box 011000 010001 011100 110010 111000 010101 110011

Row and Column Row 0 Column 13 Row 1 Column 8 Row 0 Column 13 Row 2 Column 9 Row 2 Column 12 Row 1 Column 10 Row 3 Column 9

Value 9 12 4 1 6 13 5

Binary representation 1001 1100 0100 0001 0110 1101 0101

110000

Row 2 Column 8

0000

(f). Values after S-box substitution S-box 1001 1100 0100 0001 0110 1101 0101 0000

(g). Applying the permutation to get P(S-box) S-box 1001 1100 0100 0001 0110 1101 0101 0000

P(S-box) 1001 0010 1001 1101 0010 0000 1001 1110 (h). Calculating the P(S-box) 1001 0010 L0 1100 1100 R1 0101 1110 R1=P(S-box) XOR L0 1001 1101 0010 0000 1001 1110 0000 0000 1100 1100 1111 1111 1001 1101 1110 1100 0110 0001

Now the R1 is 0101 1110 1001 1101 1110 1100 0110 0001 And L1 is 1111 0000 1010 1010 1111 0000 1010 1010 (i). Calculating the cipher text by combining L1 and R1 FOAAFOAA5E9DEC61

Você também pode gostar