100% found this document useful (1 vote)
160 views

Lab Manual

The document provides information about the RSA algorithm laboratory assignment for a computer engineering course. It includes: 1) An overview of the RSA algorithm and its key steps - key generation, encryption, and decryption. It describes using a public key for encryption and a private key for decryption. 2) The objectives and theory behind the RSA algorithm assignment, explaining public key cryptography and the essential steps of encryption and decryption. 3) Details of the RSA algorithm including key generation, selecting prime numbers p and q, calculating n and phi, and using e for encryption and d for decryption. 4) An example encryption is shown to calculate the ciphertext C from plaintext M using the public key e and

Uploaded by

PATIL AKASH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
160 views

Lab Manual

The document provides information about the RSA algorithm laboratory assignment for a computer engineering course. It includes: 1) An overview of the RSA algorithm and its key steps - key generation, encryption, and decryption. It describes using a public key for encryption and a private key for decryption. 2) The objectives and theory behind the RSA algorithm assignment, explaining public key cryptography and the essential steps of encryption and decryption. 3) Details of the RSA algorithm including key generation, selecting prime numbers p and q, calculating n and phi, and using e for encryption and d for decryption. 4) An example encryption is shown to calculate the ciphertext C from plaintext M using the public key e and

Uploaded by

PATIL AKASH
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 24

Marathwada Mitra Mandal’s

COLLEGE OF ENGINEERING
S. No. 18, Plot No. 5/3, Karvenagar, PUNE – 411 052
Tel: 020-25473160 Fax: 020-25470909
Website: www.mmcoe.edu.in

DEPARTMENT OF INFORMATION TECHNOLOGY


LABORATORY MANUAL

BE (INFORMATION TECHNOLOGY)
(SEMESTER – I)

COMPUTER LABORATORY-VII
2015 course

Teaching Scheme: Examination Scheme:


Practical: 2 hrs/week Term Work: 50 Marks
Practical : 50 Marks

Prepared By
Mrs. Preeti S. Joshi

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


List of Assignments

Assignment No. Name of Assignment

Part A:

Section -I

1. Write a program in C++ or Java to implement RSA algorithm for key generation
and cipher verification.

2. Develop and program in C++ or Java based on number theory such as Chinese
remainder.

3. Write a program in C++ or java to implement SHA1 algorithm using libraries (API)

4. Configure and demonstrate use of vulnerability assessment tool such as Snort tool
for intrusion or SSL Web security.

Section -II (Virtual Lab)

8. To understand how to convert a DES implementation to a triple-DES


implementation

PROGRAM OUTCOMES

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


The students in the Information Technology course will attain:

1. An ability to apply knowledge of computing, mathematics including discrete mathematics as


well as probability and statistics, science, and engineering and technology;
2. An ability to define a problem and provide a systematic solution with the help of conducting
experiments, as well as analyzing and interpreting the data;
3. An ability to design, implement, and evaluate a software or a software/hardware system,
component, or process to meet desired needs within realistic constraints;
4. An ability to identify, formulate, and provide systematic solutions to complex engineering
problems;
5. An ability to use the techniques, skills, and modern engineering technologies tools, standard
processes necessary for practice as a IT professional;
6. An ability to apply mathematical foundations, algorithmic principles, and computer science
theory in the modeling and design of computer-based systems with necessary constraints and
assumptions;
7. An ability to analyze the local and global impact of computing on individuals, organizations
and society;
8. An ability to understand professional, ethical, legal, security and social issues and
responsibilities;
9. An ability to function effectively as an individual or as a team member to accomplish a desired

COURSE OBJECTIVES:
1.To Understand
Marathwada the Security
Mitra Mandal’s issues
College in networks,Pune
of Engineering and Applications
52 software.
2. To understand the machine learning principles and analytics of learning algorithms.
COURSE OUTCOMES:

1. Understand basics of Information security and Use basic cryptography techniques in application
development and apply methods for authentication, access control, intrusion detection and
prevention.

2.To learn encryption standards and algorithms of symmetric and asymmetric encryption

3. To learn data integrity algorithms, web security requirements and to apply the scientific
method to digital forensics and perform forensic investigations.

4.To learn legal,ethical, and professional issues in information security and develop computer
forensics awareness

5. To understand cyberlaws, cyber crimes.

6. To use computer forensics tools.To implement and port controlled and secured access to
software systems, networks and to build learning software in various domains.

