IS Lab Manual
IS Lab Manual
RajgadDnyanpeeth’s
SHRI CHHATRAPATI SHIVAJIRAJE COLLEGE OF
ENGINEERING
S. No. 237, Satara-Pune, NH-4, Dhangawadi, Tal: Bhor, Dist: Pune
Lab Manual
Information Security
310254(A)
Prepared by
Prof. P. M. Shinde
RajgadDnyanpeeth’s
SHRI CHHATRAPATI SHIVAJIRAJE COLLEGE OF ENGINEERING
S. No. 237, Satara-Pune, NH-4, Dhangawadi, Tal: Bhor, Dist: Pune -412205 (MS), India.
Website: www.rajgad.edu.in, Email Id: [email protected]
Vision
Mission
Vision
Mission
3. Prepare and nurture the mind set for all civil services, higher studies and
research activity.
3. To prepare committed and motivated graduates with research attitude, lifelong learning,
investigative approach, and multidisciplinary thinking.
4. To prepare the graduates with strong managerial and communication skills to work
effectively as individual as well as in teams.
Program Outcomes
PO2: To analyze the problem by finding its domain and applying domain specific skills
PO3: To understand the design issues of the product/software and develop effective solutions
with appropriate consideration for public health and safety, cultural, societal, and environmental
considerations.
PO6: To contribute towards the society by understanding the impact of Engineering on global
aspect.
PO9: To function effectively as an individual and as member or leader in diverse teams and
interdisciplinary settings.
PO11: To apply the knowledge of Computer Engineering for development of projects, and its
finance and management.
PO12: To keep in touch with current technologies and inculcate the practice of lifelong learning.
COURSE OBJECTIVES
Course
Description
Objective
To learn and apply various search strategies for AI
CEO310254A.1
Course
Description
Outcome
CO310254A.1 Design a system using different informed search / uninformed search or heuristic
approaches
CO310254A.2 Apply basic principles of AI in solutions that require problem solving, inference,
perception, knowledge representation, and learning
CO310254A.3 Design and develop an interactive AI application
C410245D.1 2 - 2 - 3 - - 2 2 2 1 2
C410245D.2 1 - 2 2 3 2 - 2 2 2 1 2
C410245D.3 1 - 2 2 3 2 - 2 2 2 2 2
C410245D.4 1 - 2 - 3 - - 2 2 2 2 2
C410245D.5 1 - 2 - 3 - - 2 2 2 2 2
C410245D.6 1 - 2 - 3 - - 2 2 2 2 2
1 - LOW , 2 - MEDIUM , 3 - HIGH
Information Security
310254(A)
Teaching Scheme: 04 Hours/Week
Assignment 1: Write a Java/C/C++/Python program that contains a string (char pointer) with
a value \Hello World’.The program should AND or and XOR each character in this string
with 127 a display the result.
Assignment 6: Implement the different Hellman Key Exchange mechanism using HTML
and JavaScript. Consider the end user as one of the parties (Alice) and the JavaScript application
as other party (bob).
Assignment 7: Calculate the message digest of a text using the MD5 algorithm in JAVA.
Subject In-charge
Prof. P. M. Shinde
Assignment No. 1
Title: -
Write a Java/C/C++/Python program that contains a string (char pointer) with a value \Hello
World’. The program should AND or and XOR each character in this string with 127 an
display the result.
Objective:-
Theory:-
(a) String
The string is the one-dimensional array of characters. The string is terminated by a null ('\0').
Each and every character in the array allocated one byte of memory, and the last character must
always be 0. The end of string is identified by using character ('\0').
For example:
char ch[17]={'t', 'h', 'i', 's', 'i', 's', 't', 'e', 'c', 'h', 'n', 'e', 'o', 'b', 'o', 'o', 'k', 's', '\0'};
As we know, array index starts from 0, so it will be represented as in the figure given below.
While declaring string, size is not mandatory. So we can write the above code as given below:
char ch[ ]={'t', 'h', 'i', 's', 'i', 's', 't', 'e', 'c', 'h', 'n', 'e', 'o', 'b', 'o', 'o', 'k', 's', '\0'};
For example:
In such case, '\0’ will be appended at the end of the string by the compiler
The binary AND operation needs two inputs and one output. The inputs and result to a binary
AND operation can only be 0 or 1. In binary AND operation if both the input are 1 then output
will be 1 and if both inputs are 0 the output will be 0. For two different inputs, the output will be
0.
In XOR two inputs and one output in binary XOR (exclusive OR) operation. It is similar to
ADD operation which takes two inputs and produces one result i.e., one output. The inputs and
result to a binary XOR operation can only be 0 or 1. The binary XOR operation will always
produce a 1 output if either of its inputs is 1 and will produce a 0 output if both of its inputs are 0
or 1.
Algorithm:-
1. Start
3. Perform AND and XOR operation between the string and 127.
Computer Engineering, RD’s SCSCOE, Pune-412205 11
Information Security Laboratory Practice II TE COMP, Sem-II
5. Stop.
Output:-
Conclusion:-
Thus ,we successfully implemented Java program that contains a string (char pointer) with a
value \Hello World.
Assignment No. 2
Title: - Write a Java/C/C++/Python program to perform encryption and decryption using the
method of Transposition technique.
Objective:-
Theory:-
Transposition Cipher is a cryptographic algorithm. In this algorithm the order of alphabets in the
plaintext is rearranged to form a cipher text.
For Example ,Consider transposition cipher is columnar transposition cipher where each
character in the plain text is written horizontally with specified alphabet width. The cipher is
written vertically, which creates an entirely different cipher text. Consider the plain text hello
world, and let us apply the simple columnar transposition technique as shows below
The plain test characters are placed horizontally and the cipher text is created with vertical
format as: holewdlo lr. Also, the receiver has to use the same table to decrypt the cipher text to
plain text.
Transposition Techniques:-
There are 4 different transposition techniques used encrypt and decrypt the message. For this
program we used columnar transposition technique.
2. Columnar Transposition
Algorithm:-
Step 1: Write all the characters of plain text message row by row in a rectangle of predefined
size.
Note: For reading the message, it needs not to be in the order of columns. It can happen in any
random sequence.
Output:-
Conclusion:-
Thus , we successfully implemented Java program to perform encryption and decryption using the
method of Transposition technique.
Questions:-
Assignment No. 3
Objective:-
Theory:-
DES is an implementation of Feistel Cipher. DES is a symmetric encryption system that uses 64-
bit blocks, 8 bits of which are used for parity checks. The key therefore has a "useful" length of
56 bits, which means that only 56 bits are actually used in the algorithm. The algorithm involves
carrying out combinations, substitutions and permutations between the text to be encrypted and
the key, while making sure the operations can be performed in both directions. The key is
ciphered on 64 bits and made of 16 blocks of 4 bits, generally denoted k1 to k16. Given that
"only" 56 bits are actually used for encrypting, there can be 256 different keys.
Algorithm:-
2. Generate secure key that will be used for encryption and decryption.
3. Get Cipher instance using DES algorithm. One for encrypt mode and another for decrypt
mode.
Computer Engineering, RD’s SCSCOE, Pune-412205 16
Information Security Laboratory Practice II TE COMP, Sem-II
Output:-
Conclusion:-
Questions:-
Assignment No. 4
Objective:-
Theory:-
The most popular and widely used symmetric encryption algorithm is Advanced Encryption
Standard (AES). AES is 6 times faster than the triple DES.
Operation of AES:
AES performs all its computations on bytes rather than bits. Hence, AES treats the 128 bits of a
plaintext block as 16 bytes. These 16 bytes are arranged in four columns and four rows for
processing as a matrix.
The number of rounds in AES is variable and depends on the length of the key. AES uses 10
rounds for 128- bit keys, 12 rounds for 192-bit keys and 14 rounds for 256-bit keys. Each of
these rounds uses a different 128-bit round key, which is calculated from the original AES key.
Algorithm:-
6. Copy the final state array out as the encrypted data(cipher text)
7. Stop
Output:-
Conclusion:-
Questions:-
Assignment No. 5
Objective:-
To understand procedure to generate public and private keys by using RSA algorithm.
Theory:-
1. A client (for example browser) sends its public key to the server and requests some data.
2. The server encrypts the data using the client’s public key and sends the encrypted data.
3. The client receives this data and decrypts it.
Algorithm:-
RSA algorithm uses the following procedure to generate public and private keys:
Output:-
Conclusion:-
Thus ,we successfully implemented Java program to implement RSA algorithm.
Questions:-
1. What is the RSA algorithm?
2. What is the difference between AES and RSA?
3. What are two applications of RSA algorithm?
4. Where is RSA key used?
Assignment No. 6
Title: -Implement the different Hellman Key Exchange mechanism using HTML and
JavaScript. Consider the end user as one of the parties (Alice) and the JavaScript application as
other party (bob).
Objective:-
Theory:-
Algorithm:-
Output:-
Conclusion:-
Thus , we successfully implement the different Hellman Key Exchange mechanism using HTML
and JavaScript
Questions:-
Assignment No. 7
Title: -
Calculate the message digest of a text using the MD5 algorithm in JAVA.
Objective:-
Theory:-
MD5 is a cryptographic hash function algorithm that takes the message as input of any length and changes it
into a fixed-length message of 16 bytes. MD5 algorithm stands for the message-digest algorithm. MD5 was
developed as an improvement of MD4, with advanced security purposes. The output of MD5 (Digest size) is
always 128 bits. MD5 was developed in 1991 by Ronald Rivest.
Algorithm:-
Output:-
Conclusion:-
In This way we have studied how to calculate the message digest of a text using the MD5
algorithm in JAVA.
Questions:-
1. What is the MD5 algorithm?
2. What is use of MD5 algorithm?
3. What are the applications of MD5 algorithm?