0% found this document useful (0 votes)
4 views40 pages

CyberSecurity Lab

The document outlines various experiments conducted in a Cyber-Security Lab by a B.Tech-CSE student, Reeya Varanjani, at Mohanlal Sukhadia University. It includes implementations of cryptographic techniques like Caesar Cipher and Rail Fence, Diffie-Hellman Key Exchange, and attacks such as Brute Force and Dictionary Attack. Additionally, it covers the installation of tools like Wireshark and rootkits, along with their functionalities and procedures.

Uploaded by

chirayumishra24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views40 pages

CyberSecurity Lab

The document outlines various experiments conducted in a Cyber-Security Lab by a B.Tech-CSE student, Reeya Varanjani, at Mohanlal Sukhadia University. It includes implementations of cryptographic techniques like Caesar Cipher and Rail Fence, Diffie-Hellman Key Exchange, and attacks such as Brute Force and Dictionary Attack. Additionally, it covers the installation of tools like Wireshark and rootkits, along with their functionalities and procedures.

Uploaded by

chirayumishra24
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 40

INSTITUTE OF ENGINEERING AND TECHNOLOGY

Mohanlal Sukhadia University, Udaipur


Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

S.No. Topic Date Signature

1. Implement the following Substitution


& Transposition Techniques concepts:
a) Caesar Cipher
b) Rail fence row & Column
Transformation
2. Implement the Diffie-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).
3. Implement the following Attack: a)
Dictionary Attack b) Brute Force
Attack
4. Installation of Wire shark, tcpdump,
etc and observe data transferred in
client server communication using
UDP/TCP and identify the UDP/TCP
datagram.
5. Installation of rootkits and study about
the variety of options.
6. Perform an Experiment to Sniff
Traffic using ARP Poisoning.
7. Demonstrate intrusion detection
system using any tool (snort or any
other s/w).
8. Demonstrate how to provide secure
data storage, secure data transmission
and for creating digital signatures.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 1

AIM: Implement the following Substitution & Transposition Techniques


concepts:
a) Caesar Cipher
b) Rail fence row & Column Transformation

PROGRAM: (a)

#include<stdio.h>
intmain()
{
char msg[100], ch;
inti,key;
printf("Enter a Encrypted test \t");
gets(msg);
printf("Enter key \t");
scanf("%d",&key);
for(i=0;msg[i]!='\0';i++)
{
ch=msg[i];
if(ch>='a'&&ch<='z')
{
ch=ch-key;
if(ch<'a')
{
ch=ch+'z'-'a'+1;
}
msg[i]=ch;
}
else if(ch>='A'&&ch<'Z')
{
ch=ch+key;
if(ch<'A')
{
ch=ch+'Z'-'A'+1;
}
msg[i]=ch;
}
}
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

printf("Dycrypted message: %s", msg);


return 0;
}

CODE OUTPUT: (a)

Text : ABCDEFGHIJKLMNOPQRSTUVWXYZ
Shift: 23
Cipher: XYZABCDEFGHIJKLMNOPQRSTUVW

Text : ATTACKATONCE
Shift: 4
Cipher: EXXEGOEXSRGI

PROGRAM: (b)

#include<stdio.h>
#include<string.h>
void main()
{
inti,j,k,l;
char a[20],c[20],d[20];
printf("\n\t\t RAIL FENCE TECHNIQUE");
printf("\n\nEnter the input string : ");
gets(a);
l=strlen(a);
/*Ciphering*/
for(i=0,j=0;i<l;i++)
{
if(i%2==0)
c[j++]=a[i];
}
for(i=0;i<l;i++)
{
if(i%2==1)
c[j++]=a[i];
}
c[j]='\0';
printf("\nCipher text after applying rail fence :");
printf("\n%s",c);
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

/*Deciphering*/
if(l%2==0)
k=l/2;
else
k=(l/2)+1;
for(i=0,j=0;i<k;i++)
{
d[j]=c[i];
j=j+2;
}
for(i=k,j=1;i<l;i++)
{
d[j]=c[i];
j=j+2;
}
d[l]='\0';
printf("\nText after decryption : ");
printf("%s",d);
}

