0% found this document useful (0 votes)
12 views16 pages

Security Lab Manual - Copy (1)

Uploaded by

sivadharshan n
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)
12 views16 pages

Security Lab Manual - Copy (1)

Uploaded by

sivadharshan n
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/ 16

***************************************************************

IMPLEMENTS THE FOLLOWING SUBSTITUTION &


TRANSPOSITION TECHNIQUES CONCEPTS:
a) CAESAR CIPHER
**************************************************************
AIM

To implement a program for encrypting a plain text and decrypting a cipher text
using Caesar Cipher (shift cipher) substitution technique.

ALGORITHM DESCRIPTION

1. It is a type of substitution cipher in which each letter in the plaintext is replaced by a


letter some fixed number of positions down the alphabet. For example, with a left
shift of 3, D would be replaced by A, E would become B, and so on.
2. The method is named after Julius Caesar, who used it in his private correspondence.
3. The transformation can be represented by aligning two alphabets; the cipher alphabet
is the plain alphabet rotated left or right by some number of positions.
4. The encryption can also be represented using modular arithmetic by first
transforming the letters into numbers, according to the scheme, A = 0, B = 1, Z = 25.
5. Encryption of a letter x by a shift n can be described mathematically as,
En(x) = (x + n) mod26
6. Decryption is performed similarly,

Dn (x)=(x - n) mod26
RESULT
Thus the program for implementation of Caesar cipher was executed and verified
successfully.
***************************************************************

b) PLAYFAIR CIPHER

***************************************************************
AIM

To implement a program to encrypt a plain text and decrypt a cipher text using play
fair Cipher substitution technique.

ALGORITHM DESCRIPTION

1. The Playfair cipher uses a 5 by 5 table containing a key word or phrase.


2. To generate the key table, first fill the spaces in the table with the letters of the
keyword, then fill the remaining spaces with the rest of the letters of the alphabet in
order (usually omitting "Q" to reduce the alphabet to fit; other versions put both "I"
and "J" in the same space).
3. The key can be written in the top rows of the table, from left to right, or in some
other pattern, such as a spiral beginning in the upper-left-hand corner and ending in
the centre.
4. The keyword together with the conventions for filling in the 5 by 5 table constitutes
the cipher key. To encrypt a message, one would break the message into diagrams
(groups of 2 letters) such that, for example, "HelloWorld" becomes "HE LL OW OR
LD", and map them out on the key table.
Then apply the following 4 rules, to each pair of letters in the plaintext:
a. If both letters are the same (or only one letter is left), add an "X" after the
first letter. Encrypt the new pair and continue. Some variants of Playfair use
"Q" instead of "X", but any letter, itself uncommon as a repeated pair, will
do.
b. If the letters appear on the same row of your table, replace them with the
letters to their immediate right respectively (wrapping around to the left side
of the row if a letter in the original pair was on the right side of the row).
c. If the letters appear on the same column of your table, replace them with the
letters immediately below respectively (wrapping around to the top side of
the column if a letter in the original pair was on the bottom side of the
column).
d. 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. The order is important – the first letter of the
encrypted pair is the one that lies on the same row as the first letter of the
plaintext pair.
5. To decrypt, use the INVERSE (opposite) of the last 3 rules, and the 1st as-is
(dropping any extra "X"s, or "Q"s that do not make sense in the final message when
finished).
RESULT
Thus the program for implementation of Playfair cipher was executed and verified
successfully.
***************************************************************
c) HILL CIPHER

***************************************************************
AIM

To implement a program to encrypt and decrypt using the Hill cipher substitution
technique

ALGORITHM DESCRIPTION

1. In Hill Cipher each letter is represented by a number modulo 26. To encrypt a


message, each block of n letters is multiplied by an invertible n × n matrix, again
modulus 26.
2. To decrypt the message, each block is multiplied by the inverse of the matrix used for
encryption. The matrix used for encryption is the cipher key, and it should be chosen
randomly from the set of invertible n × n matrices (modulo 26).
3. The cipher can, be adapted to an alphabet with any number of letters.
4. All arithmetic just needs to be done modulo the number of letters instead of modulo 26.

RESULT
Thus the program for implementation of Hill cipher was executed and verified
successfully.
***************************************************************

IMPLEMENT THE FOLLOWING ALGORITHMS

a)DES ALGORITHM
***************************************************************
AIM

Develop a program to implement Data Encryption Standard for encryption and


decryption.

ALGORITHM DESCRIPTION

1. The Data Encryption Standard (DES) is a symmetric-key block cipher published


by the National Institute of Standards and Technology (NIST).
2. DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure.
The block size is 64-bit.
3. Though, key length is 64-bit, DES has an effective key length of 56 bits, since 8
of the 64 bits of the key are not used by the encryption algorithm (function as
check bits only).

