Professional Documents
Culture Documents
74 Is
74 Is
Information Security
(3170720)
B.E. Semester 7
(Computer Engineering)
Directorate of Technical
Education,Gandhinagar,Gujarat
Government Engineering College, Modasa
CERTIFICATE
This is to certify that Mr. Goswami Rahul Dineshgiri Enrollment No. 200160107074 of
B.E. Semester 7th Computer Engineering Department of this Institute (GTU Code:
016) has satisfactorily completed the Practical / Tutorial work for the subject Information
Security (3170720) for the academic year 2023-24.
Date:
Main motto of any laboratory/practical/field work is for enhancing required skills as well as
creating ability amongst students to solve real time problem by developing relevant
competencies in psychomotor domain.By keeping in view, GTU has designed competency
focused outcome-based curriculum for engineering degree programs where sufficient weightage
is given to practical work. It shows importance of enhancement of skills amongst the students
and it pays attention to utilize every second of time allotted for practical amongst students,
instructors and faculty members to achieve relevant outcomes by performing the experiments
rather than having merely study type experiments. It is must for effective implementation of
competency focused outcome-basedcurriculum that every practical is keenly designed to serve as
a tool to develop and enhance relevant competency required by the various industry among every
student. These psychomotor skills are very difficult to develop through traditional chalk and
board content delivery method in the classroom. Accordingly, this lab manual is designed to
focus on the industry defined relevant outcomes, rather than old practice of conducting practical
to prove concept and theory.
By using this lab manual students can go through the relevant theory and procedure in advance
before the actual performance which creates an interest and students can have basic idea prior to
performance. This in turn enhances pre-determined outcomes amongst students. Each
experiment in this manual begins with competency, industry relevant skills, course outcomes as
well as practical outcomes (objectives). The students will also achieve safety and necessary
precautions to be taken while performing practical.
This manual also provides guidelines to faculty members to facilitate student centric lab
activities through each experiment by arranging and managing necessary resources in order that
the students follow the procedures with required safety and necessary precautions to achieve the
outcomes. It also gives an idea that how students will be assessed by providing rubrics.
Information security is the subject that helps students to understand various aspects of data
security. It provides a way to know various kinds of breaches that happen with data and how to
eliminate them using various techniques. The student is also able to learn various methodologies
which used by current used by developers to achieve the security of information.
Practical – Course Outcome matrix
The following industry relevant competency are expected to be developed in the student by
undertaking the practical work of this laboratory.
1. Able to think about information security scenario and make solution
2. Able to develop and algorithms which helps to secure data
Index
(Progressive Assessment Sheet)
Sr. Objective(s) of Experiment Page Date of Date of Assessme Sign. of Remar
No. No. perform submiss nt Teacher ks
ance ion Marks with date
Implement Caesar cipher encryption- 8
1
decryption.
Implement Playfair cipher encryption- 11
2
decryption.
Implement Hill cipher encryption- 16
3
decryption
Implement Vigenere Cipher encryption- 19
4
decryption
Implement Rail Fence Transposition cipher 23
5
technique.
To implement Simple DES encryption- 27
6
decryption.
To implement Simple AES encryption- 33
7
decryption.
Implement RSA encryption-decryption 42
8
algorithm.
Implement Diffi-Hellman Key exchange 46
9
Method
49
10 Write a program to generate MD-5 hash.
55
11 Write a program to generate SHA-1 hash
63
12 Implement a digital signature algorithm.
67
13 Demonstrate how to work with JCrypTool
71
14 Demonstrate how to work with Wireshark
Total
OBJECTIVES:
The student should be made to:
OUTCOMES:
At the end of the course, the student should be able to:
SOFTWARE REQUIREMENTS
HARDWARE REQUIREMENTS
➢ Standalone desktops
Information Security(3170720)
Experiment No: 1
Implementation of caesar cipher
Date:
Relevant CO: Explore the basic principles of the symmetric cryptography and techniques with their
strengths and weaknesses from perspective of cryptanalysis
Example:
Algorithm:
1
Information Security(3170720)
Program:
#include <stdio.h>
#include <string.h>
int main(void) {
char plain_text[] = "somestring";
printf("plaintext : %s\n", plain_text);
encrypt_text(plain_text, 1);
printf("encrypted : %s\n", plain_text);
decrypt_text(plain_text, 1);
printf("decrypted : %s\n", plain_text);
return 0;
}
Output:
Conclusion:
The Caesar cipher, named after Julius Caesar, is a basic substitution cipher. It involves shifting each
letter in the plaintext by a fixed number of positions in the alphabet. For instance, with a shift of 3,
'A' becomes 'D', 'B' becomes 'E', and so on. While simple to implement, its security is weak due to
the limited key space of 25 possible shifts, making it susceptible to brute-force attacks. Despite its
vulnerabilities, the Caesar cipher holds historical significance in the field of cryptography and serves
as a fundamental concept in more advanced encryption methods.
Quiz:
2
Information Security(3170720)
Suggested Reference:
1. https://www.geeksforgeeks.org/caesar-cipher-in-cryptography/
Rubrics 1 2 3 4 5 Total
Marks
3
Information Security(3170720)
Experiment No: 2
Implementation of Playfair cipher
Date:
Relevant CO: Explore the basic principles of the symmetric cryptography and techniques with their
strengths and weaknesses from perspective of cryptanalysis
1. If both letters are the same (or only one letter is left), add an "X" after the first letter
2. If the letters appear on the same row of your table, replace them with the letters to
their immediate right respectively
3. If the letters appear on the same column of your table, replace them with the letters
immediately below respectively
If the letters are not on the same row or column, replace them with the letters on the same row
respectively but at the other pair of corners of the rectangle defined by the original pair.
Example:
4
Information Security(3170720)
Algorithm:
Program:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define SIZE 30
5
Information Security(3170720)
plain[count++] = plain[i];
plain[count] = '\0';
return count;
}
// a 26 character hashmap
// to store count of the alphabet
dicty = (int *)calloc(26, sizeof(int));
for (i = 0; i < ks; i++) {
if (key[i] != 'j')
dicty[key[i] - 97] = 2;
}
dicty['j' - 97] = 1;
i = 0;
j = 0;
if (a == 'j')
a = 'i';
else if (b == 'j')
b = 'i';
6
Information Security(3170720)
if (keyT[i][j] == a) {
arr[0] = i;
arr[1] = j;
} else if (keyT[i][j] == b) {
arr[2] = i;
arr[3] = j;
}
}
}
}
if (a[0] == a[2]) {
str[i] = keyT[a[0]][mod5(a[1] + 1)];
str[i + 1] = keyT[a[0]][mod5(a[3] + 1)];
} else if (a[1] == a[3]) {
str[i] = keyT[mod5(a[0] + 1)][a[1]];
str[i + 1] = keyT[mod5(a[2] + 1)][a[1]];
} else {
str[i] = keyT[a[0]][a[3]];
str[i + 1] = keyT[a[2]][a[1]];
}
}
}
// Key
ks = strlen(key);
ks = removeSpaces(key, ks);
toLowerCase(key, ks);
// Plaintext
ps = strlen(str);
toLowerCase(str, ps);
ps = removeSpaces(str, ps);
7
Information Security(3170720)
ps = prepare(str, ps);
// Driver code
int main() {
char str[SIZE], key[SIZE];
// Key to be encrypted
strcpy(key, "securekey");
printf("Key text: %s\n", key);
// Plaintext to be encrypted
strcpy(str, "givemoney");
printf("Plain text: %s\n", str);
return 0;
}
Output:
Conclusion:
The Playfair cipher, devised in the 19th century, is a grid-based encryption technique that operates
on pairs of letters. Its strength lies in the complexity of the key, determined by a chosen keyword that
shapes the 5x5 grid. This provides higher security compared to simpler ciphers like the Caesar
cipher. However, it is not invulnerable, as it can still be susceptible to frequency analysis and
requires special handling for double letters. While an advancement in its time, the Playfair cipher is
considered relatively weak by today's cryptographic standards.
Quiz:
Suggested Reference:
1. https://www.geeksforgeeks.org/playfair-cipher-with-examples/
8
Information Security(3170720)
Rubrics 1 2 3 4 5 Total
Marks
9
Information Security(3170720)
Experiment No: 3
Implementation of Hill cipher
Date:
Relevant CO: Explore the basic principles of the symmetric cryptography and techniques with their
strengths and weaknesses from perspective of cryptanalysis
Algorithm:
STEP-1: Read the plain text and key from the user.
STEP-2: Split the plain text into groups of length three.
STEP-3: Arrange the keyword in a 3*3 matrix.
STEP-4: Multiply the two matrices to obtain the cipher text of length three.
STEP-5: Combine all these groups to get the complete cipher text.
Program:
int messageVector[3][1];
int cipherMatrix[3][1];
string CipherText;
HillCipher(message, key);
return 0;
}
11
Information Security(3170720)
Output:
Conclusion:
The Hill cipher, invented by Lester S. Hill in 1929, revolutionized classical cryptography with its
matrix-based approach. It operates on blocks of letters, making it more secure than traditional
substitution ciphers. The strength of the Hill cipher depends on the size and properties of the
encryption matrix, which serves as the key. However, it is not impervious to certain attacks,
particularly if the matrix is poorly chosen or if the length of the key is not carefully managed.
Despite this, the Hill cipher remains a crucial milestone in the history of encryption, showcasing the
potential of mathematical techniques in securing communication.
Quiz:
Suggested Reference:
1. https://crypto.interactive-maths.com/hill-cipher.html
Rubrics 1 2 3 4 5 Total
Marks
12
Information Security(3170720)
Experiment No: 4
Implementation of Vigenere cipher
Date:
Relevant CO: Explore the basic principles of the symmetric cryptography and techniques with their
strengths and weaknesses from perspective of cryptanalysis
Example:
13
Information Security(3170720)
Algorithm:
Program:
#include <iostream>
#include <string>
class Vigenere{
public:
string key;
Vigenere(string key){
for (int i = 0; i < key.size(); ++i){
if (key[i] >= 'A' && key[i] <= 'Z')
this->key += key[i];
else if (key[i] >= 'a' && key[i] <= 'z')
this->key += key[i] + 'A' - 'a';
}
}
continue;
return out;
}
};
int main(){
Vigenere cipher("VIGENERECIPHER");
string original = "Don’t come here";
Output:
Conclusion:
The Vigenère cipher, developed by Blaise de Vigenère in the 16th century, significantly bolstered
classical cryptography by introducing a polyalphabetic substitution method. It uses a keyword to
determine a series of shifts for each letter in the plaintext, making it substantially more secure than
simpler ciphers. The Vigenère cipher offers robust protection against frequency analysis, a
vulnerability in many classical ciphers. Nevertheless, it can be susceptible to key length guessing if
not used correctly. The Vigenère cipher stands as a pivotal advancement in the history of encryption,
showcasing the effectiveness of polyalphabetic techniques in enhancing security for sensitive
communication.
15
Information Security(3170720)
Quiz:
Suggested Reference:
1. https://intellipaat.com/blog/vigenere-cipher/
Rubrics 1 2 3 4 5 Total
Marks
16
Information Security(3170720)
17
Information Security(3170720)
Experiment No: 5
Implementation of Rail Fence Transposition
Date:
Relevant CO: Explore the basic principles of the symmetric cryptography and techniques with their
strengths and weaknesses from perspective of cryptanalysis
Example:
Algorithm:
STEP-5: Read the characters row wise or column wise in the former order to get the
cipher text.
18
Information Security(3170720)
Program:
// C++ program to illustrate Rail Fence Cipher
// Encryption and Decryption
#include <bits/stdc++.h>
using namespace std;
return result;
}
19
Information Security(3170720)
row = 0, col = 0;
for (int i = 0; i < cipher.length(); i++) {
// check the direction of flow
if (row == 0)
dir_down = true;
if (row == key - 1)
dir_down = false;
return 0;
}
Output:
Conclusion:
The Rail Fence cipher, also known as the zigzag cipher, is a basic transposition cipher that arranges
letters in a zigzag pattern before encryption. This technique, while simple to implement, offers
limited security compared to more complex ciphers. It can be susceptible to cryptanalysis,
particularly with longer messages. Consequently, the Rail Fence cipher is considered relatively weak
by modern cryptographic standards. Despite its simplicity, it serves as an essential introduction to the
concept of transposition ciphers and lays the groundwork for more sophisticated encryption methods.
Quiz:
2. Rail fence cipher is more secure than one time pad cipher? True/False
True
Suggested Reference:
1. https://crypto.interactive-maths.com/rail-fence-cipher.html
Rubrics 1 2 3 4 5 Total
Marks
21
Information Security(3170720)
Experiment No: 6
Implementation of Simple DES
Date:
Relevant CO: Implement and analyze various symmetric key cryptography algorithms
and their application in different context
Example:
22
Information Security(3170720)
Algorithm:
STEP-5: Thus the encrypted 64-bit cipher text is obtained in this way. Repeat the same
process for the remaining plain text characters.
Program:
#include <cmath>
#include <iostream>
#include <string>
using namespace std;
string round_keys[16];
string pt;
string convertDecimalToBinary(int decimal) {
string binary;
while (decimal != 0) {
binary = (decimal % 2 == 0 ? "0" : "1") + binary;
decimal = decimal / 2;
}
while (binary.length() < 4) {
binary = "0" + binary;
}
return binary;
}
int convertBinaryToDecimal(string binary) {
int decimal = 0;
23
Information Security(3170720)
int counter = 0;
int size = binary.length();
for (int i = size - 1; i >= 0; i--) {
if (binary[i] == '1') {
decimal += pow(2, counter);
}
counter++;
}
return decimal;
}
string shift_left_once(string key_chunk) {
string shifted = "";
for (int i = 1; i < 28; i++) {
shifted += key_chunk[i];
}
shifted += key_chunk[0];
return shifted;
}
string shift_left_twice(string key_chunk) {
string shifted = "";
for (int i = 0; i < 2; i++) {
for (int j = 1; j < 28; j++) {
shifted += key_chunk[j];
}
shifted += key_chunk[0];
key_chunk = shifted;
shifted = "";
}
return key_chunk;
}
string Xor(string a, string b) {
string result = "";
int size = b.size();
for (int i = 0; i < size; i++) {
if (a[i] != b[i]) {
result += "1";
} else {
result += "0";
}
}
return result;
}
void generate_keys(string key) {
int pc1[56] = {57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18,
10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36,
63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22,
14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4};
int pc2[48] = {14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10,
23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2,
41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48,
44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32};
string perm_key = "";
for (int i = 0; i < 56; i++) {
perm_key += key[pc1[i] - 1];
24
Information Security(3170720)
}
string left = perm_key.substr(0, 28);
string right = perm_key.substr(28, 28);
for (int i = 0; i < 16; i++) {
if (i == 0 || i == 1 || i == 8 || i == 15) {
left = shift_left_once(left);
right = shift_left_once(right);
} else {
left = shift_left_twice(left);
right = shift_left_twice(right);
}
string combined_key = left + right;
string round_key = "";
for (int i = 0; i < 48; i++) {
round_key += combined_key[pc2[i] - 1];
}
round_keys[i] = round_key;
}
}
string DES() {
int initial_permutation[64] = {
58, 50, 42, 34, 26, 18, 10, 2, 60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6, 64, 56, 48, 40, 32, 24, 16, 8,
57, 49, 41, 33, 25, 17, 9, 1, 59, 51, 43, 35, 27, 19, 11, 3,
61, 53, 45, 37, 29, 21, 13, 5, 63, 55, 47, 39, 31, 23, 15, 7};
int expansion_table[48] = {32, 1, 2, 3, 4, 5, 4, 5, 6, 7, 8, 9,
8, 9, 10, 11, 12, 13, 12, 13, 14, 15, 16, 17,
16, 17, 18, 19, 20, 21, 20, 21, 22, 23, 24, 25,
24, 25, 26, 27, 28, 29, 28, 29, 30, 31, 32, 1};
int substition_boxes[8][4][16] = {
{14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12, 5, 9, 0, 7,
0, 15, 7, 4, 14, 2, 13, 1, 10, 6, 12, 11, 9, 5, 3, 8,
4, 1, 14, 8, 13, 6, 2, 11, 15, 12, 9, 7, 3, 10, 5, 0,
15, 12, 8, 2, 4, 9, 1, 7, 5, 11, 3, 14, 10, 0, 6, 13},
{15, 1, 8, 14, 6, 11, 3, 4, 9, 7, 2, 13, 12, 0, 5, 10,
3, 13, 4, 7, 15, 2, 8, 14, 12, 0, 1, 10, 6, 9, 11, 5,
0, 14, 7, 11, 10, 4, 13, 1, 5, 8, 12, 6, 9, 3, 2, 15,
13, 8, 10, 1, 3, 15, 4, 2, 11, 6, 7, 12, 0, 5, 14, 9},
{10, 0, 9, 14, 6, 3, 15, 5, 1, 13, 12, 7, 11, 4, 2, 8,
13, 7, 0, 9, 3, 4, 6, 10, 2, 8, 5, 14, 12, 11, 15, 1,
13, 6, 4, 9, 8, 15, 3, 0, 11, 1, 2, 12, 5, 10, 14, 7,
1, 10, 13, 0, 6, 9, 8, 7, 4, 15, 14, 3, 11, 5, 2, 12},
{7, 13, 14, 3, 0, 6, 9, 10, 1, 2, 8, 5, 11, 12, 4, 15,
13, 8, 11, 5, 6, 15, 0, 3, 4, 7, 2, 12, 1, 10, 14, 9,
10, 6, 9, 0, 12, 11, 7, 13, 15, 1, 3, 14, 5, 2, 8, 4,
3, 15, 0, 6, 10, 1, 13, 8, 9, 4, 5, 11, 12, 7, 2, 14},
{2, 12, 4, 1, 7, 10, 11, 6, 8, 5, 3, 15, 13, 0, 14, 9,
14, 11, 2, 12, 4, 7, 13, 1, 5, 0, 15, 10, 3, 9, 8, 6,
4, 2, 1, 11, 10, 13, 7, 8, 15, 9, 12, 5, 6, 3, 0, 14,
11, 8, 12, 7, 1, 14, 2, 13, 6, 15, 0, 9, 10, 4, 5, 3},
{12, 1, 10, 15, 9, 2, 6, 8, 0, 13, 3, 4, 14, 7, 5, 11,
10, 15, 4, 2, 7, 12, 9, 5, 6, 1, 13, 14, 0, 11, 3, 8,
9, 14, 15, 5, 2, 8, 12, 3, 7, 0, 4, 10, 1, 13, 11, 6,
4, 3, 2, 12, 9, 5, 15, 10, 11, 14, 1, 7, 6, 0, 8, 13},
25
Information Security(3170720)
26
Information Security(3170720)
Output:
27
Information Security(3170720)
Conclusion:
The Data Encryption Standard (DES), developed in the 1970s, marked a significant leap forward in
modern cryptography. It is a symmetric-key block cipher that operates on 64-bit blocks of data, using
a 56-bit key for encryption and decryption. DES employs a complex series of permutations and
substitutions, known as the Feistel network, which provides robust security against various types of
attacks. However, due to advances in computing power, DES's 56-bit key length became vulnerable
to brute-force attacks, prompting its replacement by more secure algorithms like AES (Advanced
Encryption Standard) with longer key lengths. Despite its eventual obsolescence, DES remains a
landmark in the history of cryptography, serving as a foundation for subsequent encryption
standards.
Quiz:
Suggested Reference:
1. https://www.tutorialspoint.com/cryptography/data_encryption_standard.htm
Rubrics 1 2 3 4 5 Total
Marks
28
Information Security(3170720)
Experiment No: 7
Implementation of AES
Date:
Relevant CO: Implement and analyze various symmetric key cryptography algorithms
and their application in different context
Example:
Algorithm:
29
Information Security(3170720)
Program:
/* encrypt.cpp
* Performs encryption using AES 128-bit
* @author Cecelia Wisniewska
*/
#include <cstring>
#include <fstream>
#include <iostream>
#include <sstream>
30
Information Security(3170720)
0x18, 0x1a, 0x1c, 0x1e, 0x20, 0x22, 0x24, 0x26, 0x28, 0x2a, 0x2c, 0x2e,
0x30, 0x32, 0x34, 0x36, 0x38, 0x3a, 0x3c, 0x3e, 0x40, 0x42, 0x44, 0x46,
0x48, 0x4a, 0x4c, 0x4e, 0x50, 0x52, 0x54, 0x56, 0x58, 0x5a, 0x5c, 0x5e,
0x60, 0x62, 0x64, 0x66, 0x68, 0x6a, 0x6c, 0x6e, 0x70, 0x72, 0x74, 0x76,
0x78, 0x7a, 0x7c, 0x7e, 0x80, 0x82, 0x84, 0x86, 0x88, 0x8a, 0x8c, 0x8e,
0x90, 0x92, 0x94, 0x96, 0x98, 0x9a, 0x9c, 0x9e, 0xa0, 0xa2, 0xa4, 0xa6,
0xa8, 0xaa, 0xac, 0xae, 0xb0, 0xb2, 0xb4, 0xb6, 0xb8, 0xba, 0xbc, 0xbe,
0xc0, 0xc2, 0xc4, 0xc6, 0xc8, 0xca, 0xcc, 0xce, 0xd0, 0xd2, 0xd4, 0xd6,
0xd8, 0xda, 0xdc, 0xde, 0xe0, 0xe2, 0xe4, 0xe6, 0xe8, 0xea, 0xec, 0xee,
0xf0, 0xf2, 0xf4, 0xf6, 0xf8, 0xfa, 0xfc, 0xfe, 0x1b, 0x19, 0x1f, 0x1d,
0x13, 0x11, 0x17, 0x15, 0x0b, 0x09, 0x0f, 0x0d, 0x03, 0x01, 0x07, 0x05,
0x3b, 0x39, 0x3f, 0x3d, 0x33, 0x31, 0x37, 0x35, 0x2b, 0x29, 0x2f, 0x2d,
0x23, 0x21, 0x27, 0x25, 0x5b, 0x59, 0x5f, 0x5d, 0x53, 0x51, 0x57, 0x55,
0x4b, 0x49, 0x4f, 0x4d, 0x43, 0x41, 0x47, 0x45, 0x7b, 0x79, 0x7f, 0x7d,
0x73, 0x71, 0x77, 0x75, 0x6b, 0x69, 0x6f, 0x6d, 0x63, 0x61, 0x67, 0x65,
0x9b, 0x99, 0x9f, 0x9d, 0x93, 0x91, 0x97, 0x95, 0x8b, 0x89, 0x8f, 0x8d,
0x83, 0x81, 0x87, 0x85, 0xbb, 0xb9, 0xbf, 0xbd, 0xb3, 0xb1, 0xb7, 0xb5,
0xab, 0xa9, 0xaf, 0xad, 0xa3, 0xa1, 0xa7, 0xa5, 0xdb, 0xd9, 0xdf, 0xdd,
0xd3, 0xd1, 0xd7, 0xd5, 0xcb, 0xc9, 0xcf, 0xcd, 0xc3, 0xc1, 0xc7, 0xc5,
0xfb, 0xf9, 0xff, 0xfd, 0xf3, 0xf1, 0xf7, 0xf5, 0xeb, 0xe9, 0xef, 0xed,
0xe3, 0xe1, 0xe7, 0xe5};
// Used in KeyExpansion
unsigned char rcon[256] = {
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,
0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,
0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd,
0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a,
0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,
31
Information Security(3170720)
0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6,
0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72,
0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc,
0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10,
0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e,
0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5,
0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94,
0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02,
0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d,
0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d,
0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f,
0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb,
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,
0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,
0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd,
0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a,
0x74, 0xe8, 0xcb, 0x8d};
32
Information Security(3170720)
*/
void SubBytes(unsigned char *state) {
for (int i = 0; i < 16; i++) {
state[i] = s[state[i]];
}
}
/* Column 1 */
tmp[0] = state[0];
tmp[1] = state[5];
tmp[2] = state[10];
tmp[3] = state[15];
/* Column 2 */
tmp[4] = state[4];
tmp[5] = state[9];
tmp[6] = state[14];
tmp[7] = state[3];
/* Column 3 */
tmp[8] = state[8];
tmp[9] = state[13];
tmp[10] = state[2];
tmp[11] = state[7];
/* Column 4 */
tmp[12] = state[12];
tmp[13] = state[1];
tmp[14] = state[6];
tmp[15] = state[11];
33
Information Security(3170720)
tmp[8] =
(unsigned char)mul2[state[8]] ^ mul3[state[9]] ^ state[10] ^ state[11];
tmp[9] =
(unsigned char)state[8] ^ mul2[state[9]] ^ mul3[state[10]] ^ state[11];
tmp[10] =
(unsigned char)state[8] ^ state[9] ^ mul2[state[10]] ^ mul3[state[11]];
tmp[11] =
(unsigned char)mul3[state[8]] ^ state[9] ^ state[10] ^ mul2[state[11]];
tmp[12] =
(unsigned char)mul2[state[12]] ^ mul3[state[13]] ^ state[14] ^ state[15];
tmp[13] =
(unsigned char)state[12] ^ mul2[state[13]] ^ mul3[state[14]] ^ state[15];
tmp[14] =
(unsigned char)state[12] ^ state[13] ^ mul2[state[14]] ^ mul3[state[15]];
tmp[15] =
(unsigned char)mul3[state[12]] ^ state[13] ^ state[14] ^ mul2[state[15]];
// S-box 4 bytes
in[0] = s[in[0]];
in[1] = s[in[1]];
in[2] = s[in[2]];
in[3] = s[in[3]];
// RCon
in[0] ^= rcon[i];
}
34
Information Security(3170720)
35
Information Security(3170720)
int numberOfRounds = 9;
int main() {
char message[1024];
if ((paddedMessageLen % 16) != 0) {
paddedMessageLen = (paddedMessageLen / 16 + 1) * 16;
}
string str;
istringstream hex_chars_stream(str);
unsigned char key[16];
int i = 0;
36
Information Security(3170720)
unsigned int c;
while (hex_chars_stream >> hex >> c) {
key[i] = c;
i++;
}
KeyExpansion(key, expandedKey);
return 0;
}
Output:
Conclusion:
The Advanced Encryption Standard (AES) is a highly secure symmetric-key encryption algorithm
established by the U.S. National Institute of Standards and Technology (NIST) in 2001. It operates
on fixed-size blocks of data, using key lengths of 128, 192, or 256 bits. AES employs a series of
complex mathematical operations including substitution, permutation, and mixing, making it
exceptionally resistant to modern cryptographic attacks, even with substantial computational
resources. Its widespread adoption and rigorous security standards have solidified AES as a
cornerstone in contemporary encryption, utilized in a multitude of applications, from securing
communications to safeguarding sensitive data in various industries.
Quiz:
Suggested Reference:
37
Information Security(3170720)
1. https://www.geeksforgeeks.org/advanced-encryption-standard-aes/
Rubrics 1 2 3 4 5 Total
Marks
38
Information Security(3170720)
Experiment No: 8
Implementation of RSA Algorithm
Date:
Relevant CO: Compare public key cryptography with private key cryptography and
Implement various asymmetric key cryptography algorithms
(me)d = m (mod n)
The public key is represented by the integers n and e; and, the private key, by the integer d. m
represents the message. RSA involves a public key and a private key. The public key can be known
by everyone and is used for encrypting messages. The intention is that messages encrypted with the
public key can only be decrypted in a reasonable amount of time using the private key.
Example:
39
Information Security(3170720)
Algorithm:
Program:
if (gcd(e, phi) == 1)
break;
else
e++;
}
// Message to be encrypted
double msg = 12;
// Encryption c = (msg ^ e) % n
double c = pow(msg, e);
c = fmod(c, n);
printf("\nEncrypted data = %lf", c);
// Decryption m = (c ^ d) % n
double m = pow(c, d);
m = fmod(m, n);
printf("\nOriginal Message Sent = %lf\n", m);
return 0;
}
Output:
Conclusion:
RSA, named after its inventors Ron Rivest, Adi Shamir, and Leonard Adleman, is a public-key
cryptosystem introduced in 1977. It relies on the mathematical complexity of factoring large
composite numbers. RSA employs two keys: a public key for encryption and a private key for
decryption. The security of RSA is rooted in the difficulty of factoring the product of two large
prime numbers, which forms the basis of the public key. As of my last knowledge update in January
2022, RSA remains widely used for secure communications, particularly in securing online
transactions and digital signatures. However, its security relies on the assumption that factoring large
numbers is a computationally infeasible task, and with advances in quantum computing, the security
of RSA may need to be reevaluated in the future. Nevertheless, RSA stands as a monumental
achievement in modern cryptography, revolutionizing secure communication through the use of
public and private keys.
41
Information Security(3170720)
Quiz:
Suggested Reference:
1. https://www.cemc.uwaterloo.ca/resources/real-world/RSA.pdf
Rubrics 1 2 3 4 5 Total
Marks
42
Information Security(3170720)
43
Information Security(3170720)
Experiment No: 9
Implementation of Diffie–Hellman Key Exchange
Date:
Relevant CO: Compare public key cryptography with private key cryptography and
Implement various asymmetric key cryptography algorithms
Example:
Algorithm:
STEP-1: Both Alice and Bob shares the same public keys g and p.
STEP-2: Alice selects a random public key a.
STEP-3: Alice computes his secret key A as ga mod p.
STEP-4: Then Alice sends A to Bob.
STEP-5: Similarly Bob also selects a public key b and computes his secret key as B and
sends the same back to Alice.
44
Information Security(3170720)
STEP-6: Now both of them compute their common secret key as the other one’s secret key
power of a mod p.
Program:
else
return (((long long int)pow(a, b)) % P);
}
// Driver program
int main() {
long long int P, G, x, a, y, b, ka, kb;
cout << "Secret key for the Bob is : " << kb << endl;
return 0;
45
Information Security(3170720)
Output:
Conclusion:
The Diffie-Hellman key exchange, introduced in 1976, is a groundbreaking method for securely
establishing a shared secret key between two parties over an insecure channel. It relies on
mathematical operations that make it extremely difficult for eavesdroppers to determine the shared
key. Diffie-Hellman is widely used in secure communication protocols, providing a crucial
foundation for many modern encryption methods. However, it doesn't offer authentication on its
own, which necessitates additional measures to prevent "man-in-the-middle" attacks. Despite this
limitation, Diffie-Hellman remains an integral part of contemporary secure communication
protocols.
Quiz:
1. Suppose that two parties A and B wish to set up a common secret key (D-H key) between
themselves using the Diffie Hellman key exchange technique. They agree on 7 as the modulus
and 3 as the primitive root. Party A chooses 2 and party B chooses 5 as their respective secrets.
Their D-H key is ?
Suggested Reference:
1. https://www.techtarget.com/searchsecurity/definition/Diffie-Hellman-key-exchange
Rubrics 1 2 3 4 5 Total
Marks
46
Information Security(3170720)
47
Information Security(3170720)
Experiment No: 10
Implementation of MD-5
Date:
Relevant CO: Explore the concept of hashing and implement various hashing
algorithms for message integrity
Example:
48
Information Security(3170720)
Algorithm:
STEP-3: Compute the functions f, g, h and i with operations such as, rotations,
permutations, etc,.
STEP-4: The output of these functions are combined together as F and performed
circular shifting and then given to key round.
STEP-5: Finally, right shift of ‘s’ times are performed and the results are combined together
to produce the final output.
Program:
/*
* Derived from the RSA Data Security, Inc. MD5 Message-Digest Algorithm
* and modified slightly to be functionally identical but condensed into control structures.
*/
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
typedef struct{
uint64_t size; // Size of input in bytes
uint32_t buffer[4]; // Current accumulation of hash
uint8_t input[64]; // Input to be used in the next step
uint8_t digest[16]; // Result of algorithm
}MD5Context;
/*
* Constants defined by the MD5 algorithm
*/
#define A 0x67452301
#define B 0xefcdab89
#define C 0x98badcfe
#define D 0x10325476
static uint32_t S[] = {7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
49
Information Security(3170720)
4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23,
6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21};
/*
* Padding used to make the size (in bits) of the input congruent to 448 mod 512
*/
static uint8_t PADDING[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
/*
* Bit-manipulation functions defined by the MD5 algorithm
*/
#define F(X, Y, Z) ((X & Y) | (~X & Z))
#define G(X, Y, Z) ((X & Z) | (Y & ~Z))
#define H(X, Y, Z) (X ^ Y ^ Z)
#define I(X, Y, Z) (Y ^ (X | ~Z))
/*
* Rotates a 32-bit word left by n bits
*/
uint32_t rotateLeft(uint32_t x, uint32_t n){
return (x << n) | (x >> (32 - n));
}
/*
* Initialize a context
*/
void md5Init(MD5Context *ctx){
ctx->size = (uint64_t)0;
ctx->buffer[0] = (uint32_t)A;
ctx->buffer[1] = (uint32_t)B;
ctx->buffer[2] = (uint32_t)C;
ctx->buffer[3] = (uint32_t)D;
}
50
Information Security(3170720)
/*
* Add some amount of input to the context
*
* If the input fills out a block of 512 bits, apply the algorithm (md5Step)
* and save the result in the buffer. Also updates the overall size.
*/
void md5Update(MD5Context *ctx, uint8_t *input_buffer, size_t input_len){
uint32_t input[16];
unsigned int offset = ctx->size % 64;
ctx->size += (uint64_t)input_len;
// Copy each byte in input_buffer into the next space in our context input
for(unsigned int i = 0; i < input_len; ++i){
ctx->input[offset++] = (uint8_t)*(input_buffer + i);
// If we've filled our context input, copy it into our local array input
// then reset the offset to 0 and fill in a new buffer.
// Every time we fill out a chunk, we run it through the algorithm
// to enable some back and forth between cpu and i/o
if(offset % 64 == 0){
for(unsigned int j = 0; j < 16; ++j){
// Convert to little-endian
// The local variable `input` our 512-bit chunk separated into 32-bit words
// we can use in calculations
input[j] = (uint32_t)(ctx->input[(j * 4) + 3]) << 24 |
(uint32_t)(ctx->input[(j * 4) + 2]) << 16 |
(uint32_t)(ctx->input[(j * 4) + 1]) << 8 |
(uint32_t)(ctx->input[(j * 4)]);
}
md5Step(ctx->buffer, input);
offset = 0;
}
}
}
/*
* Pad the current input to get to 448 bytes, append the size in bits to the very end,
* and save the result of the final iteration into digest.
*/
void md5Finalize(MD5Context *ctx){
uint32_t input[16];
unsigned int offset = ctx->size % 64;
unsigned int padding_length = offset < 56 ? 56 - offset : (56 + 64) - offset;
// Fill in the padding and undo the changes to size that resulted from the update
md5Update(ctx, PADDING, padding_length);
ctx->size -= (uint64_t)padding_length;
51
Information Security(3170720)
md5Step(ctx->buffer, input);
/*
* Step on 512 bits of input with the main MD5 algorithm.
*/
void md5Step(uint32_t *buffer, uint32_t *input){
uint32_t AA = buffer[0];
uint32_t BB = buffer[1];
uint32_t CC = buffer[2];
uint32_t DD = buffer[3];
uint32_t E;
unsigned int j;
buffer[0] += AA;
buffer[1] += BB;
buffer[2] += CC;
buffer[3] += DD;
}
/*
52
Information Security(3170720)
* Functions that run the algorithm on the provided input and put the digest into result.
* result should be able to store 16 bytes.
*/
void md5String(char *input, uint8_t *result){
MD5Context ctx;
md5Init(&ctx);
md5Update(&ctx, (uint8_t *)input, strlen(input));
md5Finalize(&ctx);
int main(void){
char *plaintext = "ineedvacation";
uint8_t result[16];
md5String(plaintext, result);
printf("MD5 hash of %s : ", plaintext);
printArrayBuffer(result, 16);
return 0;
}
Output:
Conclusion:
MD5 (Message Digest Algorithm 5) is a widely used cryptographic hash function developed by
Ronald Rivest in 1991. It takes an input (or message) and produces a fixed-size 128-bit hash value,
commonly represented as a 32-character hexadecimal number. MD5 is known for its speed and
efficiency, making it popular for tasks like checksumming and data integrity verification. However,
due to vulnerabilities discovered over time, such as collision attacks, MD5 is no longer considered
secure for cryptographic purposes. It has been largely replaced by more robust hash functions like
SHA-256 in applications where security is paramount. Despite its historical significance, MD5 is
now generally discouraged for security-sensitive tasks.
Quiz:
Suggested Reference:
1. https://www.simplilearn.com/tutorials/cyber-security-tutorial/md5-algorithm
53
Information Security(3170720)
Rubrics 1 2 3 4 5 Total
Marks
54
Information Security(3170720)
Experiment No: 11
Implementation of SHA-1
Date:
Relevant CO: Explore the concept of hashing and implement various hashing
algorithms for message integrity
Example:
Algorithm:
55
Information Security(3170720)
STEP-6: Then it is permuted with a weight value and then with some other key pair and
taken as the first block.
STEP-7: Block A is taken as the second block and the block B is shifted by ‘s’ times and
taken as the third block.
STEP-8: The blocks C and D are taken as the block D and E for the final output.
Program:
#include <cstdint>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
class SHA1 {
public:
SHA1();
void update(const std::string &s);
void update(std::istream &is);
std::string final();
static std::string from_file(const std::string &filename);
private:
uint32_t digest[5];
std::string buffer;
uint64_t transforms;
};
/* Reset counters */
buffer = "";
transforms = 0;
}
56
Information Security(3170720)
/*
* (R0+R1), R2, R3, R4 are the different operations used in SHA1
*/
/*
57
Information Security(3170720)
58
Information Security(3170720)
R3(block, e, a, b, c, d, 9);
R3(block, d, e, a, b, c, 10);
R3(block, c, d, e, a, b, 11);
R3(block, b, c, d, e, a, 12);
R3(block, a, b, c, d, e, 13);
R3(block, e, a, b, c, d, 14);
R3(block, d, e, a, b, c, 15);
R3(block, c, d, e, a, b, 0);
R3(block, b, c, d, e, a, 1);
R3(block, a, b, c, d, e, 2);
R3(block, e, a, b, c, d, 3);
R3(block, d, e, a, b, c, 4);
R3(block, c, d, e, a, b, 5);
R3(block, b, c, d, e, a, 6);
R3(block, a, b, c, d, e, 7);
R3(block, e, a, b, c, d, 8);
R3(block, d, e, a, b, c, 9);
R3(block, c, d, e, a, b, 10);
R3(block, b, c, d, e, a, 11);
R4(block, a, b, c, d, e, 12);
R4(block, e, a, b, c, d, 13);
R4(block, d, e, a, b, c, 14);
R4(block, c, d, e, a, b, 15);
R4(block, b, c, d, e, a, 0);
R4(block, a, b, c, d, e, 1);
R4(block, e, a, b, c, d, 2);
R4(block, d, e, a, b, c, 3);
R4(block, c, d, e, a, b, 4);
R4(block, b, c, d, e, a, 5);
R4(block, a, b, c, d, e, 6);
R4(block, e, a, b, c, d, 7);
R4(block, d, e, a, b, c, 8);
R4(block, c, d, e, a, b, 9);
R4(block, b, c, d, e, a, 10);
R4(block, a, b, c, d, e, 11);
R4(block, e, a, b, c, d, 12);
R4(block, d, e, a, b, c, 13);
R4(block, c, d, e, a, b, 14);
R4(block, b, c, d, e, a, 15);
59
Information Security(3170720)
/*
* Add padding and return the message digest.
*/
/* Padding */
buffer += (char)0x80;
size_t orig_size = buffer.size();
while (buffer.size() < BLOCK_BYTES) {
buffer += (char)0x00;
}
uint32_t block[BLOCK_INTS];
buffer_to_block(buffer, block);
60
Information Security(3170720)
/* Hex std::string */
std::ostringstream result;
for (size_t i = 0; i < sizeof(digest) / sizeof(digest[0]); i++) {
result << std::hex << std::setfill('0') << std::setw(8);
result << digest[i];
}
return result.str();
}
int main() {
SHA1 checksum;
std::cout << std::endl;
std::cout << "Test: \t" << plaintext << std::endl;
checksum.update(plaintext);
std::cout << "Hashed: " << checksum.final() << std::endl;
return 0;
}
Output:
Conclusion:
SHA-1, or Secure Hash Algorithm 1, is a cryptographic hash function developed in 1995. It creates a
fixed-size 160-bit hash value from input data. Initially widely used for security applications,
vulnerabilities were discovered over time, making it vulnerable to collision attacks. Due to these
weaknesses, SHA-1 is now considered insecure for cryptographic purposes. It has been largely
replaced by more robust hash functions like SHA-256 in applications where security is paramount.
Quiz:
62
Information Security(3170720)
Suggested Reference:
1. https://www.geeksforgeeks.org/sha-1-hash-in-java/.
Rubrics 1 2 3 4 5 Total
Marks
63
Information Security(3170720)
Experiment No: 12
Implementation of digital signature standard
Date:
Relevant CO: Explore and use the techniques and standards of digital signature, key
management and authentication
Example:
Algorithm:
64
Information Security(3170720)
Program:
// Imports
import java.nio.charset.StandardCharsets;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.Signature;
import java.util.Scanner;
// Signing Algorithm
private static final String SIGNING_ALGORITHM = "SHA256withRSA";
private static final String RSA = "RSA";
private static Scanner sc;
.verify(signatureToVerify);
}
// Driver Code
public static void main(String args[])
throws Exception {
// Function Call
byte[] signature = Create_Digital_Signature(
input.getBytes(),
keyPair.getPrivate());
System.out.println(
"Signature Value:\n "
+ bytesToHex(signature));
System.out.println(
"Verification: "
+ Verify_Digital_Signature(
input.getBytes(),
signature, keyPair.getPublic()));
}
}
Output:
Conclusion:
A signature algorithm is a cryptographic process used to create and verify digital signatures,
providing authentication, integrity, and non-repudiation in electronic communications. It involves
using a private key to generate a unique digital signature from a piece of data, which can be verified
using the corresponding public key. This process ensures that the signature was created by the
possessor of the private key and that the data has not been tampered with. Widely used signature
algorithms include RSA, ECDSA (Elliptic Curve Digital Signature Algorithm), and DSA (Digital
Signature Algorithm). It's crucial for secure transactions, digital certificates, and various
authentication mechanisms in modern digital communication.
66
Information Security(3170720)
67
Information Security(3170720)
Quiz:
Suggested Reference:
1. https://www.geeksforgeeks.org/digital-signature-standard-dss/
Rubrics 1 2 3 4 5 Total
Marks
68
Information Security(3170720)
Experiment No: 13
Demonstrate how to work with CrypTool
Date:
Relevant CO: -----
Introduction:
The JCrypTool installation is very simple: download and extract the zip-archive, launch the
main program and get started.
Encryption
1. Open the Cryptool UI and the document that needs to be encrypted.
69
Information Security(3170720)
3. Select Caesar mode and the “alphabet character” is “N.” That means that the text will have
characters replaced starting with N. So A >N, B>M, and so on. Click on “encrypt.”
70
Information Security(3170720)
4. The document is encrypted as per the configured policy. This is a very basic example of how
symmetric encryption works.
Decryption process
71
Information Security(3170720)
Conclusion:
CrypTool is a powerful and comprehensive free software package with very approachable interface.
Along with its accompanying extensive support materials and programs, it provides substantial
assistance to individuals interested in security, student wanting to explore the field, and as a
teaching tool for instructors.
The variety of different algorithms implemented in CrypTool, from the earliest known to the most
modern, both sets the background for current cryptography, and also enables an understanding of the
most modern cryptographic principles and algorithms.
While tools like CrypTool do take class time to teach, the learning curve is not steep and the time
that would otherwise be used to discuss coding the different cryptography and cryptanalysis tools
can be used to cover additional cryptography concept
Suggested Reference:
1. https://www.c-sharpcorner.com/article/encryption-decryption-using-cryptool/
72
Information Security(3170720)
Experiment No: 14
Demonstrate Working of Wireshark
Date:
Relevant CO:
Introduction:
The Wireshark installation is very simple: download and extract the zip-archive, launch the main
program and get started.
Installation
Installing Wireshark on Windows: Follow the below steps to install Wireshark on Windows:
Step 1: Visit the official Wireshark website using any web browser.
Step 2: Click on Download, a new webpage will open with different installers of Wireshark.
73
Information Security(3170720)
Step 3: Downloading of the executable file will start shortly. It is a small 73.69 MB file that will
take some time.
Step 4: Now check for the executable file in downloads in your system and run it.
74
Information Security(3170720)
Step 5: It will prompt confirmation to make changes to your system. Click on Yes.
75
Information Security(3170720)
Step 8: This screen is for choosing components, all components are already marked so don’t change
anything just click on the Next button.
Step 9: This screen is of choosing shortcuts like start menu or desktop icon along with file
extensions which can be intercepted by Wireshark, tick all boxes and click on Next button.
76
Information Security(3170720)
Step 10: The next screen will be of installing location so choose the drive which will have sufficient
memory space for installation. It needed only a memory space of 223.4 MB.
Step 11: Next screen has an option to install Npcap which is used with Wireshark to capture
packets pcap means packet capture so the install option is already checked don’t change anything
and click the next button.
77
Information Security(3170720)
Step 12: Next screen is about USB network capturing so it is one’s choice to use it or not, click on
Install.
Step 14: This installation will prompt for Npcap installation as already checked so the license
agreement of Npcap will appear to click on the I Agree button.
78
Information Security(3170720)
Step 15: Next screen is about different installing options of npcap, don’t do anything click on
Install.
Step 16: After this installation process will start which will take only a minute.
79
Information Security(3170720)
Step 17: After this installation process will complete click on the Next button.
80
Information Security(3170720)
81
Information Security(3170720)
Step 19: After this installation process of Wireshark will complete click on the Next button.
Step 20: Click on Finish after the installation process of Wireshark is complete.
82
Information Security(3170720)
Wireshark is successfully installed on the system and an icon is created on the desktop as shown
below:
83
Information Security(3170720)
Now you can use wireshark for packet capturing and filtering
Conclusion:
Wireshark plays a crucial role in network security analysis. It allows security professionals to inspect
packets for signs of malicious activities, such as suspicious traffic patterns, unauthorized access
attempts, or data exfiltration
Suggested Reference:
1. https://www.javatpoint.com/wireshark
2. https://www.comptia.org/content/articles/what-is-wireshark-and-how-to-use-it#:~:text=What
%20Is%20Wireshark%20Used%20For,identify%20bursts%20of%20network%20traffic.
84