CODE OUTPUT: (b)

Encryption
Input : "defend the east wall"
Key = 3
Output :dnhaweedteesalftl
Decryption
Input :dnhaweedteesalftl
Key = 3
Output : defend the east wall
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 2

AIM: Implement the Diffie-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).

PROGRAM:

#include<stdio.h>
#include<conio.h>
long longintpower(int a, int b, int mod)
{
long longint t;
if(b==1)
return a;
t=power(a,b/2,mod);
if(b%2==0)
return (t*t)%mod;
else
return (((t*t)%mod)*a)%mod;
}
long intcalculateKey(int a, int x, int n)
{
return power(a,x,n);
}
void main()
{
intn,g,x,a,y,b;
clrscr();
printf("Enter the value of n and g : ");
scanf("%d%d",&n,&g);
printf("Enter the value of x for the first person : ");
scanf("%d",&x);
a=power(g,x,n);
printf("Enter the value of y for the second person : ");
scanf("%d",&y);
b=power(g,y,n);
printf("key for the first person is :
%lld\n",power(b,x,n));
printf("key for the second person is :
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

%lld\n",power(a,y,n));
getch();
}

CODE OUTPUT:

The value of P : 23
The value of G : 9

The private key a for Alice : 4


The private key b for Bob : 3

Secret key for the Alice is : 9


Secret Key for the Bob is : 9
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 3

AIM:Implement the following Attack: Brute Force Attack

PROGRAM:

#include <stdio.h>
#include <string.h>
#define MAX 100

/* try to find the given pattern in the search string */


intbruteForce(char *search, char *pattern, intslen, intplen) {
inti, j, k;
for (i = 0; i<= slen - plen; i++) {
for (j = 0, k = i; (search[k] == pattern[j]) &&(j <plen); j++, k++);
if (j == plen)
return j;
}
return -1;
}

intmain()
{
char searchStr[MAX], pattern[MAX];
int res;
printf("Enter Search String:");
fgets(searchStr, MAX, stdin);
printf("Enter Pattern String:");
fgets(pattern, MAX, stdin);
searchStr[strlen(searchStr) - 1] = '\0';
pattern[strlen(pattern) - 1] = '\0';
res = bruteForce(searchStr, pattern, strlen(searchStr), strlen(pattern));
if (res == -1) {
printf("Search pattern is not available\n");
} else {
printf("Search pattern available at the location %d\n", res);
}
return 0;
}
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

CODE OUTPUT:

Enter Search String:God is Great


Enter Pattern String:Great
Search pattern available at the location 5
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 4
AIM:Installation of Wire shark, tcpdump,

PROGRAM:
Wireshark is an invaluable packet analyzer used for network troubleshooting and
analysis. This tutorial will show you how to download and install Wireshark in a
Windows 10 system.

Requirements:
Before installing Wireshark, Determine your system type by pressing the Windows
button and typing ‘msinfo’.

CODE OUTPUT:

The Windows system has two types which can be X86-based PC (32-bit system) or
X64-based PC (64-bit system).
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

Installing Wireshark on Windows 10


1. Select the Wireshark Windows Installer matching your system type, either 32-bit
or 64-bit as determined.

2. Download and install Wireshark


NOTE: If you are a beginner with using Wireshark, please select the stable release
version.

3. The download should start automatically once you selected the compatible
Windows Installer for your Windows 10 platform.

4. Save the program in the Downloads folder, then Close the web browser.
Install Wireshark
1. Open Windows Explorer.
2. Select the Downloads folder.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

3. Locate the version of Wireshark you downloaded.


4. Double-click on the file to open it. If you see a User Account Control dialog box,
select Yes to allow the program to make changes to this computer.
5. Select Next to start the Setup Wizard.

6. Review the license agreement. If you agree, select I Agree to continue.


INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

7. Select “Next” to accept the default components.

8. Select the shortcuts you would like to have created. Leave the file extensions
selected. Select Next to continue.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

9. Select Next to accept the default install location.

10. Select Next to install WinPcap.


INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

11. If you would like to capture USB traffic, install USBPcap as well.

12. Select Next to start the Setup Wizard.


INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

13. Select Install to proceed with the installation the requisite software WinPCap.
Please note that WinPcap is a mandatory software to ensure Wireshark Packet
Analyzer works properly.

14. Review the license agreement. If you agree, select I Agree to continue.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

15. Installation of WinPcap should start automatically one you agreed and selected
next.

16. Select Finish to complete the installation of WinPcap.


INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

17. Select Next to continue with the installation of Wireshark.

18. Select Finish to complete the installation of Wireshark. Once installed, you can
open the Wireshark and start monitoring network traffic.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 5

AIM: Installation of rootkits and study about the variety of options.

PROGRAM:
Breaking the term rootkit into the two component words, root and kit, is a useful way
to define it. Root is a UNIX/Linux term that's the equivalent of Administrator in
Windows. The word kit denotes programs that allow someone to obtain root/admin-
level access to the computer by executing the programs in the kit — all of which is
done without end-user consent or knowledge. A rootkit is a type of malicious software
that is activated each time your system boots up. Rootkits are difficult to detect
because they are activated before your system's Operating System has completely
booted up. A rootkit often allows the installation of hidden files, processes, hidden
user accounts, and more in the systems OS. Rootkits are able to intercept data from
terminals, network connections, and the keyboard. Rootkits have two primary
functions: remote command/control (back door) and software eavesdropping. Rootkits
allow someone, legitimate or otherwise, to administratively control a computer. This
means executing files, accessing logs, monitoring user activity, and even changing the
computer's configuration. Therefore, in the strictest sense, even versions of VNC are
rootkits. This surprises most people, as they consider rootkits to be solely malware,
but in of themselves they aren't malicious at all. The presence of a rootkit on a
network was first documented in the early 1990s. At that time, Sun and Linux
operating systems were the primary targets for a hacker looking to install a rootkit.
Today, rootkits are available for a number of operating systems, including Windows,
and are increasingly difficult to detect on any network.

PROCEDURE:
STEP-1: Download Rootkit Tool from GMER website www.gmer.net.
STEP-2: This displays the Processes, Modules, Services, Files, Registry, RootKit /
Malwares, Autostart, CMD of local host.
STEP-3: Select Processes menu and kill any unwanted process if any.
STEP-4: Modules menu displays the various system files like .sys, .dll
STEP-5: Services menu displays the complete services running with Autostart,
Enable,
Disable, System, Boot.
STEP-6: Files menu displays full files on Hard-Disk volumes.
STEP-7: Registry displays Hkey_Current_user and Hkey_Local_Machine.
STEP-8: Rootkits / Malwares scans the local drives selected.
STEP-9: Autostart displays the registry base Autostart applications.
STEP-10:CMD allows the user to interact with command line utilities or Registry
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

CODE OUTPUT:
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 6
AIM: Perform an Experiment to Sniff Traffic using ARP Poisoning.

PROGRAM:
we have used BetterCAP to perform ARP poisoning in LAN environment using
VMware workstation in which we have installed Kali Linux and Ettercap tool to sniff
the local traffic in LAN.
For this exercise, you would need the following tools −
• VMware workstation
• Kali Linux or Linux Operating system
• Ettercap Tool
• LAN connection
Note − This attack is possible in wired and wireless networks. You can perform this
attack in local LAN.
CODE OUTPUT:
Step 1 − Install the VMware workstation and install the Kali Linux operating system.
Step 2 − Login into the Kali Linux using username pass “root, toor”.
Step 3 − Make sure you are connected to local LAN and check the IP address by
typing the command ifconfig in the terminal.

Step 4 − Open up the terminal and type “Ettercap –G” to start the graphical version of
Ettercap.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

Step 5 − Now click the tab “sniff” in the menu bar and select “unified sniffing” and
click OK to select the interface. We are going to use “eth0” which means Ethernet
connection.

Step 6 − Now click the “hosts” tab in the menu bar and click “scan for hosts”. It will
start scanning the whole network for the alive hosts.
Step 7 − Next, click the “hosts” tab and select “hosts list” to see the number of hosts
available in the network. This list also includes the default gateway address. We have
to be careful when we select the targets.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

Step 8 − Now we have to choose the targets. In MITM, our target is the host machine,
and the route will be the router address to forward the traffic. In an MITM attack, the
attacker intercepts the network and sniffs the packets. So, we will add the victim as
“target 1” and the router address as “target 2.”
In VMware environment, the default gateway will always end with “2” because “1” is
assigned to the physical machine.
Step 9 − In this scenario, our target is “192.168.121.129” and the router is
“192.168.121.2”. So we will add target 1 as victim IP and target 2 as router IP.

Step 10 − Now click on “MITM” and click “ARP poisoning”. Thereafter, check the
option “Sniff remote connections” and click OK.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

Step 11 − Click “start” and select “start sniffing”. This will start ARP poisoning in the
network which means we have enabled our network card in “promiscuous mode” and
now the local traffic can be sniffed.
Note − We have allowed only HTTP sniffing with Ettercap, so don’t expect HTTPS
packets to be sniffed with this process.
Step 12 − Now it’s time to see the results; if our victim logged into some websites.
You can see the results in the toolbar of Ettercap.

This is how sniffing works. You must have understood how easy it is to get the HTTP
credentials just by enabling ARP poisoning.
ARP Poisoning has the potential to cause huge losses in company environments. This
is the place where ethical hackers are appointed to secure the networks.
Like ARP poisoning, there are other attacks such as MAC flooding, MAC spoofing,
DNS poisoning, ICMP poisoning, etc. that can cause significant loss to a network.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 7

AIM: Demonstrate intrusion detection system using any tool (snort or any
other s/w).

PROGRAM:
Intrusion detection is a set of techniques and methods that are used to detectsuspicious
activity both at the network and host level. Intrusion detection systems fall into two
basic categories:
• Signature-based intrusion detection systems
• Anomaly detection systems.
Intruders have signatures, like computer viruses, that can be detected using
software.You try to find data packets that contain any known intrusion-related
signatures or anomaliesrelated to Internet protocols. Based upon a set of signatures
and rules, the detection system isable to find and log suspicious activity and generate
alerts.
Anomaly-based intrusion detection usually depends on packet anomalies present in
protocol header parts. In some cases these methods produce better results compared
tosignature-based IDS. Usually an intrusion detection system captures data from the
networkand applies its rules to that data or detects anomalies in it. Snort is primarily a
rule-basedIDS, however input plug-ins are present to detect anomalies in protocol
headers.

SNORT TOOL:
Snort is based on libpcap (for library packet capture), a tool that is widely used
inTCP/IPtraffic sniffers and analyzers. Through protocolanalysis and content
searching andmatching, Snort detects attack methods, including denial of service,
buffer overflow, CGIattacks, stealthport scans, and SMB probes. When suspicious
behavior is detected, Snortsends a real-time alert to syslog, a separate 'alerts' file, or to
apop-up window.
Snort is currently the most popular free network intrusion detection software. The
advantages of Snort are numerous. According to the snort web site, “It can perform
protocol analysis, content searching/matching, and can be used to detect a variety of
attacks andprobes, such as buffer overflow, stealth port scans, CGI attacks, SMB
probes, OSfingerprinting attempts, and much more” (Caswell).
One of the advantages of Snort is its ease of configuration. Rules are very flexible,
easily written, and easily inserted into the rule base. If a new exploit or attack is found
a rulefor the attack can be added to the rule base in a matter of seconds. Another
advantage ofsnort is that it allows for raw packet data analysis.
STEP-1: Sniffer mode_ snort –v _ Print out the TCP/IP packets header on the screen.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

STEP-2: Snort –vd _ Show the TCP/IP ICMP header with application data in transit.

STEP-3: Packet Logger mode _ snort –dev –l c:\log [create this directory in the C
drive]and snort will automatically know to go into packet logger mode, it collects
every packet it sees and places it in log directory.

STEP-4: snort –dev –l c:\log –h ipaddress/24 _ This rule tells snort that you want to
printout the data link and TCP/IP headers as well as application data into the log
directory.

STEP-5: snort –l c:\log –b _ this binary mode logs everything into a single file.

STEP-6: Network Intrusion Detection System mode _ snort –d c:\log –h ipaddress/24


–csnort.conf _ This is a configuration file that applies rule to each packet to decide it
an action based upon the rule type in the file.

STEP-7: snort –d –h ip address/24 –l c:\log –c snort.conf _ This will configure snort


to runin its most basic NIDS form, logging packets that trigger rules specifies in the
snort.conf.

STEP-8: Download SNORT from snort.org. Install snort with or without database
support.

STEP-9: Select all the components and Click Next. Install and Close.

STEP-10: Skip the WinPcap driver installation.

STEP-11: Add the path variable in windows environment variable by selecting new
classpath.

STEP-12: Create a path variable and point it at snort.exe variable name _ path and
variablevalue _ c:\snort\bin.

STEP-13: Click OK button and then close all dialog boxes. Open command prompt
and typethe following commands:

CODE OUTPUT:
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

EXPERIMENT NO. 8

AIM: Demonstrate how to provide secure data storage, secure data transmission and
for creating digital signatures.

PROGRAM:

CREATING YOUR PUBLIC AND PRIVATE KEYS


GPG encryption and decryption is based upon the keys of the person who will be
receiving the encrypted file or message. Any individual who wants to send the person
an encrypted file or message must possess the recipient’s public key certificate to
encrypt the message. The recipient must have the associated private key, which is
different than the public key, to be able to decrypt the file. The public and private key
pair for an individual is usually generated by the individual on his or her computer
using the installed GPG program, called “Kleopatra” and the following procedure:

CODE OUTPUT:
1. From your start bar, select the “Kleopatra” icon to start the Kleopatra certificate
management software
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

2. The following screen will be displayed

3. From the “File” dropdown, click on the “New Certificate” option

4. The following screen will be displayed. Click on “Create a personal OpenGPG key
pair” and the “Next” button
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

5. The Certificate Creation Wizard will start and display the following:
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

6. Enter your name and e-mail address. You may also enter an optional comment.
Then,click the “Next” buttonReview your entered values. If OK, click the “Create
Key” button

7. Review your entered values. If OK, click the “Create Key” button
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

8. You will be asked to enter a passphrase

9. The passphrase should follow strong password standards. After you’ve entered your
passphrase, click the “OK” button.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

10. You will be asked to re-enter the passphrase

11. Re-enter the passphrase value. Then click the “OK” button. If the passphrases
match,the certificate will be created.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

12. Once the certificate is created, the following screen will be displayed. You cansave
abackup of your public and private keys by clicking the “Make a backup Of
YourKeyPair” button. This backup can be used to copy certificates onto other
authorized computers.

13. If you choose to backup your key pair, you will be presented with the following
screen:
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

14. Specify the folder and name the file. Then click the “OK” button.

15. After the key is exported, the following will be displayed. Click the “OK” button.
INSTITUTE OF ENGINEERING AND TECHNOLOGY
Mohanlal Sukhadia University, Udaipur
Name- Reeya Varanjani | Class- B.Tech-CSE (VII Sem) | Subject- Cyber-Security Lab

16. You will be returned to the “Key Pair Successfully Created” screen. Click the
“Finish” button.

17. Before the program closes, you will need to confirm that you want to close the
program by clicking on the “Quit Kleopatra” button

You might also like