RESULT
Thus the program for implementation of DES Algorithm was executed and
verified successfully.
***************************************************************

b )RSA ALGORITHM

***************************************************************
AIM

Develop a program to implement RSA algorithm for encryption and decryption.

ALGORITHM DESCRIPTION

Generation of RSA Key Pair


1. Each person or a party who desires to participate in communication using
encryption needs to generate a pair of keys, namely public key and private
key.
2. The process followed in the generation of keys is described below −
3. Generate the RSA modulus (n)
a. Select two large primes, p and q.
b. Calculate n=p*q. For strong unbreakable encryption, let n be a large
number, typically a minimum of 512 bits.
4. Find Derived Number (e)
a. Number e must be greater than 1 and less than (p − 1)(q − 1).
b. There must be no common factor for e and (p − 1)(q − 1) except for 1.
In other words two numbers e and (p – 1)(q – 1) are coprime.
5. Form the public key

a. The pair of numbers (n, e) form the RSA public key and is made
public.
b. Interestingly, though n is part of the public key, difficulty in
factorizing a large prime number ensures that attacker cannot find in
finite time the two primes (p & q) used to obtain n. This is strength of
RSA.
6. Generate the private key
a. Private Key d is calculated from p, q, and e. For given n and e, there is
unique number d.
b. Number d is the inverse of e modulo (p - 1)(q – 1). This means that d is
the number less than (p - 1)(q - 1) such that when multiplied by e, it is
equal to 1 modulo (p - 1)(q - 1).
7. This relationship is written mathematically as follows ed = 1 mod (p − 1)(q −
1)
8. The Extended Euclidean Algorithm takes p, q, and e as input and gives d as
output.
RESULT
Thus the program for implementation of RSA Algorithm was executed and verified
successfully.
***************************************************************

c) DIFFIE HELLMEN ALGORITHM

***************************************************************
AIM

Develop a program to implement Diffie Hellman Key Exchange Algorithm for


encryption and Decryption.

ALGORITHM DESCRIPTION

1. Diffie–Hellman key exchange (D–H) is a specific method of securely


exchanging cryptographic keys over a public channel and was one of the first
public-key protocols. T
2. he Diffie–Hellman key exchange method allows two parties that have no prior
knowledge of each other to jointly establish a shared secret key over an insecure
channel.
3. This key can then be used to encrypt subsequent communications using a
symmetric key cipher.

RESULT
Thus the program for implementation Diffiee Hellman Algorithm was executed and
verified successfully.
***************************************************************
IMPLEMENT THE SIGNATURE SCHEME –
DIGITAL SIGNATURE STANDARD
***************************************************************

AIM

To write a program to implement the digital signature scheme in java

ALGORITHM

1. Prepare initial program structure.


2. Generate public and private key for verifying the signature.
3. Sign the data and generate the signature
4. Save the signature bytes in one file and the public key bytes in another file
5. Compile and run the program.

RESULT
Thus the program for implementation Digital Signature scheme was executed and
verified successfully.
***************************************************************
DEMONSTRATE HOW TO PROVIDE SECURE DATA STORAGE,
SECURE DATA TRANSMISSION AND FOR CREATING DIGITAL
SIGNATURES (GnuPG)
***************************************************************

AIM

To demonstrate how to provide secure data storage, secure data transmission and for
creating digital signatures (GnuPG).

RESULT
Thus the program for installation of GnuPG was executed and verified successfully.
***************************************************************
SETUP A HONEY POT AND MONITOR THE HONEY POT ON
NETWORK (KF SENSOR)
***************************************************************

AIM
To setup a honey pot and monitor the honey pot on network (KF sensor)

DESCRIPTION
Honey Pot is a device placed on Computer Network specifically designed to capture
malicious network traffic. KF Sensor is the tool to setup as honey pot when KF Sensor is
running it places a siren icon in the windows system tray in the bottom right of the screen. If
there are no alerts then green icon is displayed.

STEPS
1. Install winpcap library (mandatory for kfsensor)
2. Download kfsensor and install.
3. Then restart your pc. Configure properly no change needs to do now go to setting
option and configure according to your attack.
4. Now go to your home screen of kf sensor
5. You will get some logs about clients. And it will start working
KFSensor
 Windows based honey pot known as KF Sensor
 It detects an incoming attack or port scanning and reports it to you
 A machine running KFSensor can be treated as just another server on the
network, without the need to make complex changes to routers and firewalls.

How KFSensor Works?


 KFSensor is an Intrusion Detection System.
 It performs by opening ports on the machine it is installed on and waiting for
connections to be made to those ports.
 By doing this it sets up a target, or a honeypot server, that will record the actions
of a hacker.

Components: KFSensor server


 KFSensor Server- Performs core functionality
 It listens to both TCP and UDP ports on the server machine and interacts with
visitors and generates events.
 A daemon that runs at the background (like Unix daemon)