CO - PO MAPPING :

Program outcomes
Course
Outcome
1 2 3 4 5 6 7 8 9 10 11 12

414453.1 3 3 3 3 3 3 - - 2 - - 2

414453.2 3 3 3 3 3 3 - - 2 - - 2

414453.3 3 3 3 3 3 3 - - 2 - - 2

414453.4 - - - - - - 3 1 1 - - -

414453.5 - - - - - - 3 1 1 - - -

414453.6 3 3 3 3 3 3 - - 3 - - 1
Assignment & CO Mapping:

Assignment/ CO’s CO1 CO2 CO3

Assignment No. 1 X x

Assignment No. 2 X X

Assignment No. 3 X X

Assignment No. 4 X

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Assignment Number: 1

AIM: Write a program in C++ or Java to implement RSA algorithm for key generation and cipher
verification.

OBJECTIVE : To Study
 Concept of Public key and Private Key
 Public Key algorithm
 Working of RSA algorithm

THEORY :
Asymmetric/Public key Algorithm

This type of algorithm rely on one key for encryption and a different but related key for decryption.
These algorithms have the following important characteristic:
It is computationally infeasible to determine the decryption key given only knowledge of the
cryptographic algorithm and the encryption key.

In addition, some algorithms, such as RSA, also exhibit the following characteristic:
Either of the two related keys can be used for encryption, with the other used for decryption.

A public-key encryption scheme has six ingredients:


Plaintext: This is the readable message or data that is fed into the algorithm as input.

Encryption algorithm: The encryption algorithm performs various transformations on the plaintext.

Public and private keys: This is a pair of keys that have been selected so that if one is used for
encryption, the other is used for decryption. The exact transformations performed by the algorithm
depend on the public or private key that is provided as input.

Ciphertext: This is the scrambled message produced as output. It depends on the plaintext and the key.
For a given message, two different keys will produce two different ciphertexts. Decryption algorithm:
This algorithm accepts the ciphertext and the matching key and produces the original plaintext.

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


The essential steps are the following:
1. Each user generates a pair of keys to be used for the encryption and decryption of messages.

2. Each user places one of the two keys in a public register or other accessible file. This is the public
key. The companion key is kept private. Each user maintains a collection of public keys obtained from
others.

3. If B wishes to send a confidential message to A, B encrypts the message using A's public key.

4. When A receives the message, she decrypts it using her private key. No other recipient can decrypt
the message because only A knows A's private key.

RSA Algorithm
RSA(which stands for Ron Rivest, Adi Shamir, and Len Adelman),an algorithm for public- key
cryptography involves three steps key generation,encryption and decryption.The RSA scheme is a
block cipher in which the plaintext and ciphertext are integers between 0 and n − 1. A typical size of n
is 1024 bits, or 309 decimal digits. Thus, the plaintext is encrypted in blocks, with each block having a
binary value less than some number n. That is, the block size must be less than or equal to log2(n).
Encryption and decryption are of the following form, for some plaintext block M and ciphertext block
C:
C = Me mod n
M = Cd mod n
Both sender and receiver must know the value of n. The sender knows the value of e, and only the
receiver knows the value of d. Thus, this is a public-key encryption algorithm with a public key of PU
= {e, n} and a PR = {d, n}.

Algorithm
Marathwada Mitra Mandal’s College of Engineering ,Pune 52
1. Key Generation

1. Select p, q p and q both prime, p ! q


2. Calculate n = p *q
3. Calculate Φ(n) = (p – 1)(q – 1)
4. Select integer e ,such that gcd(Φ(n), e) = 1; 1 < e < Φ(n)
5. Calculate d = e-1 mod Φ(n)
6. Public key PU = {e, n}
7. Private key KR = {d, n}

2. Encryption
Plaintext: M < n
Ciphertext: C = Me (mod n)
3. Decryption
Ciphertext: C
Plaintext: M = Cd(mod n)

Example
Select primes p=11, q=3.

n=pq=11.3=33
Φ(n) = (p-1)(q-1) = 10.2 = 20

Choose e=3
Check gcd(e, p-1) = gcd(3, 10) = 1 (i.e. 3 and 10 have no common factors except 1),
and check gcd(e,q-1)=gcd(3,2)=1
therefore gcd(e, Φ(n)) = gcd(e, (p-1)(q-1)) = gcd(3, 20) = 1
compute d = e-1 mod Φ(n) = 3-1 mod 20
i.e. find a value for d such that Φ(n) divides (ed-1)
i.e. find d such that 20 divides 3d-1.
Simple testing (d = 1, 2,...) gives d = 7
Check: ed-1 = 3.7 - 1 = 20, which is divisible by Φ(n).

