Ins Final Manual
Ins Final Manual
BACHELOR OF TECHNOLOGY
SEMESTER VII
Laboratory Manual
CERTIFICATE
This is to certify that Mr. Wagh Deepkumar Atul with enrollment no.
TABLE OF CONTENT
Page No
Date Date of Marks
Sr.
Experiment Title of Comple Sign (out of
No
Start tion 10)
From To
2. Implement Monoalphabetic
cipher encryption-decryption.
PRACTICAL-1
Aim: Implement Caesar Cipher encryption-decryption.
Theory:
The encryption process takes each letter in the text message and replaces it with a letter that appears
in the three alphabets. For example, the word "HELLO" would be encrypted as "KHOOR" with move
3. The same process is applied for decryption, but in reverse. Each letter of the encrypted message is
reshuffled by the same amount that restores the original plaintext. The Caesar cipher works on the
principle of modular arithmetic, where the transmission revolves around the alphabet. For example, if
the offset value is 3 and the letter is "X", which is at the end of the alphabet, it will be broken to the
first letter "A". This wrapper ensures consistent encryption and decryption. Although the Caesar cipher
is simple and easy to understand, it is also very vulnerable to attack. Since there are only 26 possible
transitions, a brute-force attack can easily try all combinations, rendering encryption ineffective.
Therefore, the Caesar cipher is considered a weak form of encryption and is not suitable for protecting
sensitive information in today's context. However, it is still a valuable learning tool for introducing
the concepts of encryption and decryption.
Encryption Code:
#include<iostream>
using namespace std;
int main()
{
char message[100], ch;
int i, key;
cout << "Enter a message to encrypt: ";
cin.getline(message, 100);
cout << "Enter key: ";
cin >> key;
for(i = 0; message[i] != '\0'; ++i){
ch = message[i];
if(ch >= 'a' && ch <= 'z'){
ch = ch + key;
if(ch > 'z'){
ch = ch - 'z' + 'a' - 1;
}
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch + key;
if(ch > 'Z'){
ch = ch - 'Z' + 'A' - 1;
}
message[i] = ch;
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
}
}
cout << "Encrypted message: " << message;
return 0;
}
OUTPUT :
Decryption Code:
#include<iostream>
using namespace std;
int main()
{
char message[100], ch;
int i, key;
cout << "Enter a message to decrypt: ";
cin.getline(message, 100);
cout << "Enter key: ";
cin >> key;
for(i = 0; message[i] != '\0'; ++i){
ch = message[i];
if(ch >= 'a' && ch <= 'z'){
ch = ch - key;
if(ch < 'a'){
ch = ch + 'z' - 'a' + 1;
}
message[i] = ch;
}
else if(ch >= 'A' && ch <= 'Z'){
ch = ch - key;
if(ch > 'a'){
ch = ch + 'Z' - 'A' + 1;
}
message[i] = ch;
}
}
cout << "Decrypted message: " << message;
return 0;
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Output:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
PRACTICAL – 2
Theory:
A monoalphabetic cipher is a basic form of substitution cipher where each letter in the plaintext is
replaced by a corresponding letter from the ciphertext alphabet. The substitution is based on a fixed
mapping between the letters of the two alphabets.
Choose a secret key that is a permutation of the letters of the alphabet. Take the text message and
replace each letter with the corresponding key letter. The resulting ciphertext is an encrypted
message. Decryption: Get the secret key used for encryption. Take the secret text message and
replace each letter with the corresponding key letter in reverse order. The resulting plaintext is the
decrypted message. For example, suppose our secret key is
"QWERTYUIOPASDFGHJKLZXCVBNM", where every letter of the alphabet is associated with
that letter. corresponding letter in the key. Using this key, the plaintext "HELLO" is encrypted as
"QEBZY" (H -> Q, E -> E, L -> B, L -> Z, O -> Y). To decrypt the message, we would use the same
key in reverse, so "QEBZY" becomes "HELLO" again.
Encryption Code:
#include <bits/stdc++.h>
using namespace std;
unordered_map<char,char> hashmap;
string encrypt(string msg)
{
string ciphertext;
for(int i=0; i<msg.size(); i++)
{
ciphertext.push_back(hashmap[msg[i]]);
}
return ciphertext;
}
void hashFn(string a, string b)
{
hashmap.clear();
for(int i=0; i<a.size(); i++)
{
hashmap.insert(make_pair(a[i],b[i]));
}
}
int main()
{
string alphabet = "abcdefghijklmnopqrstuvwxyz";
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
OUTPUT :
Decryption Code:
#include <bits/stdc++.h>
using namespace std;
unordered_map<char,char> hashmap;
string decrypt(string msg)
{
string plaintext;
for(int i=0; i<msg.size(); i++)
{
plaintext.push_back(hashmap[msg[i]]);
}
return plaintext;
}
void hashFn(string a, string b)
{
hashmap.clear();
for(int i=0; i<a.size(); i++)
{
hashmap.insert(make_pair(a[i],b[i]));
}
}
int main()
{
string alphabet = "abcdefghijklmnopqrstuvwxyz";
string substitution = "qwertyuiopasdfghjklzxcvbnm";
string msg = "agxliqs";
hashFn(substitution, alphabet);
string plain = decrypt(msg);
cout<<"encryted text:"<<msg<<endl;
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
OUTPUT :
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
PRACTICAL – 3
Theory:
The Playfair Cipher is a polygraph substitution cipher invented by Charles Wheatstone in the 1800s
but popularized by Lord Playfair during the Crimean War. It provides a more secure alternative to
single-letter ciphers by using a 5 x 5 grid of letters for encryption and decryption. Choose a keyword
or phrase without repeating letters.
Create a 5x5 grid (matrix) using the letters of the keyword followed by the rest of the alphabet
(except 'J' as it is usually combined with 'I'). Playfair encryption offers a better level of protection
than single letter encryption. ciphers because it removes some of the vulnerabilities associated with
frequency analysis. However, it is still vulnerable to certain types of attacks such as known plaintext
attacks and selected plaintext attacks.
Encryption Code:
#include <iostream>
#include <vector>
#include <algorithm>
int index = 0;
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
return key_matrix;
}
if (c1 == c2) {
c2 = 'X';
--i;
++length;
}
i += 2;
}
return ciphertext;
}
i += 2;
}
return plaintext;
}
int main() {
std::string plaintext;
std::string key;
// Menu
std::cout << "----------------------------------------------" << std::endl;
std::cout << "Options:" << std::endl;
std::cout << "1. Encrypt" << std::endl;
std::cout << "2. Decrypt" << std::endl;
int choice;
std::cout << "Enter your choice: ";
std::cin >> choice;
if (choice == 1) {
std::string ciphertext = playfair_encrypt(key_matrix, plaintext);
std::cout << "----------------------------------------------" << std::endl;
std::cout << "5x5 Matrix:" << std::endl;
print_matrix(key_matrix);
std::cout << "----------------------------------------------" << std::endl;
std::cout << "Ciphertext: " << ciphertext << std::endl;
} else if (choice == 2) {
std::string decrypted_text = playfair_decrypt(key_matrix, plaintext);
std::cout << "----------------------------------------------" << std::endl;
std::cout << "5x5 Matrix:" << std::endl;
print_matrix(key_matrix);
std::cout << "----------------------------------------------" << std::endl;
std::cout << "Decrypted Text: " << decrypted_text << std::endl;
} else {
std::cout << "Invalid option selected. Please try again." << std::endl;
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
return 0;
}
OUTPUT:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
PRACTICAL – 4
Theory:
Hill encryption is an encryption algorithm used to both encrypt and decrypt data. It falls under the
category of surrogate crypto and offers a higher level of security compared to traditional surrogate
crypto such as Caesar or Playfair crypto. Due to its mathematical nature and block-based encryption,
the Hill cipher is considered more secure than simple substitution ciphers. However, it is not widely
used in modern encryption systems due to its limitations and vulnerability to certain attacks. Instead,
practical applications generally use stronger and more efficient encryption algorithms, such as the
Advanced Encryption Standard (AES).
Code:
#include<bits/stdc++.h>
using namespace std ;
int mod26(int x)
{
return x >= 0 ? (x%26) : 26-(abs(x)%26) ;
}
/* findDet(matrix , order_of_matrix) */
int findDet(int m[3][3] , int n)
{
int det;
if(n == 2)
{
det = m[0][0] * m[1][1] - m[0][1]*m[1][0] ;
}
else if (n == 3)
{
det = m[0][0]*(m[1][1]*m[2][2] - m[1][2]*m[2][1]) - m[0][1]*(m[1][0]*m[2][2] -
m[2][0]*m[1][2] ) + m[0][2]*(m[1][0]*m[2][1] - m[1][1]*m[2][0]);
}
else det = 0 ; // invalid input
return mod26(det);
}
while(R!=0)
{
q[i] = D/R ;
int oldD = D ;
D=R;
R = oldD%R ;
if(i>1)
{
p[i] = mod26(p[i-2] - p[i-1]*q[i-2]) ;
}
i++ ;
}
if (i == 1) return 1;
else return p[i] = mod26(p[i-2] - p[i-1]*q[i-2]) ;
}
void multiplyMatrices(int a[1000][3] , int a_rows , int a_cols , int b[1000][3] , int b_rows , int b_cols
, int res[1000][3])
{
for(int i=0 ; i < a_rows ; i++)
{
for(int j=0 ; j < b_cols ; j++)
{
for(int k=0 ; k < b_rows ; k++)
{
res[i][j] += a[i][k]*b[k][j] ;
}
res[i][j] = mod26(res[i][j]) ;
}
}
}
if(n==2)
{
adj[0][0] = m[1][1];
adj[1][1] = m[0][0];
adj[0][1] = -m[0][1];
adj[1][0] = -m[1][0];
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
}
else if(n==3)
{
int temp[5][5] = {0} ;
// fill the 5x5 matrix
for(int i=0; i<5; i++)
{
for(int j=0; j<5; j++)
{
temp[i][j] = m[i%3][j%3] ;
}
}
/* except first row and first column, multiply elements along rows and place them
along columns */
for(int i=1; i<=3 ; i++)
{
for(int j=1; j<=3 ; j++)
{
adj[j-1][i-1] = temp[i][j]*temp[i+1][j+1] - temp[i][j+1]*temp[i+1][j];
}
}
}
// C = PK
string encrypt(string pt, int n)
{
int P[1000][3] = {0} ; // plaintext
int C[1000][3] = {0} ; // cipher text
int ptIter = 0 ;
while(pt.length()%n != 0)
{
pt += "x" ; // pad extra x
}
int row = (pt.length())/n; // number of rows in P
P[i][j] = pt[ptIter++]-'a' ;
}
}
string ct = "" ;
for(int i=0 ; i<row ; i++)
{
for(int j=0 ; j<n ;j++)
{
ct += (C[i][j] + 'a');
}
}
return ct ;
}
// P = C*(k_inverse)
string decrypt(string ct, int n)
{
int P[1000][3] = {0} ; // plaintext
int C[1000][3] = {0} ; // cipher text
int ctIter = 0 ;
string pt = "" ;
for(int i = 0 ; i<row ; i++)
{
for(int j=0 ; j<n ; j++)
{
pt += (P[i][j] + 'a');
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
}
return pt ;
}
int main(void)
{
string pt ;
int n ;
string ct = encrypt(pt, n) ;
cout << "Encrypted text : " << ct << endl;
Output:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Practical – 5
Theory:
Polyalphabetic cipher is a type of cipher that uses multiple alphabets or substitution rules to encode
plaintext. Unlike monoalphabetic ciphers, where each letter is consistently replaced by its
corresponding letter, polyalphabetic ciphers add variety by using different substitution rules based on
the letter's position in the plaintext. Multi-character ciphers, such as Vigenère ciphers, offer better
security than single-character ciphers. encryptions The variability caused by multiple substitution rules
makes it difficult for attackers to perform frequency analysis or other known plaintext attacks.
However, polyalphabetic ciphers can be vulnerable to cryptanalysis techniques, such as the Kasiski
and Friedman tests, which aim to identify patterns and break the cipher.
Code:
#include <iostream>
#include <string>
if (isalpha(plain_text[i])) {
return encrypted_text;
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
if (isalpha(encrypted_text[i])) {
return decrypted_text;
int main() {
while (true) {
char choice;
switch (choice) {
case '1': {
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
getline(cin, plaintext);
getline(cin, key);
break;
case '2': {
getline(cin, encrypted_text);
getline(cin, key);
break;
case '3':
return 0;
default:
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
return 0;
Output:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Practical – 6
Aim: Implement Simple Transposition encryption-decryption.
Theory:
Simple transfer is a basic technique used in cryptography to encrypt plaintext by rearranging its
characters according to a specific pattern. This is a type of symmetric encryption, which means that
the same key is used for both encryption and decryption. This method involves changing the characters
of the plaintext based on a defined rule, creating ciphertext that appears scrambled. Due to its
simplicity and lack of strong security, Simple Transposition is not recommended for today's encryption
needs. Instead, more powerful and advanced encryption algorithms such as AES (Advanced
Encryption Standard) are used to protect sensitive data and communications.
Encryption code:
#include <iostream>
#include <string>
#include <vector>
int index = 0;
grid[i][j] = plaintext[index++];
else {
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
grid[i][j] = 'X';
string ciphertext;
if (grid[i][j] != 'X') {
ciphertext += grid[i][j];
return ciphertext;
int main() {
int key;
getline(cin, plaintext);
return 0;
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Output:
Decryption Code:
#include <iostream>
#include <string>
#include <vector>
int index = 0;
grid[i][j] = ciphertext[index++];
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
// Read the characters from the grid row by row to form plaintext
string plaintext;
plaintext += grid[i][j];
return plaintext;
int main() {
int key;
getline(cin, ciphertext);
return 0;
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
OUTPUT :
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
PRACTICAL 7
Aim: Implement One-Time Pad Encryption Decryption
Theory:
The One-Time Pad (OTP) is a cryptographic technique that offers perfect secrecy when implemented
correctly. It involves using a random and secret key, with the same length as the plaintext, to encrypt
the message. Each key is used only once, hence the name "one-time pad." XOR (exclusive OR)
operation combines the plaintext and the key, making decryption impossible without the same key.
OTP is unbreakable in theory, as any ciphertext can correspond to any plaintext, providing no
statistical patterns for attackers to exploit. However, it faces practical challenges, such as key
distribution and key secrecy, making it rarely used for large-scale communications today.
Encryption Code:
#include <iostream>
#include <string>
#include <cstdlib>
#include <ctime>
string key;
return key;
if (plaintext.length() != key.length()) {
cerr << "Error: Plaintext and key must have the same length." << endl;
exit(1);
}
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
string ciphertext;
char encryptedChar = (plaintext[i] ^ key[i]) + 'A'; // XOR operation and convert to uppercase
ciphertext += encryptedChar;
return ciphertext;
int main() {
string plaintext;
getline(cin, plaintext);
return 0;
Output:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Practical 8
Aim: Implement Diffi-Hellmen Key exchange Method.
Theory:
Diffie-Hellman is a key exchange algorithm. It allows two parties to securely agree on a shared secret
key over an insecure communication channel. Once they have the shared secret key, they can use it
for encryption and decryption using symmetric encryption algorithms like AES
Input:
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <ctime>
long long modExp(long long base, long long exponent, long long modulo) {
if (exponent == 0)
return 1;
if (exponent % 2 == 1)
return result;
int main() {
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
srand(static_cast<unsigned>(time(nullptr)));
long long prime = 23; // You can choose a larger prime for increased security
// Both Alice and Bob should have the same shared secret
if (secretAlice == secretBob) {
} else {
return 0;
Output:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Practical 9
Aim: Implement RSA encryption-decryption algorithm.
Theory:
RSA (Rivest-Shamir-Adleman) is a widely used public-key encryption algorithm. In RSA, two keys
are generated—a public key for encryption and a private key for decryption. The security of RSA
relies on the difficulty of factoring large numbers into their prime components. To encrypt a message,
the sender uses the recipient's public key. Only the recipient, holding the private key, can decrypt the
message. RSA provides confidentiality and authentication in secure communications, digital
signatures, and secure key exchange. Its strength lies in the challenge of factoring large semiprime
numbers, making it secure for practical applications when using sufficiently long keys.
Input:
#include<iostream>
#include<math.h>
using namespace std;
// find gcd
int gcd(int a, int b) {
int t;
while(1) {
t= a%b;
if(t==0)
return b;
a = b;
b= t;
}
}
int main() {
//2 random prime numbers
double p = 13;
double q = 11;
double n=p*q;//calculate n
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
double track;
double phi= (p-1)*(q-1);//calculate phi
//public key
//e stands for encrypt
double e=7;
//for checking that 1 < e < phi(n) and gcd(e, phi(n)) = 1; i.e., e and phi(n) are coprime.
while(e<phi) {
track = gcd(e,phi);
if(track==1)
break;
else
e++;
}
//private key
//d stands for decrypt
//choosing d such that it satisfies d*e = 1 mod phi
double d1=1/e;
double d=fmod(d1,phi);
double message = 9;
double c = pow(message,e); //encrypt the message
double m = pow(c,d);
c=fmod(c,n);
m=fmod(m,n);
cout<<"Original Message = "<<message;
cout<<"\n"<<"p = "<<p;
cout<<"\n"<<"q = "<<q;
cout<<"\n"<<"n = pq = "<<n;
cout<<"\n"<<"phi = "<<phi;
cout<<"\n"<<"e = "<<e;
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
cout<<"\n"<<"d = "<<d;
cout<<"\n"<<"Encrypted message = "<<c;
cout<<"\n"<<"Decrypted message = "<<m;
return 0;
}
Output:
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Practical 10
Aim: Demonstrate working of Digital Signature using Cryptool.
Theory:
Digital signatures are a cryptographic technique used to verify the authenticity and integrity of digital
messages or documents. They involve two main operations: signing and verifying.
• A user generates a key pair consisting of a private key and a public key.
• The private key is kept secret and is used for signing.
• The public key is shared with others and is used for verifying the signatures.
Signing:
Verifying:
• The recipient receives the message and the attached digital signature.
• The recipient computes the hash of the received message using the same hash function.
• The recipient decrypts the digital signature using the sender's public key, obtaining a hash.
• If the computed hash matches the decrypted hash, the signature is valid, and the message is
considered authentic and unaltered.
Key Generation:
• Use Cryptool to generate a key pair, which includes a private key and a corresponding public
key.
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
Signing:
Verifying:
• Input the received message, digital signature, and the sender's public key into Cryptool.
• Cryptool will compute the hash of the received message.
• It will then decrypt the digital signature using the sender's public key, obtaining a hash.
• If the computed hash matches the hash of the received message, Cryptool will confirm that the
signature is valid.
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170
COMPUTER SCIENCE AND ENGINEERING
FACULTY OF ENGINEERING & TECHNOLOGY
INFORMATION AND NETWORK SECURITY (203105311) B. Tech. 4th YEAR
ENROLLMENT NO: 200303105170