Components: KFSensor Monitor
 Interprets all the data and alerts captured by server in graphical form.
 Using it you can configure the KFSensor Server and monitor the events generated
by the KFSensor Server.

Sim Server
 Sim server is short for simulated server.
 It is a definition of how KFSensor should emulate real server software.
 There is no limit to the number of Sim Servers that can be defined.
 There are two types of Sim Server available; the Sim Banner and the Sim
Standard Server.

Setting Up a HoneyPot
 You can get educational License from Keyfocus.
 Install WinPCap
– A industry standard network packet capturing library
 Install KFSensor

KFSensor Monitor
TerminologyVisitor
A visitor is an entity that connects to KFSensor.
• Visitors could be hackers, worms, viruses or even legitimate users that have
stumbled onto KFSensor by mistake.
• Visitors can also be referred to as the clients of the services provided by
KFSensor.

Event
• An event is a record of an incident detected by the KFSensor Service.
• For example if a visitor attempts to connect to the simulated web server then
an event detailing the connection is generated.
• Events are recorded in the log file and displayed in the KFSensor monitor.

Editing Scenario

Terminology-Rules
 KFSensor is rules based.
 All of the data that was produced was the result of KFSensor detecting certain types
of activity and then using a rule to determine what type of action should be taken.
 We can easily modify the existing rules or add your own.

Edit Active Scenario


 To create or modify rules,
– Scenario menu ->select the Edit Active Scenario command ->you will see a
dialog box which contains a summary of all of the existing rules.
– either select a rule and click the Edit button to edit a rule, or you can click
the Add button to create a new rule.

Adding a rule
 Click the Add button and you will see the Add Listen dialog box.
– `The first thing that this dialog box asks for is a name. This is just a
name for the rule.
– Pick something descriptive though, because the name that you enter is
what will show up in the logs whenever the rule is triggered.

Installing KFSensor
1. Download and install winpcap
2.Download and install KFSensor
3. Enable Telnet client, server, Internet Information server in
Control Panel-> Programs-> Turn windows features on/off
 Check Telnet client, Telnet server, IIS-> FTP (both options),

Convert to Native Service


1. Convert the stroked off services as native services.
 Select Scenario ->Edit Active Scenario
 choose the respective service listed in the dialog box opened and press convert to
native button and ok.
Setting up Server
1. To start the server
 Settings-> Set Up Wizard
 Go through the wizard, give fictitious mail ids when they are asked and
start the server running by pressing the finish button.
2. Kfsensor now start showing the captured information in its window.

FTP Emulation
1. Open command prompt
2. Type
FTP IP address
Enter user name anonymous
Enter any password
Get any file name with path
3. Monitor this ftp access in KFSensor monitor
4. Right click KFSensor entry, select Event details, see the details captured by the
server
5. Create visitor rule by right clicking the FTP entry and check either ignore / close
under actions in the dialog box that opened.
6. Now redo the above said operations at the command prompt and see how the
emulation behaves.
7. You can see/ modify the created rules in Scenario->edit active visitor rules.
SMTP Emulation
1. open command prompt
2. Type
telnet ipaddress 25
Helo
Mail from:<mail-id>
Rcpt to:<mail-id>
Data
type contents of mail end that with . in new line
3. Check the kfsensor for the captured information.

IIS emulation
1. Create an index.html, store it in c:\keyfocus\kfsensor\files\iis7\wwwroot
2. Select scenario->edit simserver
1. Choose iis and edit
2. Make sure index.html is in first place in the listed htm files in the dialog box.
3. Check the kfsensor for the captured information.
DOS attack
1. Settings-> DOS attack settings modify (reduce) values in general tab, ICMP and
other tabs. Press ok.
2. Open command prompt and type

Ping ipaddress –t
or
Ping –l 65000 ipaddress –t
1. Check the kfsensor for the DOS attack alerts, open event details in right click
menu for further details.

RESULT
Thus the program for installation of KF Sensor to monitor the honeypot was
executed and verified successfully.
***************************************************************
PERFORM WIRELESS AUDIT ON AN ACCESS POINT OR A
ROUTER AND DECRYPT WEP AND WPA ( NET STUMBLER)
***************************************************************
AIM
To perform wireless audit on an access point or a router and decrypt WEP and
WPA( Net Stumbler).

DESCRIPTION
NetStumbler (also known as Network Stumbler) aircrack on ubuntu is a tool for
windows that facilitates detection of Wireless LANs using the 802.11b, 802.11a and
802.11g WLAN standards. It is one of the Wi-Fi hacking tool which only compatible with
windows; this tool also a freeware. With this program, we can search for wireless network
which open and infiltrate the network. It’s having some compatibility and network adapter
issues.

RESULT
Thus the program for installation of Net-Stumbler was executed and
verified successfully.

You might also like