Public key = (n, e) = (33, 3)


Private key = (n, d) = (33, 7).

Now say we want to encrypt the message M = 7


C = Me mod n = 73 mod 33 = 343 mod 33 = 13.
Hence the ciphertext C= 13.

To check decryption we compute

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


M’= C d mod n = 137 mod 33 = 7.

Input: Select p & q large prime nos.


Information, which is to be, encrypt.
Output: Sending values of N and E.
Information encryption and decryption.

Conclusion: Thus RSA algorithm is used to implement asymmetric key cryptography and used to
solve the man-in-the-middle attack, which is drawback in Diffie-Hellman algorithm.

FAQs:

1. What are symmetric and asymmetric cipher


2. What are possible attacks on RSA
3. A wants to generate pair of RSA public key and private keys.she starts by selecting two
primes p=5,q=7 compute n, Φ(n)

Assignment Number: 2

AIM :Develop and program in C++ or Java based on number theory such as Chinese remainder

OBJECTIVE:
Marathwada Mitra Mandal’s College of Engineering ,Pune 52
To Study

 Chinese Remainder Theorem


 Set of residues
 Relatively prime numbers
 What is modulo multiplicative inverse of a number

THEORY:

Relative prime

Two integers are termed relative prime if the only common factor between them is 1. Any integer can
be broken down into certain multiples of prime numbers. this is called prime factorization. When you
prime factorize two integers and the only common number is 1,then the two integers are relative prime.

for ex.

18 = 2 x 3 x 3
35 = 7 x 5

so 18 and 35 are relative primes.

18 = 2 x 3 x 3
21 = 3 x 7

3 is common, so 18 and 21 are not relative prime.


Two integers are said to be relatively prime, or coprime if they share no common positive factor other
than 1

Set of Residues

It is a set of nonnegative integers less than n.

Zn=(0,1,2…………….(n-1)}

Chinese Remainder Theorem (CRT)

Let m1, m2, …, mk be pairwise relatively prime integers. That is, gcd(m i, mj) = 1 for 1£i<j £k. Let
aiÎZmi for 1£i £k and set M=m1m2…mk. Then there exists a unique A ÎZm such that Aºai mod mi for i
= 1…k.

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


A can be computed as:

Where

ci = M i �( M i-1 mod mi ) & M i = M / mi


for 1£i£k

Steps in Chinese Remainder Theorem

1. Find M=m1×m2×……mk.This is the common modulus


2. Find M1=M/m1,M2=M/m2………..Mk=M/mk.
3. Find the multiplicative inverse of M1,M2…….MK using the corresponding
moduli(m1,m2,………..mk).call the inverses asM1-1,M2-1,……….MK-1.
4. The solution to the simultaneous equation is

Example

Represent 973 in Z1813 as k-tuple

Answer:

 M=1813 =37*49,
 m1= 37, m2=49
 A=973
 A=(A mod m1,A mod m2)={11,42}

Solve x≡2 mod3

x≡3mod5

x≡2mod7

Answer

1. M = 3×5×7 = 105
2. M1=105/3=35,M2=105/5=21,M3=105/7=15
3. The inverse are M1-1=2, M2-1=1, M3-1=1,
4. X=(2×35×2+3×21×1+2×15×1) mod 105=23 mod 105
5. X=23

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


INPUT : Value of ai and mi

OUTPUT : Unique value of X

FAQs :

1.List some application of CRT.

2.What is set of residues

3.What is multiplicative inverse?

4.How to find unique integer which is represented by K tuple

Assignment Number: 3

AIM : Write a program in C++ or java to implement SHA1 algorithm using libraries (API)

OBJECTIVE:To implement and understand details of SHA-1.

THEORY :

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


The National Institute of Standard and Technology(NIST)along with the NSA developed the Secure Hash
Algorithm (SHA).SHA works with any input message that is less than 2 64 bits in length.The output of SHA-1 is a
messgae digest which is 160 bits in length. Following table shows SHA parameter.

The word secure in SHA was decided based on two features. SHAis designed to be computationally in
feasible to:

1. Obtain the original message, given its message digest and


