Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Session: 2020-21(Even)
Session:
2020-21 (Even)
Subject:
Information & Cyber Security
Year:
4th year
Semester:
7th semester
Name of Student:
Ms. Sumanti Iyer
Batch:
Batch 1
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Date:
Signature of Teachers
SESSION 2020-2021
CERTIFICATE
This is to certify that this practical record contains the bonafide practical work of Ms.
Sumanti Iyer of 4th year/semester 7th bearing roll no. CS17012 has successfully completed the
practical terms work in the subject Information & Cyber Security during the academic year 2020-
2021.
Head of Department
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
INDEX
S. No
CONTENTS
Page No
1
Practical No.1: To demonstrate classical cipher
1-5
2
Practical No.2: Write a program to implement monoalphabetic
cipher techniques
6-11
3
Practical No.3: Write a program to encrypt and decrypt the message
using Playfair
Cipher Technique
1222
4
Practical No.4: Write a program to implement Rail fence Technique
to encrypt the message
2328
5
Practical No.5: Write a program to implement Data Encryption
Standard (DES)
2935
6
Practical No.6: Write a program to implement Euler function and
find the GCD of two numbers using Euclidean algorithm
3640
7
Practical No.7: Write a program to implement RSA Algorithm to
generate keys for sender and receiver also validate the encrypted
message with plain text
4146
8
Practical No.8: Write a program to implement Diffie Hellman Key
Exchange Algorithm for public key cryptography
4751
9
Practical No.9: Demonstrate and build the Honeypot Network for
network security in java
5256
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Practical No.1
Aim :To demonstrate classical cipher.
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Practical No.1
Aim :To demonstrate classical cipher.
OBJECTIVES:
To implement one of the encryption technique
To use one of the substitution technique
To implement classical cipher
2
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Practical No.1
AIM :To demonstrate classical cipher.
OBJECTIVES:
To implement one of the encryption technique
To use one of the substitution technique
To implement classical cipher
THEORY:
In cryptography, a Caesar cipher, also known as a Caesar’s cipher, the shift cipher, Caesar’s code or
Caesar shift, is one of the simplest and most widely known encryption techniques. It is a type of
substitution cipher in which each letter in the plaintext is replaced by a letter some fixed number of
positions down the alphabet. For example, with a shift of 3, A would be replaced by D, B would
become E, and so on. The method is named after Julius Caesar, who used it to communicate with
his generals.
Example:
The transformation can be represented by aligning two alphabets; the cipher alphabet is the plain
alphabet rotated left or right by some number of positions. For instance, here is a Caesar cipher
using a left rotation of three places (the shift parameter, here 3, is used as the key):
Plain: ABCDEFGHIJKLMNOPQRSTUVWXYZ
Cipher: DEFGHIJKLMNOPQRSTUVWXYZABC
When encrypting, a person looks up each letter of the message in the “plain” line and writes down
the corresponding letter in the “cipher” line. Deciphering is done in reverse.
Plaintext: the quick brown fox jumps over the lazy dog
Ciphertext: WKH TXLFN EURZQ IRA MXPSV RYHU WKH ODCB GRJ
3
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
CODE:
CaesaeCipher.java
classCaesarCipher{
publicstaticStringBufferencrypt(Stringtext,ints){
StringBufferresult=newStringBuffer();
for(inti=0;i<text.length();i++){
if(Character.isUpperCase(text.charAt(i))){
charch=(char)(((int)text.charAt(i)+s-65)%26+65);
result.append(ch);
}
else{
charch=(char)(((int)text.charAt(i)+s-97)%26+97);
result.append(ch);
}
}
returnresult;
}
publicstaticvoidmain(String[]args) {
Stringtext=”SBJAIN”;
ints=3;
System.out.println(“Text:”+text);
System.out.println(“Shift:”+s);
System.out.println(“Cipher:”+encrypt(text,s));
}
4
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
}
OUTPUT:
CONCLUSION:
Thus, we have successfully executed a program to demonstrate classical cipher.
5
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Practical No.2
Aim : Write a program to implement monoalphabetic cipher
techniques
6
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Practical No.2
Aim : Write a program to implement monoalphabetic cipher techniques
OBJECTIVES:
To analyze the matching frequency of cipher text with plain text letters.
To encrypt and decrypt the given text using monoalphabetic cipher technique.
7
Information & Cyber Security
Department of Computer Science & Engineering, S.B.J.I.T.M.R., Nagpur
Practical No. 2
AIM : Write a program to implement monoalphabetic cipher techniques
OBJECTIVES:
To analyze the matching frequency of cipher text with plain text letters.
To encrypt and decrypt the given text using monoalphabetic cipher technique.
THEORY :A mono-alphabetic cipher is a type of simple substitution cipher. In this cipher
technique each letter of the plaintext is replaced by another letter in the cipher-text depending upon
frequency of letter as shown below:
The above figure shows you the relative frequencies of Ciphertext in percentage. Now, match the
percentage of letters from the above chart with the percentage of letters to the standard frequency
distribution chart. Below figure is- Standard Frequency Distribution chart for English.
8
Information & Cyber Security
CODE:
CFG.java
importjava.io.*;
classGFG{
publicstaticcharnormalChar[]
={‘a’,’b’,’c’,’d’,’e’,’f’,’g’,’h’,’i’,
‘j’,’k’,’l’,’m’,’n’,’o’,’p’,’q’,’r’,
‘s’,’t’,’u’,’v’,’w’,’x’,’y’,’z’};
publicstaticcharcodedChar[]
={‘Q’,’W’,’E’,’R’,’T’,’Y’,’U’,’I’,’O’,