M S Ramaiah Institute of Technology: Department of Computer Science and Engineering Bangalore
M S Ramaiah Institute of Technology: Department of Computer Science and Engineering Bangalore
Experiment Experiment
Number
1 Demonstration of CRYPTOOL (which covers all the algorithms)
2 RSA algorithm
9 vulnerability scanning-Nessus
EXPERIMENT NO 1
Aim: CRYPTOOL
CrypTool implements more than 300 algorithms. Users can adjust these with their own parameters.
The graphical interface, online documentation, analytic tools and algorithms of CrypTool introduce
users to the field of cryptography. Classical ciphers are available alongside asymmetric
cryptography including RSA, elliptic curve cryptography, digital signatures,homomorphic
encryption, and Diffie–Hellman key exchange, many of which are visualized by animations.
In this lab they need to demonstrate the following Algorithms.
● Triple DES with CBC mode and Weak DES keys
● Testing Different Modes in Symmetric Ciphers
● Implement DES and AES ciphers.
● Investigate Properties of Modes in DES and AES
● RSA Encryption and Factorization Attacks
● Attack on RSA encryption with short RSA modulus
● Short Message RSA Attacks and Padding
● RSA Timing Attacks
● Hash generation and sensitivity of hash functions to plaintext modifications
● Hash Function
● Digital Signature Visualization
● RSA Signature
● Attack on Digital Signature/Hash Collision
● Digital Signature
EXPERIMENT NO 2
Aim: To implement RSA algorithm to achieve confidentiality
Theory:
Public-key cryptography refers to a cryptographic system requiring two separate keys, one to lock
or encrypt the plaintext, and one to unlock or decrypt the ciphertext. Neither key will do both
functions. One of these keys is published or public and the other is kept private. If the
lock/encryption key is the one published then the system enables private communication from the
public to the unlocking key's owner. If the unlock/decryption key is the one published then the
system serves as a signature verifier of documents locked by the owner of the private key. This
cryptographic approach uses asymmetric key algorithms such as RSA, hence the more general name
of "asymmetric key cryptography". Some of these algorithms have the public key/private key
property; that is, neither key is derivable from knowledge of the other; not all asymmetric key
algorithms do. Those with this property are particularly useful and have been widely deployed, and
are the source of the commonly used name.
Although unrelated, the key pair is mathematically linked. The public key is used to transform a
message into an unreadable form, decryptable only by using the (different but matching) private key.
By publishing the public key, the key producer empowers anyone who gets a copy of the public key
to produce messages only s/he can read—because only the key producer has a copy of the private
key (required for decryption). When someone wants to send a secure message to the creator of those
keys, the sender encrypts it (i.e., transforms it into an unreadable form) using the intended recipient's
public key; to decrypt the message, the recipient uses the private key. No one else, including the
sender, can do so.
RSA
RSA involves a public key and a private key. The public key can be known to everyone and is used
for encrypting messages. Messages encrypted with the public key can only be decrypted using the
private key. The keys for the RSA algorithm are generated the following way:
Alice transmits her public key to Bob and keeps the private key secret. Bob then wishes
to send message M to Alice.
He first turns M into an integer m, such that by using an agreed-upon reversible
protocol known as a padding scheme. He then computes the ciphertext corresponding to
.
This can be done quickly using the method of exponentiation by squaring. Bob then
transmits to Alice.
Note that at least nine values of m will yield a cipher text c equal to m but this is very
unlikely to occur in practice.
Decryption
Alice can recover from by using her private key exponent via computing
.
Students are required to implement the logic in Turbo C++ or JAVA.
Java code:
import java.math.*;
import java.util.*;
int p, q, n, z, d = 0, e, i;
The features of public key cryptography and RSA logic are studied..
EXPERIMENT NO 3
Aim: To implement public key cryptography RSA to create digital signatures
Theory:
Public-key cryptography refers to a cryptographic system requiring two separate keys, one
to lock or encrypt the plaintext, and one to unlock or decrypt the ciphertext. Neither key will do both
functions. One of these keys is published or public and the other is kept private. If the
lock/encryption key is the one published then the system enables private communication from the
public to the unlocking key's owner. If the unlock/decryption key is the one published then the
system serves as a signature verifier of documents locked by the owner of the private key. This
cryptographic approach uses asymmetric key algorithms such as RSA, hence the more general name
of "asymmetric key cryptography". Some of these algorithms have the public key/private key
property; that is, neither key is derivable from knowledge of the other; not all asymmetric key
algorithms do. Those with this property are particularly useful and have been widely deployed, and
are the source of the commonly used name.
Although unrelated, the key pair is mathematically linked. The public key is used to transform a
message into an unreadable form, decryptable only by using the (different but matching) private key.
By publishing the public key, the key producer empowers anyone who gets a copy of the public key
to produce messages only s/he can read—because only the key producer has a copy of the private
key (required for decryption). When someone wants to send a secure message to the creator of those
keys, the sender encrypts it (i.e., transforms it into an unreadable form) using the intended recipient's
public key; to decrypt the message, the recipient uses the private key. No one else, including the
sender, can do so.
RSA
RSA involves a public key and a private key. The public key can be known to everyone and is used
for encrypting messages. Messages encrypted with the public key can only be decrypted using the
private key. The keys for the RSA algorithm are generated the following way:
Bob can verify the signature of Alice by decrypting the signed message using Alice’s public
key. Ce mod N
}
}
Conclusion:
The features of public key cryptography to create digital signatures are done.
EXPERIMENT NO 4
Aim: To implement Diffie Hellman Secret Key Exchange Algorithm.
Theory:
The Diffie Hellman key exchange algorithm uses asymmetric key principles for the distribution of
symmetric keys to both parties in a communication network. Key distribution is an important aspect
of conventional algorithms and the entire safety is dependent on the distribution of the key using a
secured channel. Diffie Hellman utilizes the public & private key of asymmetric key cryptography
to exchange the secret key.
Before going in depth of Diffie Hellman Algorithm,we define primitive root of a prime number 'p'
as one whose powers generate all the integers from 1 to p-1, i.e. if 'a' is the primitive root of a prime
no 'p', then,
a mod p , a2 mod p , a 3 mod p, ap-1 mod p generate all distinct integers from 1 to (p-1) in
some permutation.
It can be easily proved that the key K generated by this algorithm by both parties are the same.
Students are required to implement the logic in Turbo C++ or Java.
Java code:
public class GFG{
if (b == 1)
return a;
else
// Driver code
P = 23;
a = 4;
x = power(G, a, P);
b = 3;
y = power(G, b, P);
// of keys
}}
Conclusion:
Aim: Distribution of secret keys without and with key distribution center between two users
Theory:
Assumptions: A party named A wants to establish a secure communication link with another party B. Both
the parties A and B, respectively, possess master keys KA and KB , for communicating privately with a key
distribution center (KDC). The exchange of messages is shown graphically in Figure 1.1, followed by
details of the key distribution Protocol.
where E(., .) stands for encryption of the second-argument data block with a key
that is in the first argument.
● KDC responds to A with a message encrypted using the key KA. The various components of this
message are
FIG. 1.1: A most important element of this exchange is that the message (information)
that party A receives back from the Key Distribution Center can only be read by party B.
● A replay attack is a form of network attack in which a third party E eavesdrops on the
communications between A and B. Let us say that E intercepts the first-contact message that B
received from A. Now the question is: Would E be able to pose as B during a subsequent attempt by
A to initiate a session with B? Let us assume that E has somehow gotten hold of B′s master key KB
.
● The message sent by B back to A can be expressed as E(KS , N2) and A′s response back to B as
E(KS , N2+1).
EXPERIMENT NO 6
Aim: To study the Sniffing tool: Wireshark.
Theory:
Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting,
analysis, software and communications protocol development, and education. Wireshark is very
similar to tcpdump, but has a graphical front-end, plus some integrated sorting and filtering options.
Wireshark allows the user to put the network interfaces that support promiscuous mode into that
mode, in order to see all traffic visible on that interface, not just traffic addressed to one of the
interface's configured addresses and broadcast/multicast traffic. However, when capturing with a
packet analyzer in promiscuous mode on a port on a network switch, not all of the traffic traveling
through the switch will necessarily be sent to the port on which the capture is being done, so
capturing in promiscuous mode will not necessarily be sufficient to see all traffic on the
network. Port mirroring or various network taps extend capture to any point on the net; simple
passive taps are extremely resistant to malware tampering.
Students are required to capture packets using Wireshark and packets are analyzed.
Conclusion:
Wire shark tool as a packet analyser is studied.
EXPERIMENT NO 7
Aim: To study the NMap tool and familiarize with various options
Theory:
Nmap (Network Mapper) is a security scanner originally written by Gordon Lyon (also known by
his pseudonym Fyodor Vaskovich) used to discover hosts and services on a computer network, thus
creating a "map" of the network. To accomplish its goal, Nmap sends specially crafted packets to the
target host and then analyzes the responses. Unlike many simple port scanners that just send packets
at some predefined constant rate, Nmap accounts for the network conditions
(latency fluctuations, network congestion, the target interference with the scan) during the run. Also,
owing to the large and active user community providing feedback and contributing to its features,
Nmap has been able to extend its discovery capabilities beyond simply figuring out whether a host is
up or down and which ports are open and closed; it can determine the operating system of the target,
names and versions of the listening services, estimated uptime, type of device, and presence of
a firewall.
Nmap features include:
▪ Host Discovery – Identifying hosts on a network. For example, listing the hosts which
respond to pings or have a particular port open.
▪ Port Scanning – Enumerating the open ports on one or more target hosts.
▪ Version Detection – Interrogating listening network services listening on remote devices to
determine the application name and version number.
▪ OS Detection – Remotely determining the operating system and some hardware characteristics
of network devices.
Basic commands working in Nmap
▪ For target specifications: nmap <target’s URL or IP with spaces between them>
▪ For OS detection: nmap -O <target-host's URL or IP>
▪ For version detection: nmap -sV <target-host's URL or IP>
Conclusion:
Theory:
An intrusion detection system (IDS) is a device or software application that monitors network and/or
system activities for malicious activities or policy violations and produces reports to a Management
Station. Some systems may attempt to stop an intrusion attempt but this is neither required nor
expected of a monitoring system. Intrusion detection and prevention systems (IDPS) are primarily
focused on identifying possible incidents, logging information about them, and reporting attempts. In
addition, organizations use IDPSes for other purposes, such as identifying problems with security
policies, documenting existing threats, and deterring individuals from violating security
policies.ISSUes have become a necessary addition to the security infrastructure of nearly every
organization.
Snort:
Snort is a lightweight network intrusion detection system, capable of performing real-time traffic
analysis and packet logging on IP networks. It can perform protocol analysis, content
searching/matching and can be used to detect a variety of attacks and probes, such as buffer
overflows, stealth port scans, CGI attacks, SMB probes, OS fingerprinting attempts, and much more.
Conclusion: Various types of Intrusion detection systems are studied and as case study snort
features are studied.
EXPERIMENT NO: 9 -
Vulnerability Scanning Using
Nessus
Aim:
In this lab we will explore vulnerability scanning using an open source tool called Nessus. This tool
is already installed in your Linux VMware image. You will need to install the Windows client on
your Host O/S and then use it to scan your Windows Machine.
SOFTWARE REQUIREMENTS:
nessuswx-1.4.5d.zip
REFERENCES:
1. http://www.nessus.com (Nessus)
Procedure:
3. In the name field type the IP address of the Linux guest machine that is running the nessus server.
a. Username: root
b. Password: nessus
7. You will be prompted about a New Server Certificate, click the Accept & Save button.
10. Add a target(s). This could be the address of your Linux guest, Windows Host and/or
Windows host computer.
11. Click on the Plugins tab and check the “Use session-specific plugin set” checkbox.
17. Right click on the session icon that you created and select the Execute option.
19. After the scan has finished click the close button.
21. Save one of your reports to a pdf file and print it out to hand in with the lab.
REPORT
Nessus_Tutorial
Report generated by Nessus™ Sun, 09 Jan 2022 12:41:58 IST
TABLE OF CONTENTS
0 0 1 0 32
CRITICAL HIGH MEDIUM LOW INFO
Vulnerabilities Total: 33
SEVERIT CVSS PLUGIN NAME
Y V3.0
INFO N/A 12634 Authenticated Check : OS Name and Installed Package Enumeration
INFO N/A 12053 Host Fully Qualified Domain Name (FQDN) Resolution
INFO N/A 70544 SSL Cipher Block Chaining Cipher Suites Supported
INFO N/A 57041 SSL Perfect Forward Secrecy Cipher Suites Supported