2. Find two messages producing the same message digest.

Following are the important steps in execution of SHA

Step1 : Append padding bits

The input message is "padded" (extended) so that its length (in bits) equals to 448 mod 512.
Padding is always performed, even if the length of the message is already 448 mod 512.

Step2. Append length

A 64-bit representation of the length of the message is appended to the result of step1. If the
length of the message is greater than 2^64, only the low-order 64 bits will be used.The resulting
message (after padding with bits and with b) has a length that is an exact multiple of 512 bits.

Step3. Divide the input into 512 bit block

The input message is noe divided into blocks , each of length 512 bits.These blocks become the
input to the message digest processing logic.

Step4. Initialize MD buffer

A five -word buffer (A, B, C, D,E) is used to compute the message digest. Each of A, B, C, D
is a 32-bit register. These registers are initialized to the following values in hexadecimal, low-order
bytes first):

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


word A: 01 23 45 67
word B: 89 ab cd ef
word C: fe dc ba 98
word D: 76 54 32 10
word E: c3 d2 e1 f0

Step 5. Process Block

This process is divided into following sub steps

Step 5.1

Copy the chaining variables A-E into variables a-e. The combination of a-e called abcde will be
considered as a single register for storing the temporarily intermediate as well as the final result.

Step 5.2

Now divide the current 512 bit block into 16 sub block, each consisting of 32 bits.

Step 5.3

SHA has 4 rounds each consisting of 20 iteration . Ecah round takes the current 512 bit block,the
register abcde and a constant k[t] (where t=0 to 79) as three input s.It then update the content of the
register abcde using SHA algorithm steps.We have only four constants defined for K[t],one used in
each round.The value of K[t] are given in following table

Step 5.3

SHA consist of four rounds,each containing 20 iterations.this makes a total 80 iterations.The logical
operation of SHA-1 is shown in following fig.

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Mathematically iteration consist of following operation

abcde=(e+process P+s5(a)+W[t]+K[t]), a, s30(b), c, d

where

abcde =The register made up of five variables a, b, c, d, e

Process P= the logical operation, which is given in following table

St= Circular left shift of 32 bit sub block by 1 bits.

W[t] = A 32 bit value derived from current 32 bit sub block

K[t]= one of the constant defined earlier

Process p is given as

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Value of W[t] is calculated as follow

For the first 16 blocks of W(i.e. t=0 to 15) the contents of the input message sub block M[t]
become the content of W[t].Remaining valued are calculated as

Required Classes

1. Class MessageDigest(java.security. MessageDigest)

This MessageDigest class provides applications the functionality of a message digest


algorithm,such as MD5 or SHA -1. Message Digest are secure one-way hash functions
that take arbitrary sized data and output a fixed length hash value.

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


INPUT : Plaintext.

OUTPUT : Message Digest

Conclusion: We have implemented SHA-1 algorithm.

FAQs : 1.What are the Applications of SHA-1?


2.Why SHA-1 is more secure than MD5?
3.What is the usage of a cryptographic hash function?
4.What is one way hash function?

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Assignment Number: 4

AIM: Configure and demonstrate use of vulnerability assessment tool such as Snort tool for intrusion or SSL
Web security.

OBJECTIVES: Download vulnerability scanning tool. Generate the report for any sample network
ex. SNORT

Theory:
Intrusion Detection System Defined as the tools, methods, and resources to help identify, assess, and
report unauthorized or unapproved network activity.An IDS detects activity in traffic that may or may
not be an intrusion.
IDSes can detect and deal with insider attacks, as well as, external attacks, and are often very useful in
detecting violations of corporate security policy and other internal threats.

Components of Intrusion Detection System:


An Intrusion Detection system comprises of Management console and sensors. Management console is
the management and reporting console. Sensors are agents that monitor hosts or networks on a real
time basis. An Intrusion Detection System has a database of attack signatures. The attack signatures are
patterns of different types of previously detected attacks. If the sensors detect any malicious activity, it
matches the malicious packet against the attack signature database. In case it finds a match, the sensor
reports the malicious activity to the management console. The sensor can take different actions based
on how they are configured. For example, the sensor can reset the TCP connection by sending a TCP
FIN, modify the access control list on the gateway router or the firewall or send an email notification to
the administrator for appropriate action

Types of Intrusion-Detection systems


