You are on page 1of 8

Kavinesh Karuppaiah

Roll-No: TCS2223033

INS Assignment 1:

Q.1) Encrypt plaintext “sail” using an affine cipher with an encryption


key (3,7)
Ans)
Plain Text: “sail”
Keys: k1 = 3 [multiplicative]
k2 = 7 [additive]
Since affine cipher is the combination of both additive and
multiplication cipher.
It uses an algorithm,
c = (p * k1+k2)mod26

PlainText Position C CipherText

s 18 C = (18*3+7)mod26=9 j

a 0 C = (0*3+7)mod26=7 h

i 8 C = (8*3+7)mod26=5 f

l 11 C= o
(11*3+7)mod26=14
➔The Encryption of plaintext “sail” is “jhfo”.

Use RSA algorithm, what is the value of ciphertext C, if the plain


text M=12 and prime numbers are p=5, q=7 and exponent d=11?
Ans)
Step 1:
In this step, we have to select prime numbers.
Suppose p is 5 and q is 7
Step 2:
Calculate N
N=p*q
N=5*7
N = 35
Step 3:
Select the public key such that it is not a factor of f (p – 1) and (q –
1).
= (5 – 1) * (7 – 1)
=4*6
= 24
Factor of 24 is 2 * 2 * 6
So here we select encryption key d as 11 because it is not a factor of
both 2 and 6.
Step 4:
Select a private key in such a way that it matches the following
equation.
(D * d) mod (p – 1) * (q – 1) = 1.
(D *11) mod (5 – 1) * (7 – 1) = 1
(D * 11) mod (4) * (6) = 1.
(D * 11) mod 24 = 1
After some mathematical computation, I have selected D as 11
(11 * 11) mod 24 = 1.
121 mod 24 = 1
1=1
Hence the equation is equal.
Step 5:
Calculate ciphertext
let’s take plain text as 12
CT = PT^d mod N
CT = 12^11 mod 35
CT = 743,008,370,688 mod 35
CT = 3
Q.2) Encrypt text using Playfair Cipher.

Plain text “IPL SECRET GAME BEYOND IMAGINATION”


keyword “DEEMEDUNIVERSITY”.
Ans)
Using PlayFair Cipher(USING SECRET KEY):

Plain Text:
I P L S E C R E T G

A M E B E Y O N D I
M A G I N A T I O N

Letter Pairs: ip, ls, ec, re, tg, am, eb, ey, on, di, ma, gi, na, ti, on

Keyword:
D E M U N
I V R S T
Y A B C F
G H K L O
P Q W X Z

Encrypted text:
Y D X C U A V M I O
B E M A D A Z T I Y
E B P Y E F I V Z T
The encrypted cipher text using PlayFair Cipher Algorithm for
“IPL SECRET GAME BEYOND IMAGINATION” is “YDX CUAVMI OBEM
ADAZTI YEBPYEFIVZT”

Q.3) Write a short note on steganography.


Ans)
Steganography is the technique of hiding secret data within an
ordinary, non-secret, file or message in order to avoid detection; the
secret data is then extracted at its destination. The use of
steganography can be combined with encryption as an extra step for
hiding or protecting data.
Invisible ink is an example of steganography that is unrelated to
computers. A person can write a message with clear or "invisible" ink
that can only be seen when another ink or liquid is applied to the
paper. Similarly, in digital steganography, the goal is to hide
information from users except those who are meant to see or hear it.
Since steganography is more of an art than a science, there is no limit
to the way steganography can be used. Below are a few examples:

1) Playing an audio track backwards to reveal a secret message.


2) Playing a video at a faster frame rate (FPS) to reveal a hidden
image.
3) Hiding information within a file header or metadata.
Steganography can also be as simple as embedding a secret message
in plain text.

Q.4) Discuss the structure of ‘DES’


Ans)
 The Data Encryption Standard (DES) is a symmetric-key block
cipher.
 DES is an implementation of a Feistel Cipher. It uses 16 round
Feistel structure. The block size is 64-bit. Though, key length is
64-bit, DES has an effective key length of 56 bits, since 8 of the
64 bits of the key are not used by the encryption algorithm.
 Since DES is based on the Feistel Cipher, all that is required to
specify DES is −
 Round function
 Key schedule
 Any additional processing − Initial and final permutation

Initial and Final Permutation:


The initial and final permutations are straight Permutation boxes (P-
boxes) that are inverses of each other. They have no cryptography
significance in DES. The initial and final permutations are shown as
follows −

Round Function:
 The heart of this cipher is the DES function, f. The DES function
applies a 48-bit key to the rightmost 32 bits to produce a 32-bit
output.
 Expansion Permutation Box − Since right input is 32-bit and
round key is a 48-bit, we first need to expand right input to 48
bits. Permutation logic is graphically depicted in the following
illustration –
 The graphically depicted permutation logic is generally described
as table in DES specification illustrated as shown −
 XOR (Whitener). − After the expansion permutation, DES does
XOR operation on the expanded right section and the round key.
The round key is used only in this operation.
 Substitution Boxes. − The S-boxes carry out the real mixing
(confusion). DES uses 8 S-boxes, each with a 6-bit input and a 4-
bit output. Refer the following illustration −

The S-box rule is illustrated below:


 There are a total of eight S-box tables. The output of all eight s-
boxes is then combined in to 32-bit section.
 Straight Permutation − The 32-bit output of S-boxes is then
subjected to the straight permutation with rule shown in the
following illustration:

Key Generation:
1) The round-key generator creates sixteen 48-bit keys out of a 56-
bit cipher key. The process of key generation is depicted in the
following illustration −
2) The DES satisfies both the desired properties of block cipher.
These two properties make cipher very strong.
3) Avalanche effect − A small change in plaintext results in the very
great change in the ciphertext.
4) Completeness − Each bit of ciphertext depends on many bits of
plaintext.

You might also like