JSPM’s
JAYAWANTRAO SAWANT POLYTECHNIC,
Handewadi Road, Hadapsar, Pune-28
Department of Computer Engineering
Academic Year 2024-25
ASSIGNMENT-III MODEL ANSWER
Subject: NIS Subject Code: 22620
Course & Code: CO6I Class: TYCO3
Semester: Sixth Name of the Faculty: Mr.G.G.Patil.
CO3: Apply cryptographic algorithms and protocols to maintain Computer Security.
Unit-III: Cryptography
Question
Model Answer Marking
No. scheme
1 Attempt the following questions 8m
02
1 (a) What is simple columnar technique?
Ans:
The Columnar Transposition Cipher is a form of transposition cipher just like Rail
Fence Cipher. Columnar Transposition involves writing the plaintext out in rows,
and then reading the ciphertext off in columns one by one.
Examples:
Encryption
Input : Geeks for Geeks
Key = HACK
Output : e kefGsGsrekoe_
Decryption
Input : e kefGsGsrekoe_
Key = HACK
Output : Geeks for Geeks
Encryption
Input : Geeks on work
Key = HACK
Output : e w_eoo_Gs kknr_
Decryption
Input : e w_eoo_Gs kknr_
Key = HACK
Output : Geeks on work
1 (b) Compare symmetric and asymmetric key cryptography?
Ans:
Symmetric Key Encryption Asymmetric Key Encryption
02
It only requires a single key for both It requires two key one to encrypt
encryption and decryption. and the other one to decrypt.
The size of cipher text is same or smaller than The size of cipher text is same or
the original plain text. larger than the original plain text.
The encryption process is very fast. The encryption process is slow.
It is used when a large amount of data is It is used to transfer small amount
required to transfer. of data.
It provides confidentiality,
It only provides confidentiality. authenticity and non-repudiation.
Examples: Diffie-Hellman, ECC,
Examples: 3DES, AES, DES and RC4 El Gamal, DSA and RSA
In symmetric key encryption, resource
utilization is low as compared to asymmetric In asymmetric key encryption,
key encryption. resource utilization is high.
Explain use of S-Box algorithm? 02
Ans:
S-box substitution is a vital process that helps enhance security through nonlinear
substitution in symmetric key encryption. S-Box substitution is used to enhance the
1 (d) security of encryption algorithms by introducing non-linearity in the substitution
process, which helps bring about concepts such as confusion and diffusion making it
harder for attackers to decode the encrypted data is a new global for substitutions of
a nonlinear kind to do so. This article explains the concept of S-Box substitution, its
importance in cryptography, as well as how it is used in algorithms such as AES.
Q 2. Attempt the following questions 12m
2 (a) 04
Convert the given plain text, encrypt it with the help of Caesar’s cipher
technique. “Network and Information Security”.
Ans:
Network and Information Security”.
Plain A B C D E F G H I J K L M
Text
Ciph D E F G H I J K L M N O P
er
Text
Plain N O P Q R S T U V W X Y Z
Text
Ciph Q R S T U V W X Y Z A B C
er
Text
PLAIN TEXT: NETWORK AND INFORMATION SECURITY
Cipher TEXT: QHWZRUNDQGLQIRUPDWLRQVHFXULWB
2(b) Explain steganography technique with an example ? 04
Ans:
The word Steganography is derived from two Greek words- ‘stegos’ meaning ‘to
cover’ and ‘grayfia’, meaning ‘writing’, thus translating to ‘covered writing’, or
‘hidden writing’. Steganography is a method of hiding secret data, by embedding it
into an audio, video, image, or text file. It is one of the methods employed to protect
secret or sensitive data from malicious attacks.
You can use steganography to hide text, video, images, or even audio data. It’s a
helpful bit of knowledge, limited only by the type of medium and the author’s
imagination.
Different Types of Steganography
1. Text Steganography − There is steganography in text files, which entails secretly
storing information. In this method, the hidden data is encoded into the letter of each
word.
2. Image Steganography − The second type of steganography is image
steganography, which entails concealing data by using an image of a different object
as a cover. Pixel intensities are the key to data concealment in image steganography.
Since the computer description of an image contains multiple bits, images are
frequently used as a cover source in digital steganography.
The various terms used to describe image steganography include:
● Cover-Image - Unique picture that can conceal data.
● Message - Real data that you can mask within pictures. The message may be in
the form of standard text or an image.
● Stego-Image − A stego image is an image with a hidden message.
● Stego-Key - Messages can be embedded in cover images and stego-images with
the help of a key, or the messages can be derived from the photos themselves.
3. Audio Steganography − It is the science of hiding data in sound. Used digitally, it
protects against unauthorized reproduction. Watermarking is a technique that
encrypts one piece of data (the message) within another (the "carrier"). Its typical
uses involve media playback, primarily audio clips.
4. Video Steganography − Video steganography is a method of secretly embedding
data or other files within a video file on a computer. Video (a collection of still
images) can function as the "carrier" in this scheme. Discrete cosine transform
(DCT) is commonly used to insert values that can be used to hide the data in each
image in the video, which is undetectable to the naked eye. Video steganography
typically employs the following file formats: H.264, MP4, MPEG, and AVI.
5. Network or Protocol Steganography − It involves concealing data by using a
network protocol like TCP, UDP, ICMP, IP, etc., as a cover object. Steganography
can be used in the case of covert channels, which occur in the OSI layer network
model.
Steganography Examples Include
● Writing with invisible ink
● Embedding text in a picture (like an artist hiding their initials in a painting
they’ve done)
● Backward masking a message in an audio file (remember those stories of evil
messages recorded backward on rock and roll records?)
● Concealing information in either metadata or within a file header
● Hiding an image in a video, viewable only if the video is played at a particular
frame rate
● Embedding a secret message in either the green, blue, or red channels of an RRB
image.
2 (c) What are the techniques for transforming plain text to cipher text? Explain 04
any one in detail?
Ans:
There are two primary ways in which a plain text can be modified to obtain cipher
text: Substitution Technique and Transposition Technique.
1. Substitution Technique:
Substitution technique involves the replacement of the letters by other letters and
symbols. In a more straightforward way, the characters of plaintext are replaced, and
other substitute characters, numbers and symbols are used at their place.
Types of Substitution Technique:
● Caesar Cipher –
In this all characters of plain text is replaced by other characters with same
pattern. For example, a replaced with D, B replaced with E.
● Mono Alphabetic Cipher –
Major disadvantage of caesar cipher is that all elements are substituted with
same technique, it make easy for cryptanalyst to crack it. In Mono Alphabetic
Cipher, There is no relation between Substitution of characters. Therefore it
makes harder for cryptanalyst to crack it. For example, a can be replaced with B-
Z, B can be replaced with A, C-Z.
● Homophonic Substitution Cipher –
In this technique, one plain text alphabet can map to more than one cipher text
alphabet. This is the best substitution technique with maximum security. For
example, a can be replaced with D and E.
● Polygram Substitution Cipher –
In this rather than replacing one alphabet, block of alphabet is replaced. For
example,
Polygram substitution
HELLO -------------------> YUQQW
HELL --------------------> TEUI
● Vigenere Cipher –
This technique uses multiple character keys. Each of the keys encrypts one
single character. Each character is replaced by a number (A=0, B=1, …Z=25).
After all keys are used, they are recycled. For encryption, Formula used :
E=(M+K)mod 26
Plaintext: ATTACKATDAWN
Key: LEMONLEMONLE
Ciphertext: LXFOPVEFRNHR
2. Transposition Technique:
In transposition technique, the identity of the characters remains unchanged, but
their positions are changed to create the ciphertext.
Types of Transpositional Techniques:
(i) Rail Fence Technique – It uses a simple algorithm:
1. Write down plain text message as sequence of diagonals.
2. Read the plain text written in step 1 as sequence of rows.
Plain text: come home
c m h m
o e o e
Cipher text : (READ ROW BY ROW) cmhmoeoe
(ii) Simple Columnar Transposition Technique – It uses a simple algorithm:
1. Write the plain text message row by row in predefined columns.
2. Read the message column by column. It can be in any order.
3. Message thus obtained is cipher text message.
Plain text: come niki (suppose we have 4 columns )
C1 C2 C3 C4
c o m e
n i k i
Now we can read in any order of columns. Lets read it by 3 -> 2 -> 4 ->1
Cipher text : mkoieicn
(iii) Vernam Cipher – It uses a simple algorithm:
1. Treat each plain text character as a number in the increasing sequence (A=0,
B=1, …Z=25).
2. Do the same for each character of key.
3. Add each number corresponding to plain text alphabet and key.
4. If the sum produced greater than 26, subtract 26 from it.
5. Translate each number of sum back to alphabet, it gives our ciphertext.
Plain text: HOW ARE YOU
Key : NCBTZQARX
H O W A R E Y O U
7 14 22 0 17 4 24 14 20
+
N C B T Z Q A R X
13 2 1 19 25 16 0 17 23
------------------------------------
20 16 23 19 42 20 24 31 43
Subtract 26 if >26: 20 16 23 19 16 20 24 5 17
Cipher text : U Q X T R U Y F R
Cipher text : UQXTRUYFR
Weakness of each technique,
In the case of Substitution:
1. Because it’s based on the substitution of one letter with another based on a
translation table. Once the translation table is known, the code is broken.
2. Short words, words with repeated patterns, and common initial and final letters
all give clues for guessing the pattern of the encryption.
3. An encryption algorithm must be regular for it to be algorithmic and for
cryptographers to be able to remember it. Unfortunately, the regularity gives
clues to the cryptanalyst to break a substitution.
In the case of Transposition:
Just as there are characteristic letter frequencies, there are also characteristic patterns
of pairs of adjacent letters, called diagrams (groups of 2 letter) and trigrams (groups
of 3 letters). The frequency of appearance of letter groups can be used to match up
plaintext letters that have been separated in a ciphertext.
Subject teacher HOD