There are broadly two types of Intrusion Detection systems. These are host based Intrusion Detection
System and network based Intrusion Detection System. A Host based Intrusion Detection system has
only host based sensors and a network based Intrusion detection system has networkbased sensor
Host based Intrusion Detection System:
A host-based intrusion detection system (HIDS) is an intrusion detection system that monitors and
analyzes the internals of a computing system as well as (in some cases) the network packets on its
network interfaces
A host-based IDS monitors all or parts of the dynamic behavior and the state of a computer system.
Besides such activities as dynamically inspecting network packets targeted at this specific host
(optional component with most software solutions commercially available), a HIDS might detect which
program accesses what resources and discover that, for example, a word-processor has suddenly and
inexplicably started modifying the system password database. Similarly a HIDS might look at the state
Marathwada Mitra Mandal’s College of Engineering ,Pune 52
of a system, its stored information, whether in RAM, in the file system, log files or elsewhere; and
check that the contents of these appear as expected, e.g. have not been changed by intruders.

Fig:Host based IDS

Monitoring dynamic behavior

Many computer users have encountered tools that monitor dynamic system behaviour in the form of
anti-virus (AV) packages. While AV programs often also monitor system state, they do spend a lot of
their time looking at who is doing what inside a computer – and whether a given program should or
should not have access to particular system resources. The lines become blurred here, as many of the
tools overlap in functionality.
Intrusion prevention systems are a type of HIDS software that protects against buffer overflow attacks
on system memory and can enforce security policy.

Monitoring state

The principle operation of a HIDS depends on the fact that successful intruders (hackers) will generally
leave a trace of their activities. In fact, such intruders often want to own the computer they have
attacked, and will establish their "ownership" by installing software that will grant the intruders future
access to carry out whatever activity (keystroke logging, identity theft, spamming, botnet activity,
spyware-usage etc.) they envisage.In theory, a computer user has the ability to detect any such
modifications, and the HIDS attempts to do just that and reports its findings.
Ideally a HIDS works in conjunction with a NIDS, such that a HIDS finds anything that slips past the
NIDS. Commercially available software solutions often do correlate the findings from NIDS and HIDS
in order to find out about whether a network intruder has been successful or not at the targeted host.

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Most successful intruders, on entering a target machine, immediately apply best-practice security
techniques to secure the system which they have infiltrated, leaving only their own backdoor open, so
that other intruders can not take over their computers.

Technique

In general a HIDS uses a database (object-database) of system objects it should monitor – usually (but
not necessarily) file system objects. A HIDS could also check that appropriate regions of memory have
not been modified – for example, the system call table for Linux, and various vtable structures in
Microsoft Windows.
During the communication establishment phase and while transferring the data requested by the client,
the host's server and the client exchanges a passphrase to verify their identity. The server uses the same
passphrase all the time for this purpose. Based upon that an object is created.

For each object in question a HIDS will usually remember its attributes (permissions, size,
modifications dates) and create a checksum of some kind (an MD5, SHA1 hash or similar) for the
contents, if any. This information gets stored in a secure database for later comparison (checksum
database).

An alternate method to HIDS would be to provide NIDS type functionality at the network interface
(NIC) level of an end-point (either server, workstation or other end device). Providing HIDS at the
network layer has the advantage of providing more detailed logging of the source (IP address) of the
attack and attack details, such as packet data, neither of which a dynamic behavioral monitoring
approach could see.

Network Intrusion Detection System: -


identifies intrusions by examining network traffic and monitors multiple hosts. Network Intrusion
Detection Systems gain access to network traffic by connecting to a hub, network switch configured for
port mirroring, or network tap. An example
of a NIDS is Snort. Host-based Intrusion Detection System: -consists of an agent on a host which
identifies intrusions by analyzing system calls, application logs, file-system modifications (binaries,
password files, capability/acl databases) and other host activities and state.

Fig:NIDS

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Hybrid Intrusion Detection System: -
combines one or more approaches. Host agent data is combined with network information to form a
comprehensive view of the network. An example of a Hybrid IDS is Prelude.

Passive system v/s reactive system


In a passive system, the IDS sensor detects a potential security breach, logs the information and signals
an alert on the console. In a reactive system, which is known as an Intrusion Prevention System (IPS)
the IDS responds to the suspicious activity by resetting the connection it believes to be suspicious or by
reprogramming the firewall to block network traffic from the suspected malicious source, either
autonomously or at the command of an operator. Though they both relate to network security, an IDS
dif
fers from a firewall in that a firewall looks outwardly for intrusions in order to stop them from
happening. The firewall limits the access between networks in order to prevent intrusion and does not
signal an attack from inside the network. An IDS evaluates a suspected intrusion once it has taken
place and signals an alarm. An IDS also watches for attacks that originate from within a system

