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

1. Encrypt the plain text “attack postponed” using Caesar Cipher(C=E(5,p)).

Solution
Plain text(p)=“attack postponed”
C = E(k, p) = (p + k) mod 26
key = 5
C = (p + 5) mod 26

Cipher Text : FYYFHP UTXYUTSJI

2. Use the key CODE" to encrypt the sentence “TO BE OR NOT TO BE" using
Vignere cipher and write the algorithm for the same.
Key : C O D E
Plaintext: T O B E O R N O T T O B E
Solution
Key CODECODECODEC
Plaintext TOBEORNOTTOBE
Ciphertext V C E I Q F Q S V H R F G
3. Evaluate using Diffie-Hellman key exchange technique. Users A and B use a
common prime q=11 and a primitive root alpha=7.
a. If user A has private key XA=3.What is A’s public key YA?
b. If user B has private key XB=6. What is B’s public key YB?
c. What is the shared secret key? Also write the algorithm.
Solution
a)YA=73mod11
YA=2
b)YB=76mod11
YB=4
c)K=43mod11
K=9
K=26mod11
K=9
4. Apply the mathematical foundations of RSA algorithm. Perform encryption
and decryption for the following data. Assume P=17, q=7, e=5 message=”ME”.
Solution
P=17 q=7 e=5 message=ME
n=pq
n=17*7=119
Ø(n)=(p-1)(q-1)
Ø(n)=16*6=96
d=24
C=ME5mod119
M=cdmod119
5. Alice signs a message M =14 to Bob by computing h(M). Alice chooses XA=16
as private key. Using ElGamal scheme, verify the signature by computing S1, S2,
V1, V2. Assume the parameter values as k=5, p=19, d=10.
Solution
• use field GF(19) q=19 and a=10
• Alice computes her key:
– A chooses xA=16 & computes yA=1016 mod 19 = 4
• Alice signs message with hash m=14 as (3,4):
– choosing random K=5 which has gcd(18,5)=1 choosing random K5
which has gcd(18,5) 1
– computing S1 = 105 mod 19 = 3
– finding K-1 mod (q-1) = 5-1 mod 18 = 11
– computing S2 = 11(14-16.3) mod 18 = 4
• any user B can verify the signature by computing
– V1 = 1014 mod 19 = 16 – V2 = 43.34 = 5184 = 16 mod 19
– since 16 = 16 signature is valid 
6. Encrypt the message “MEET ME” using Hill Cipher with the following key
matrix and shoe the decryption to formulate original plain text

Solution
C = EK (P) = KP mod 26
P = DK (C ) = K-1 C mod 26 = K-1 KP = P
K is the key matrix and K-1 is the matrix inverse. The inverse matrix can be calculated as K.K -1 = I
where I is the identity matrix. 

Encryption example Plaintext:MEET ME


CIPHERTEXT:GSEBXE

You might also like