Fig: Passive system


Signature Based Detection v/s Anomaly Based Detection
Signature based detection:-

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


This detection technique uses specifically known patterns to detect malicious code. These specific
patterns are called signatures. Identifying the worms in the network is an example of signature based
detection.
Anomaly Detection:-
These techniques are designed to detect abnormal behavior in the system. The normal usage pattern is
baselined and alerts are generated when usage deviates from the normal behavior.
Example if a user logs on and off 20 times a day while thenormal behavior is 1-2 times.
Conclusion:
Thus we have studied Intrusion Detection system and its types.
FAQs:
1.What is Intrusion Detection System?
2.What are the different types of intrusion Detection System?
3.What is a Host Intrusion Detection System?
4.Why is intrusion detection required in today's computing environment?
5.Are there tools to visualize the data from an intrusion detection system?

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Assignment Number:5

AIM: To convert a DES implementation to a triple-DES implementation


OBJECTIVES: To understand the DES algorithm implementation
THEORY:

The Data Encryption Standard (DES) is a symmetric-key block cipher published by the National
Institute of Standards and Technology (NIST).

DES is an implementation of a Feistel Cipher. It uses 16 round Feistel structure. The block size is 64-
bit. 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). General Structure of
DES is depicted in the following illustration

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


3-KEY Triple DES

Before using 3TDES, user first generate and distribute a 3TDES key K, which consists of three
different DES keys K1, K2 and K3. This means that the actual 3TDES key has length 3×56 = 168 bits.
The encryption scheme is illustrated as follows −

The encryption-decryption process is as follows −

 Encrypt the plaintext blocks using single DES with key K1.

 Now decrypt the output of step 1 using single DES with key K2

Finally, encrypt the output of step 2 using single DES with key K 3.

 The output of step 3 is the ciphertext.

 Decryption of a ciphertext is a reverse process. User first decrypt using K3, then encrypt with
K2, and finally decrypt with K1.

Due to this design of Triple DES as an encrypt–decrypt–encrypt process, it is possible to use a 3TDES
(hardware) implementation for single DES by setting K1, K2, and K3 to be the same value. This
provides backwards compatibility with DES.

Second variant of Triple DES (2TDES) is identical to 3TDES except that K3is replaced by K1. In other
words, user encrypt plaintext blocks with key K1, then decrypt with key K2, and finally encrypt with K1
again. Therefore, 2TDES has a key length of 112 bits.

Triple DES systems are significantly more secure than single DES, but these are clearly a much slower
process than encryption using single DES.

Marathwada Mitra Mandal’s College of Engineering ,Pune 52


Steps on run algorithm on Vlab

Step 1: Generate Plaintext m, keyA and keyB by clicking on rexpective buttons PART I of the
simulation page.

Step 2: Enter generated Plaintext m from PART I to PART II in "Your text to be


encrypted/decrypted:" block.

Step 3: Enter generated keyA from PART I to PART II "Key to be used:" block and click on DES
encrpt button to output ciphertext c1.This is First Encryption.

Step 4: Enter generated ciphertext c1 from PART II "Output:" Block to PART II in "Your text to be
encrypted/decrypted:" block.

Step 5: Enter generated keyB from PART I to PART II in "Key to be used:" block and click on DES
decrypt button to output ciphertect c2.This is Second Encryption.

Step 6: Enter generated ciphertext c2 from PART II "Output:" block to PART II in "Your text to be
encrypted/decrypted:" block.

Step 7: Enter generated keyA from PART I to PART II "Key to be used:" block and click on DES
encrpt button to output ciphertext c3.This is Third Encryption. As Encryption is done thrice.This
Scheme is called triple DES.

Step 7: Enter generated ciphertext c3 from PART II "Output:" Block to PART III "Enter your answer
here:" block inorder to verify your Triple DES.

Conclusion:
Thus we have studied DES algorithm implementation.

FAQs:
1.What is DES?
2.What do you meant by triple DES?
3.Difference between DES and AES?

Marathwada Mitra Mandal’s College of Engineering ,Pune 52

You might also like