0% found this document useful (0 votes)
127 views46 pages

An Innovative DNA Cryptography Technique For Secure Data Transmission

The document summarizes research on encryption techniques for securing data transmission. It discusses Blowfish and AES algorithms, with AES providing stronger security but being slower. It also covers symmetric and asymmetric key encryption methods. Literature reviewed includes research on using chaotic maps to improve security of S-DES, an improved DES algorithm for encrypting images faster and with higher quality, and modifying MD5 hashing to incorporate another function for stronger security. The goal is to identify techniques that offer both security and performance for applications like encrypted messaging.

Uploaded by

dev
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)
127 views46 pages

An Innovative DNA Cryptography Technique For Secure Data Transmission

The document summarizes research on encryption techniques for securing data transmission. It discusses Blowfish and AES algorithms, with AES providing stronger security but being slower. It also covers symmetric and asymmetric key encryption methods. Literature reviewed includes research on using chaotic maps to improve security of S-DES, an improved DES algorithm for encrypting images faster and with higher quality, and modifying MD5 hashing to incorporate another function for stronger security. The goal is to identify techniques that offer both security and performance for applications like encrypted messaging.

Uploaded by

dev
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/ 46

An Innovative DNA Cryptography Technique

for Secure
Data Transmission
THIRD REVIEW REPORT
Submitted by

Prema Anirudh (17BCI0169)


Rohit Raj (17BCI0016)
Devang Pirta(17BCI0125)

Prepared For

SECURITY OF E-BASED SYSTEMS (BCI3004) – PROJECT COMPONENT

Submitted To

Dr. Dilip Kumar Choubey


Assistant Professor (Senior)

School of Computer Science and Engineering


Abstract
With the rapid growing of internet and networks applications, data security becomes more important
than ever before. Encryption algorithms play a crucial role in information security systems. In this
paper, we have a study of the two popular encryption algorithms: DES and Blowfish. We overviewed
the base functions and analyzed the security for both algorithms. We also evaluated performance in
execution speed based on different memory sizes and compared them. The experimental results show
the relationship between function run speed and memory size.

Introduction
BLOWFISH
Blowfish is a symmetric block cipher that can be used as a drop-in replacement for DES or IDEA. It
takes a variable-length key, from 32 bits to 448 bits, making it ideal for both domestic and exportable
use. Blowfish was designed in 1993 by Bruce Schneier as a fast, free alternative to existing encryption
algorithms. Since then it has been analyzed considerably, and it is slowly gaining acceptance as a strong
encryption algorithm. Blowfish is unpatented and license-free, and is available free for all uses.
The disadvantages of Blowfish are it must get key to the person out of band specifically not through the
unsecured transmission channel. Each pair of users needs a unique, so as number of users increase, key
management becomes complicated. For example N(N-1)/2 keys required. Blowfish can’t provide
authentication and non-repudiation as two people have same key. It also has weakness in decryption
process over other algorithms in terms of time consumption and serially in throughput.
Many cryptographers have examined Blowfish, although there are few published results. Serge
Vaudenay examined weak keys in Blowfish; there is a class of keys that can be detected--although not
broken--in Blowfish variants of 14 rounds or less. Vincent Rijmen's Ph.D. thesis includes a second-
order differential attack on 4-round Blowfish that cannot be extended to more rounds.
Figure 3: Performance of BLOWFISH Algorithm
Amongst the three, DES, AES and blowfish, AES provides the maximum security while taking longer
than the other two. AES shows an entropy of 6 for the given input text whereas the other two are around
4. The blowfish algorithm takes the least amount of time as seen in the screenshots above. We thus
chose to continue with the AES algorithm for the chat application.

Symmetric keys Encryption


Symmetric keys encryption only uses one key to encrypt and decrypt data. The key should be
distributed before transmission between entities. Keys play a very important role because if weak key is
used in algorithm then everyone may decrypt the data. Strength of Symmetric key encryption depends
on the size of used key. For the same algorithm, encryption using longer key is harder to break than the
one done using smaller key. There are many examples of strong and weak keys of cryptography
algorithms like RC2, DES, 3DES, RC6, Blowfish, and AES. RC2 and DES use one 64-bit key. Triple
DES (3DES) uses three 64-bits keys while AES uses various (128,192,256) bits keys. Blowfish uses
various (32-448) key. RC6 uses various (128,192,256) bit keys where default is 128 bits [1-3].

Asymmetric key encryption


Asymmetric key encryption is used to solve the problem of key distribution. In Asymmetric keys, two
keys are used: private and public keys. Public key is used for encryption and private key is used for
decryption (E.g. RSA and Digital
Signatures). Public key is known to the public while private key is known only to the user. There is no
need for distributing them prior to transmission. However, public key encryption is based on
mathematical functions, computationally intensive and is not very efficient for small mobile devices
such as cell phone, PDA, and so on. In some occasion, legal, commercial, and other documents need to
be signed. Accordingly, various schemes have been devised for digital signatures, using both private-
key and public-key algorithms.

Literature Review:

1. Research of Image Encryption Algorithm Based on S-DES

This paper mainly studies one kind of simple image encryption algorithm which can help
general users to keep secret from the data information. The algorithm is modified from the
DES whose processing may be divided into three steps: initial transform IP, 16 round
iterations, and initial inversed transforms IP-1. Initial transformation and inverse
transformation can enhance difficulty to be understood for data, and not to affect security of
data. Modified encrypted algorithm, namely S-DES, carries on two round iterative
encryptions to clear text. The length of block and secret key reduced. Therefore S-DES
algorithm is more inexpensive than the DES encryption algorithm and remains many merits
of DES. Objectives: a) Secure image encryption using SDES b) Using simple 2 rounds to
make it less complicated
2. Image encryption algorithm based on chaotic map and S-DES

The initial sensitivity of chaotic map makes its application more and more widely. The image
encryption algorithm based on chaotic theory is a hot researching field recently. Confusion and
diffusion are necessary methods to realize the image encryption. However, using the initial
sensitivity and randomness of chaotic map can realize the purpose of confusion and diffusion.
S-DES system can encrypt the input binary flow of image, but the fixed system structure and
few keys will still bring some risks. However, the sensitivity of initial value that Lu chaotic map
can be well applied to the system of SDES, which makes S-DES have larger random and key
quantities. A dual image encryption algorithm based on S-DES and Lu map is proposed.
Compared to traditional methods, it has some merits such as easy to understand, rapid encryption
speed, large keys and sensitivity to initial value. Objectives: a) Using chaotic map to make SDES
more secure b) Increasing encryption speed c) Making it easy to understand

3. Digital image encryption algorithm based on chaos and improved DES

In recent years, encryption technology has been developed quickly and many image encryption
methods have been put forward. Chaos based image encryption technique is a new encryption
technique for images. It utilizes chaos random sequence to encrypt image, which is an efficient
way to deal with the intractable problem of fast and highly secure image encryption. However,
the Chaos based image encryption technique has some deficiencies, such as the limited accuracy
problem. This paper researches on the chaotic encryption, DES encryption and a combination
of image encryption algorithm, and simulate these algorithms, through analysis of the algorithm
to find the gaps. And on this basis, the algorithm has been improved. The new encryption scheme
realizes the digital image encryption through the chaos and improving DES. Firstly, new
encryption scheme uses the Logistic chaos sequencer to make the pseudo-random sequence,
carries on the RGB with this sequence to the image chaotically, then makes double time
encryptions with improvement DES, displays they respective merit. Theoretical analysis and the
simulation indicate that this plan has the high starting value sensitivity, and enjoys high security
and the encryption speed. In addition, it also keeps the neighbouring RGB relevance close to
zero. The algorithm can be used in the actual image encryption. Objectives: a) Using improved
DES to increase quality of encryption b) Increasing encryption speed

4. AES cryptography in colour image steganography by genetic algorithms

This work incorporates the AES cryptography algorithm, to improve the hidden data security in
two methodologies for steganography: the genetic algorithm and path relinking. It also combines
them proposing a new hybrid approach that outperforms the LSB (least significant bits)
substitution technique presented in works cited in the literature concerning the quality of a stego
image. It improves the possibility of hiding data inside colour images significantly, increasing
the space available for information by more than three times when compared to the usual
steganography approach used by grayscale images. Moreover, all types of digital information
from text and compressed files to even executable programs can be hidden inside the cover
image. This considerably increases the scope of application of the technique for transmitting
information inside a typical image, hiding the data from intruders. Objectives: a) Using AES to
secure images b) Changing LSB to use stegonography

5. A Modified MD5 Algorithm Incorporating Hirose Compression Function

Hashing is the widely used method in cryptographic protocols and the data integrity check.
Among the most utilized cryptographic hashing functions is the MD5 for a variety of
applications. However, the strength of MD5 against brute force attack is produced by the
algorithm that deals with security flaws and vulnerabilities. This study presents the modification
of the round functions of the MD5 with a novelty on incorporating the Hirose function.
Simulation of the proposed algorithm was conducted using PHP. Experiment results showed
that the modified MD5 algorithm produced more secure hashed output. Through several tests
like avalanche test and differential attack test, the simulation result showed the superiority of
the modified algorithm over the typical algorithm. For the proof of the concept, the study used
the flipped 17th bit. The experimentation result of the avalanche effect of the typical MD5 versus
modified MD5, the former has 58.38 hamming distance and has 42.71% avalanche effect while
the latter has 67.38 hamming distance and 52.86% avalanche effect. Thus, the test results for the
Modified MD5 has a greater percentage than the Typical Modified with an evident increase of
10.15%. Objectives: a) Using hirose compression function to make Md5 faster b) To make Md5
more efficient hashing method

6. Implementation of hybrid cryptosystems using DES and Md5

Cryptographic techniques offer authenticity, Integrity and secrecy during data transmission. In
this paper, a hybrid cryptosystem, which uses both symmetric crypto algorithm and hashing
techniques, is proposed. The hash value of message is calculated using MD5 algorithm. The
same message is encrypted using double DES algorithm using secret keys. The ciphertext
produced from double DES and hash value are combined and transmitted. At the receiver side,
the ciphertext is separated from hash value and decrypted to get original message. The hash
value of decrypted message is calculated at receiver side also using MD5 algorithm. This hash
value is compared with hash value received from sender to check data integrity. Objectives: a)
using both the encryption standards to make it secure b) Increasing the efficiency

7. Secured IOT through hashing Md5

With the boom of Internet of Things, the embedded devices are being able to connect to the
internet and intercommunicate with each other. Internets of Things find many applications in
various fields but the emergence of IoT have put the embedded device communication and
interaction at risk. There are various security conditions that need to be satisfied to be able to
securely connect the embedded device to the internet. MD5 is a hashing algorithm which outputs
a message digest which is of fixed length derived from an input of arbitrary length. It has various
features that can be used to satisfy the security concern in IoT. The system is proposed to allow
the use of MD5 for securing the embedded device from attacks when connected to the internet
to become a part of the Internet of Things. A prologue to the embedded system and Internet of
Things has been given. The various features that a security algorithm needs to fulfil have been
discussed. By keeping this as the base, the proposed system's compatibility and fulfilment with
the required features was checked and the final conclusion of using MD5 in Embedded System
for securing IoT was arrived. Objectives: a) Securing IoT protocols using Md5 b) Using faster
methods to do so

8. To enhance consumer privacy and security for online shopping using MD5 algorithm

Online shopping is one of the biggest concerns now a day's which helps the user to feel easier
to shop anything from their home. It makes it feel easier as it provides variety of product at an
affordable price to the customers. Not only that customer can compare the features, lifetime of
the product, various brand products with the picture of that product that is customer can select
the product just by visiting the website of such online shopping where the entire details of the
product are revealed in front of the customer when they search and the bills can be paid in online
itself. Although it has various advantages over shopping it has a primary defect which happens
in all transaction process that is robbing the individual details of the customer like bank account
number, password and so on while transacting the money. In order to secure data from such theft
in this paper we have introduced an idea of using MD5 algorithm at the server to encrypt the
original data before transition and secure the personal information. Objectives: a) Enhancing the
system using Md5 b) Encrypting the hash data

9. Secure IOT System Based on Chaos-Modified Lightweight AES

The increasing The Internet of Things objects and entities in the famous applications causes a
needing to provide a unique and secure identifier with ability to protected data transferring
through the network. Secure IoT communication becomes more urgent issue for important IOT
entities that content computing-devices and embeddedsensor subsystems used in unofficial
industrial machine to machine (M2M) communications, smart energy-grids, home or buildings
and other computing devices. In this paper we proposed a secure system by using chaotic system
combinate with the modified lightweight AES. The 5-D chaos system (hybrid from logistic and
Lorenz chaotic system) was used to generate the sequences chaos keys used in the lightweight
AES and SHAKE128. The Lightweight AES was modified to reduce the processing complexity
of AES with decreased the processing time (have 145% speed more). The output of modified
lightweight AES encryption System has the good statistical tests near to original AES that can
avoid many attacks. Objectives: a) Using lightweight AES to make the process faster b) Securing
Iot Protocols

10. Research on Data Encryption Standard Based on AES Algorithm in Internet of Things
Environment

The Internet of Things makes it possible to exchange information between people, things and
things, people and things, and makes information security more and more important. However,
there are few standards in the field of information security of the Internet of Things. Therefore,
based on the characteristics and application requirements of the Internet of Things environment,
this paper optimizes the Advanced Encryption Standard (AES) and builds the data encryption
standard DESI (Data Encryption Standard in IoT) in the Internet of Things environment. The
analysis shows that DESI has better security and is therefore suitable for encrypting data in the
IoT environment. Keywords: Internet of Things, encryption standard, AES, DESI, information
security. Objectives: a) Using a modified Algorithm to increase the encryption efficiency

11. Web Authentication Security Using Image Steganography and AES Encryption

In this paper we present Web based highly secure Authentication Security system that uses
Image Steganography and 128-bit Advanced Encryption Standard algorithm. Our developed
web authentication system encrypts user passwords with an AES encryption that takes octillion
years to decrypt and is coupled with face identification photograph which is used as a
stegoimage to hide the encrypted password for more robust security. When put to test our Web
Authentication Security systems shows positive results which outstand advanced stega-analysis
attacks such as the chi-squared attack and neighbourhood histogram. We recommend this
security for prospective web applications of the future that will be handling sensitive user
information. Objectives: a) Encrypting pwd using AES 128 b) Hiding important data in images
using steganography

12. Fuzzy Logic for Performance Analysis of AES and Lightweight AES

The Internet of Things is being more and more adopted for applications in almost every
application of today’s business. The ability to integrate the features of the web to the features of
Internet of Things systems has led to more flexibility in managing data from almost any location
and almost any device platform. The need to secure the exchanged data has made users have
some hesitation towards comfortably adopting these technologies, so developers enhanced
security measures through encryption, and creating some "lightweight" version of efficient
cryptosystems. Having a decision system that guides the user on the best version of a ciphering
algorithm means having a more efficient IoT based secured system. The proposed system uses
fuzzy logic to provide indications to which variation of the algorithm to use for the exchanges
messages, with certainty levels that would assist the user in choosing the most suitable ciphering
algorithm. Objectives: a) Using multiple shades of truth, not using Boolean b) Comparing
lightweight AES with AES

13. Cipher with AES

After the DES (Data Encryption Standard) algorithm was unreliable, a content was held in
September 1997 by the US National Institute of Standards and Technology (NIST) to designate
a cryptographic algorithm for national civilian use. After four years of evaluation and
elimination, the results were announced in October 2000 and announced to be used as the
Advanced Encryption Standard (AES) of the Rijndael Algorithm, designed by NIST, Joan
Daemen and Vincent Rijmen. The relevant standard was announced by the US National Institute
of Standards and Technology (NIST) in November 2001 with the US FIBS PUB 197 coded
document. In this study, the encryption process is investigated with 128-bit Rjindael Algorithm
which is determined as AES. Objectives: a) Looking at the importance of AES cipher b) How
to implement AES

14. RSA – Based handshake protocol in IOT Potential security vulnerabilities exist in network
layer under the environment of Internet of Things (IoT).

Attacks could jeopardize the commutation between devices if an encryption algorithm is not
applied. In order to address this issue, we design an RSA based handshake protocol which
implements a secure communication interface in the network layer. In such case, both the
controller and device can verify the other’s identity and a new session key is generated for
subsequent communication. However, several experiments indicate that this protocol costs
substantial time to process with RSA. The evaluation results show that several improvements
should be completed in the algorithm. Objectives: a) Using RSA to secure the protocol
handshaking

15. Speed up RSA’s Decryption Process with Large sub Exponents using Improved CRT

The aim of this paper is to present the improvement of Chinese Remainder Theorem (CRT) to
speed up RSA’s decryption process by changing sub exponents and transforming ciphertext in
another domain. Although applying CRT with RSA, called CRT-RSA, can be chosen to
decrease time in decryption side, computing modular exponentiation still consumes enormous
time whenever sub exponents are large. In addition, the proposed method suits to apply with
high sub exponents of CRT-RSA because the new sub exponents are smaller. On the other hand,
both of them become larger when CRT-RSA’s exponents are small. Therefore, the proposed
method cannot be chosen to replace CRT-RSA but it is one of two choices for the
implementation. If sub exponents are small, CRTRSA is a better choice to speed up RSA’s
decryption. Nevertheless, the proposed method should be selected when sub exponents are large.
The experimental results show that the proposed method can finish the process faster than CRT-
RSA for both of key generation process and decryption process whenever sub exponents are
large. Furthermore, in decryption side, the proposed method is faster than CRT-RSA about 20
– 40%. Objectives: a) Using CRT improving the decryption speed of RSA algorithm b)
Inculcating CRT in RSA

ENCRYPTION ALGORITHM ANALYSIS

In this section, we have an overview and cryptanalysis for both DES and Blowfish algorithms.

DES Algorithm DES (Data Encryption Standard) was the first encryption standard to be
recommended by NIST (National Institute of Standards and Technology). It was developed by
an IBM team around 1974 and adopted as a national standard in 1997.

The flow of DES algorithm is shown in Fig.1. DES is a 64bit block cipher under 56-bit key. The
algorithm processes with an initial permutation, sixteen rounds block cipher and a final
permutation. DES application is very popular in commercial, military, and other domains in the
last decades. There are variants like 3 DES , AES by enhancing DES function.
Blowfish Algorithm Bruce Schneier, one of the world's leading cryptologists, designed the
Blowfish algorithm and made it available in the public domain. Blowfish is a variable length
key, 64-bit block cipher. The algorithm was first introduce in 1993, and has not been cracked
yet. It can be optimized in hardware applications due to its compactness.

Figure 2. Blowfish algorithm The algorithm is shown in Fig.2. It consists of two parts: a key-
expansion part and a data- encryption part. Key expansion converts a key of at most 448 bits
into several sub-key arrays totaling 4168 bytes. Data encryption occurs via a 16-round
(commonly) network. Each round consists of a key-dependent permutation, and a key- and data-
dependent substitution. All operations are XORs and additions on 32-bit words. The only
additional operations are four indexed array data lookups per round.

Speed Estimation We realized the algorithms in C language program under Windows XP OS.
We estimated the performance of the algorithms by using a PC with CPU Pentium (R) 4
3.00GHz in the experiment. We implemented the program to run 109 times encryption for a
plaintext of 256 characters. We calculate the average value for one-time encryption speed. The
experimental results are shown in Table 1. The first column shows memory sizes, from 96M to
992M. The second large column displays the algorithm runtime which includes two sub-
columns: DES runtime and Blowfish runtime. Corresponding to different memory size, there
are three rows for DES and Blowfish runtime column. We show four different runtime test
values in row 2 and row 3, and show the average runtime in row 1. The fourth column displays
difference ratio between DES and Blowfish function runtime, which calculated in formulation .

We can see, Blowfish run much faster than DES. Both DES and Blowfish run slow in 92M
memory size. However, DES runtime improved rapidly from 224M memory size and became
steady. Blowfish also improved from 224M memory size, but became steady in 352M memory
size. We think this is because Blowfish function needs much more memory to initialize sub-
keys and S-boxes than DES function.
Security Analysis In this section, we analyze the algorithms’ strength against attacks from
two aspects: differential cryptanalysis and linear cryptanalysis. Eli Biham and Adi Shamir
introduced differential cryptanalysis in 1990. They found a chosen-plaintext attack against DES
which was more efficient than brute force. The best attack against full 16-round DES requires
247 chosen plaintexts.
This can be converted to a known plaintext attack, but requires 255 known plaintexts. And 237
DES operations are required during analysis. The attack is heavily dependent on the structure of
the S-boxes which happen to be optimized against differential cryptanalysis in DES. In addition,
the resistance of DES can be improved by increasing the number of rounds.

Linear cryptanalysis is another type of cryptanalytic attack invented by Mitsuru Matsui. The
attack uses linear approximations to describe the action of a block cipher [10]. Against full 16-
round DES, this attack can recover the key with an average of 243 known plaintexts. A software
implementation of this attack recovered a DES key in 50 days using 12 HP9000/735
workstations which is the most effective attack so far. Linear cryptanalysis is newer than
differential cryptanalysis and it is efficient against reduced round DES variants.

From above analysis, DES can provide a certain security guarantee in some degree by
optimizing the construction of Sboxes. Bruce Schneier show differential cryptanalysis on
Blowfish is possible either against a reduced number of rounds or with the piece of information
which describes the F function.

However, the boxes are well designed to resist to an attacks while they are randomly generated
in Blowfish. As we know, there is no successful cryptanalysis against Blowfish.
Encryption SNIPPET

import java.util.*;

public class Main {

String S[][]

= { { "d1310ba6", "98dfb5ac", "2ffd72db", "d01adfb7", "b8e1afed",

"6a267e96", "ba7c9045", "f12c7f99", "24a19947", "b3916cf7",

"0801f2e2", "858efc16", "636920d8", "71574e69", "a458fea3",

"f4933d7e", "0d95748f", "728eb658", "718bcd58", "82154aee",

"7b54a41d", "c25a59b5", "9c30d539", "2af26013", "c5d1b023",

"286085f0", "ca417918", "b8db38ef", "8e79dcb0", "603a180e",

"6c9e0e8b", "b01e8a3e", "d71577c1", "bd314b27", "78af2fda",

"55605c60", "e65525f3", "aa55ab94", "57489862", "63e81440",

"55ca396a", "2aab10b6", "b4cc5c34", "1141e8ce", "a15486af",

"7c72e993", "b3ee1411", "636fbc2a", "2ba9c55d", "741831f6",

"ce5c3e16", "9b87931e", "afd6ba33", "6c24cf5c", "7a325381",

"28958677", "3b8f4898", "6b4bb9af", "c4bfe81b", "66282193",

"61d809cc", "fb21a991", "487cac60", "5dec8032", "ef845d5d",

"e98575b1", "dc262302", "eb651b88", "23893e81", "d396acc5",

"0f6d6ff3", "83f44239", "2e0b4482", "a4842004", "69c8f04a",

"9e1f9b5e", "21c66842", "f6e96c9a", "670c9c61", "abd388f0",

"6a51a0d2", "d8542f68", "960fa728", "ab5133a3", "6eef0b6c",

"137a3be4", "ba3bf050", "7efb2a98", "a1f1651d", "39af0176",

"66ca593e", "82430e88", "8cee8619", "456f9fb4", "7d84a5c3",

"3b8b5ebe", "e06f75d8", "85c12073", "401a449f", "56c16aa6",

"4ed3aa62", "363f7706", "1bfedf72", "429b023d", "37d0d724",


"d00a1248", "db0fead3", "49f1c09b", "075372c9", "80991b7b",

"25d479d8", "f6e8def7", "e3fe501a", "b6794c3b", "976ce0bd",

"04c006ba", "c1a94fb6", "409f60c4", "5e5c9ec2", "196a2463",

"68fb6faf", "3e6c53b5", "1339b2eb", "3b52ec6f", "6dfc511f",

"9b30952c", "cc814544", "af5ebd09", "bee3d004", "de334afd",

"660f2807", "192e4bb3", "c0cba857", "45c8740f", "d20b5f39",

"b9d3fbdb", "5579c0bd", "1a60320a", "d6a100c6", "402c7279",

"679f25fe", "fb1fa3cc", "8ea5e9f8", "db3222f8", "3c7516df",

"fd616b15", "2f501ec8", "ad0552ab", "323db5fa", "fd238760",

"53317b48", "3e00df82", "9e5c57bb", "ca6f8ca0", "1a87562e",

"df1769db", "d542a8f6", "287effc3", "ac6732c6", "8c4f5573",

"695b27b0", "bbca58c8", "e1ffa35d", "b8f011a0", "10fa3d98",

"fd2183b8", "4afcb56c", "2dd1d35b", "9a53e479", "b6f84565",

"d28e49bc", "4bfb9790", "e1ddf2da", "a4cb7e33", "62fb1341",

"cee4c6e8", "ef20cada", "36774c01", "d07e9efe", "2bf11fb4",

"95dbda4d", "ae909198", "eaad8e71", "6b93d5a0", "d08ed1d0",

"afc725e0", "8e3c5b2f", "8e7594b7", "8ff6e2fb", "f2122b64",

"8888b812", "900df01c", "4fad5ea0", "688fc31c", "d1cff191",

"b3a8c1ad", "2f2f2218", "be0e1777", "ea752dfe", "8b021fa1",

"e5a0cc0f", "b56f74e8", "18acf3d6", "ce89e299", "b4a84fe0",

"fd13e0b7", "7cc43b81", "d2ada8d9", "165fa266", "80957705",

"93cc7314", "211a1477", "e6ad2065", "77b5fa86", "c75442f5",

"fb9d35cf", "ebcdaf0c", "7b3e89a0", "d6411bd3", "ae1e7e49",

"00250e2d", "2071b35e", "226800bb", "57b8e0af", "2464369b",

"f009b91e", "5563911d", "59dfa6aa", "78c14389", "d95a537f",


"207d5ba2", "02e5b9c5", "83260376", "6295cfa9", "11c81968",

"4e734a41", "b3472dca", "7b14a94a", "1b510052", "9a532915",

"d60f573f", "bc9bc6e4", "2b60a476", "81e67400", "08ba6fb5",

"571be91f", "f296ec6b", "2a0dd915", "b6636521", "e7b9f9b6",

"ff34052e", "c5855664", "53b02d5d", "a99f8fa1", "08ba4799",

"6e85076a" },

{ "4b7a70e9", "b5b32944", "db75092e", "c4192623", "ad6ea6b0",

"49a7df7d", "9cee60b8", "8fedb266", "ecaa8c71", "699a17ff",

"5664526c", "c2b19ee1", "193602a5", "75094c29", "a0591340",

"e4183a3e", "3f54989a", "5b429d65", "6b8fe4d6", "99f73fd6",

"a1d29c07", "efe830f5", "4d2d38e6", "f0255dc1", "4cdd2086",

"8470eb26", "6382e9c6", "021ecc5e", "09686b3f", "3ebaefc9",

"3c971814", "6b6a70a1", "687f3584", "52a0e286", "b79c5305",

"aa500737", "3e07841c", "7fdeae5c", "8e7d44ec", "5716f2b8",

"b03ada37", "f0500c0d", "f01c1f04", "0200b3ff", "ae0cf51a",

"3cb574b2", "25837a58", "dc0921bd", "d19113f9", "7ca92ff6",

"94324773", "22f54701", "3ae5e581", "37c2dadc", "c8b57634",

"9af3dda7", "a9446146", "0fd0030e", "ecc8c73e", "a4751e41",

"e238cd99", "3bea0e2f", "3280bba1", "183eb331", "4e548b38",

"4f6db908", "6f420d03", "f60a04bf", "2cb81290", "24977c79",

"5679b072", "bcaf89af", "de9a771f", "d9930810", "b38bae12",

"dccf3f2e", "5512721f", "2e6b7124", "501adde6", "9f84cd87",

"7a584718", "7408da17", "bc9f9abc", "e94b7d8c", "ec7aec3a",

"db851dfa", "63094366", "c464c3d2", "ef1c1847", "3215d908",

"dd433b37", "24c2ba16", "12a14d43", "2a65c451", "50940002",


"133ae4dd", "71dff89e", "10314e55", "81ac77d6", "5f11199b",

"043556f1", "d7a3c76b", "3c11183b", "5924a509", "f28fe6ed",

"97f1fbfa", "9ebabf2c", "1e153c6e", "86e34570", "eae96fb1",

"860e5e0a", "5a3e2ab3", "771fe71c", "4e3d06fa", "2965dcb9",

"99e71d0f", "803e89d6", "5266c825", "2e4cc978", "9c10b36a",

"c6150eba", "94e2ea78", "a5fc3c53", "1e0a2df4", "f2f74ea7",

"361d2b3d", "1939260f", "19c27960", "5223a708", "f71312b6",

"ebadfe6e", "eac31f66", "e3bc4595", "a67bc883", "b17f37d1",

"018cff28", "c332ddef", "be6c5aa5", "65582185", "68ab9802",

"eecea50f", "db2f953b", "2aef7dad", "5b6e2f84", "1521b628",

"29076170", "ecdd4775", "619f1510", "13cca830", "eb61bd96",

"0334fe1e", "aa0363cf", "b5735c90", "4c70a239", "d59e9e0b",

"cbaade14", "eecc86bc", "60622ca7", "9cab5cab", "b2f3846e",

"648b1eaf", "19bdf0ca", "a02369b9", "655abb50", "40685a32",

"3c2ab4b3", "319ee9d5", "c021b8f7", "9b540b19", "875fa099",

"95f7997e", "623d7da8", "f837889a", "97e32d77", "11ed935f",

"16681281", "0e358829", "c7e61fd6", "96dedfa1", "7858ba99",

"57f584a5", "1b227263", "9b83c3ff", "1ac24696", "cdb30aeb",

"532e3054", "8fd948e4", "6dbc3128", "58ebf2ef", "34c6ffea",

"fe28ed61", "ee7c3c73", "5d4a14d9", "e864b7e3", "42105d14",

"203e13e0", "45eee2b6", "a3aaabea", "db6c4f15", "facb4fd0",

"c742f442", "ef6abbb5", "654f3b1d", "41cd2105", "d81e799e",

"86854dc7", "e44b476a", "3d816250", "cf62a1f2", "5b8d2646",

"fc8883a0", "c1c7b6a3", "7f1524c3", "69cb7492", "47848a0b",

"5692b285", "095bbf00", "ad19489d", "1462b174", "23820e00",


"58428d2a", "0c55f5ea", "1dadf43e", "233f7061", "3372f092",

"8d937e41", "d65fecf1", "6c223bdb", "7cde3759", "cbee7460",

"4085f2a7", "ce77326e", "a6078084", "19f8509e", "e8efd855",

"61d99735", "a969a7aa", "c50c06c2", "5a04abfc", "800bcadc",

"9e447a2e", "c3453484", "fdd56705", "0e1e9ec9", "db73dbd3",

"105588cd", "675fda79", "e3674340", "c5c43465", "713e38d8",

"3d28f89e", "f16dff20", "153e21e7", "8fb03d4a", "e6e39f2b",

"db83adf7" },

{ "e93d5a68", "948140f7", "f64c261c", "94692934", "411520f7",

"7602d4f7", "bcf46b2e", "d4a20068", "d4082471", "3320f46a",

"43b7d4b7", "500061af", "1e39f62e", "97244546", "14214f74",

"bf8b8840", "4d95fc1d", "96b591af", "70f4ddd3", "66a02f45",

"bfbc09ec", "03bd9785", "7fac6dd0", "31cb8504", "96eb27b3",

"55fd3941", "da2547e6", "abca0a9a", "28507825", "530429f4",

"0a2c86da", "e9b66dfb", "68dc1462", "d7486900", "680ec0a4",

"27a18dee", "4f3ffea2", "e887ad8c", "b58ce006", "7af4d6b6",

"aace1e7c", "d3375fec", "ce78a399", "406b2a42", "20fe9e35",

"d9f385b9", "ee39d7ab", "3b124e8b", "1dc9faf7", "4b6d1856",

"26a36631", "eae397b2", "3a6efa74", "dd5b4332", "6841e7f7",

"ca7820fb", "fb0af54e", "d8feb397", "454056ac", "ba489527",

"55533a3a", "20838d87", "fe6ba9b7", "d096954b", "55a867bc",

"a1159a58", "cca92963", "99e1db33", "a62a4a56", "3f3125f9",

"5ef47e1c", "9029317c", "fdf8e802", "04272f70", "80bb155c",

"05282ce3", "95c11548", "e4c66d22", "48c1133f", "c70f86dc",

"07f9c9ee", "41041f0f", "404779a4", "5d886e17", "325f51eb",


"d59bc0d1", "f2bcc18f", "41113564", "257b7834", "602a9c60",

"dff8e8a3", "1f636c1b", "0e12b4c2", "02e1329e", "af664fd1",

"cad18115", "6b2395e0", "333e92e1", "3b240b62", "eebeb922",

"85b2a20e", "e6ba0d99", "de720c8c", "2da2f728", "d0127845",

"95b794fd", "647d0862", "e7ccf5f0", "5449a36f", "877d48fa",

"c39dfd27", "f33e8d1e", "0a476341", "992eff74", "3a6f6eab",

"f4f8fd37", "a812dc60", "a1ebddf8", "991be14c", "db6e6b0d",

"c67b5510", "6d672c37", "2765d43b", "dcd0e804", "f1290dc7",

"cc00ffa3", "b5390f92", "690fed0b", "667b9ffb", "cedb7d9c",

"a091cf0b", "d9155ea3", "bb132f88", "515bad24", "7b9479bf",

"763bd6eb", "37392eb3", "cc115979", "8026e297", "f42e312d",

"6842ada7", "c66a2b3b", "12754ccc", "782ef11c", "6a124237",

"b79251e7", "06a1bbe6", "4bfb6350", "1a6b1018", "11caedfa",

"3d25bdd8", "e2e1c3c9", "44421659", "0a121386", "d90cec6e",

"d5abea2a", "64af674e", "da86a85f", "bebfe988", "64e4c3fe",

"9dbc8057", "f0f7c086", "60787bf8", "6003604d", "d1fd8346",

"f6381fb0", "7745ae04", "d736fccc", "83426b33", "f01eab71",

"b0804187", "3c005e5f", "77a057be", "bde8ae24", "55464299",

"bf582e61", "4e58f48f", "f2ddfda2", "f474ef38", "8789bdc2",

"5366f9c3", "c8b38e74", "b475f255", "46fcd9b9", "7aeb2661",

"8b1ddf84", "846a0e79", "915f95e2", "466e598e", "20b45770",

"8cd55591", "c902de4c", "b90bace1", "bb8205d0", "11a86248",

"7574a99e", "b77f19b6", "e0a9dc09", "662d09a1", "c4324633",

"e85a1f02", "09f0be8c", "4a99a025", "1d6efe10", "1ab93d1d",

"0ba5a4df", "a186f20f", "2868f169", "dcb7da83", "573906fe",


"a1e2ce9b", "4fcd7f52", "50115e01", "a70683fa", "a002b5c4",

"0de6d027", "9af88c27", "773f8641", "c3604c06", "61a806b5",

"f0177a28", "c0f586e0", "006058aa", "30dc7d62", "11e69ed7",

"2338ea63", "53c2dd94", "c2c21634", "bbcbee56", "90bcb6de",

"ebfc7da1", "ce591d76", "6f05e409", "4b7c0188", "39720a3d",

"7c927c24", "86e3725f", "724d9db9", "1ac15bb4", "d39eb8fc",

"ed545578", "08fca5b5", "d83d7cd3", "4dad0fc4", "1e50ef5e",

"b161e6f8", "a28514d9", "6c51133c", "6fd5c7e7", "56e14ec4",

"362abfce", "ddc6c837", "d79a3234", "92638212", "670efa8e",

"406000e0" },

{ "3a39ce37", "d3faf5cf", "abc27737", "5ac52d1b", "5cb0679e",

"4fa33742", "d3822740", "99bc9bbe", "d5118e9d", "bf0f7315",

"d62d1c7e", "c700c47b", "b78c1b6b", "21a19045", "b26eb1be",

"6a366eb4", "5748ab2f", "bc946e79", "c6a376d2", "6549c2c8",

"530ff8ee", "468dde7d", "d5730a1d", "4cd04dc6", "2939bbdb",

"a9ba4650", "ac9526e8", "be5ee304", "a1fad5f0", "6a2d519a",

"63ef8ce2", "9a86ee22", "c089c2b8", "43242ef6", "a51e03aa",

"9cf2d0a4", "83c061ba", "9be96a4d", "8fe51550", "ba645bd6",

"2826a2f9", "a73a3ae1", "4ba99586", "ef5562e9", "c72fefd3",

"f752f7da", "3f046f69", "77fa0a59", "80e4a915", "87b08601",

"9b09e6ad", "3b3ee593", "e990fd5a", "9e34d797", "2cf0b7d9",

"022b8b51", "96d5ac3a", "017da67d", "d1cf3ed6", "7c7d2d28",

"1f9f25cf", "adf2b89b", "5ad6b472", "5a88f54c", "e029ac71",

"e019a5e6", "47b0acfd", "ed93fa9b", "e8d3c48d", "283b57cc",

"f8d56629", "79132e28", "785f0191", "ed756055", "f7960e44",


"e3d35e8c", "15056dd4", "88f46dba", "03a16125", "0564f0bd",

"c3eb9e15", "3c9057a2", "97271aec", "a93a072a", "1b3f6d9b",

"1e6321f5", "f59c66fb", "26dcf319", "7533d928", "b155fdf5",

"03563482", "8aba3cbb", "28517711", "c20ad9f8", "abcc5167",

"ccad925f", "4de81751", "3830dc8e", "379d5862", "9320f991",

"ea7a90c2", "fb3e7bce", "5121ce64", "774fbe32", "a8b6e37e",

"c3293d46", "48de5369", "6413e680", "a2ae0810", "dd6db224",

"69852dfd", "09072166", "b39a460a", "6445c0dd", "586cdecf",

"1c20c8ae", "5bbef7dd", "1b588d40", "ccd2017f", "6bb4e3bb",

"dda26a7e", "3a59ff45", "3e350a44", "bcb4cdd5", "72eacea8",

"fa6484bb", "8d6612ae", "bf3c6f47", "d29be463", "542f5d9e",

"aec2771b", "f64e6370", "740e0d8d", "e75b1357", "f8721671",

"af537d5d", "4040cb08", "4eb4e2cc", "34d2466a", "0115af84",

"e1b00428", "95983a1d", "06b89fb4", "ce6ea048", "6f3f3b82",

"3520ab82", "011a1d4b", "277227f8", "611560b1", "e7933fdc",

"bb3a792b", "344525bd", "a08839e1", "51ce794b", "2f32c9b7",

"a01fbac9", "e01cc87e", "bcc7d1f6", "cf0111c3", "a1e8aac7",

"1a908749", "d44fbd9a", "d0dadecb", "d50ada38", "0339c32a",

"c6913667", "8df9317c", "e0b12b4f", "f79e59b7", "43f5bb3a",

"f2d519ff", "27d9459c", "bf97222c", "15e6fc2a", "0f91fc71",

"9b941525", "fae59361", "ceb69ceb", "c2a86459", "12baa8d1",

"b6c1075e", "e3056a0c", "10d25065", "cb03a442", "e0ec6e0e",

"1698db3b", "4c98a0be", "3278e964", "9f1f9532", "e0d392df",

"d3a0342b", "8971f21e", "1b0a7441", "4ba3348c", "c5be7120",

"c37632d8", "df359f8d", "9b992f2e", "e60b6f47", "0fe3f11d",


"e54cda54", "1edad891", "ce6279cf", "cd3e7e6f", "1618b166",

"fd2c1d05", "848fd2c5", "f6fb2299", "f523f357", "a6327623",

"93a83531", "56cccd02", "acf08162", "5a75ebb5", "6e163697",

"88d273cc", "de966292", "81b949d0", "4c50901b", "71c65614",

"e6c6c7bd", "327a140a", "45e1d006", "c3f27b9a", "c9aa53fd",

"62a80f00", "bb25bfe2", "35bdd2f6", "71126905", "b2040222",

"b6cbcf7c", "cd769c2b", "53113ec0", "1640e3d3", "38abbd60",

"2547adf0", "ba38209c", "f746ce76", "77afa1c5", "20756060",

"85cbfe4e", "8ae88dd8", "7aaaf9b0", "4cf9aa7e", "1948c25c",

"02fb8a8c", "01c36ae4", "d6ebe1f9", "90d4f869", "a65cdea0",

"3f09252d", "c208e69f", "b74e6132", "ce77e25b", "578fdfe3",

"3ac372e6" } };

// Subkeys initialisation with digits of pi.

String P[] = { "243f6a88", "85a308d3", "13198a2e", "03707344", "a4093822",

"299f31d0", "082efa98", "ec4e6c89", "452821e6", "38d01377",

"be5466cf", "34e90c6c", "c0ac29b7", "c97c50dd", "3f84d5b5",

"b5470917", "9216d5d9", "8979fb1b" };

// to store 2^32(for addition modulo 2^32).

long modVal = 1;

// to convert hexadecimal to binary.

private String hexToBin(String plainText)

{
String binary = "";

Long num;

String binary4B;

int n = plainText.length();

for (int i = 0; i < n; i++) {

num = Long.parseUnsignedLong(

plainText.charAt(i) + "", 16);

binary4B = Long.toBinaryString(num);

// each value in hexadecimal is 4 bits in binary.

binary4B = "0000" + binary4B;

binary4B = binary4B.substring(binary4B.length() - 4);

binary += binary4B;

return binary;

// convert from binary to hexadecimal.

private String binToHex(String plainText)

long num = Long.parseUnsignedLong(plainText, 2);

String hexa = Long.toHexString(num);


while (hexa.length() < (plainText.length() / 4))

// maintain output length same length

// as input by appending leading zeroes.

hexa = "0" + hexa;

return hexa;

// xor two hexadecimal strings of the same length.

private String xor(String a, String b)

a = hexToBin(a);

b = hexToBin(b);

String ans = "";

for (int i = 0; i < a.length(); i++)

ans += (char)(((a.charAt(i) - '0')

^ (b.charAt(i) - '0'))

+ '0');

ans = binToHex(ans);

return ans;

// addition modulo 2^32 of two hexadecimal strings.

private String addBin(String a, String b)


{

String ans = "";

long n1 = Long.parseUnsignedLong(a, 16);

long n2 = Long.parseUnsignedLong(b, 16);

n1 = (n1 + n2) % modVal;

ans = Long.toHexString(n1);

ans = "00000000" + ans;

return ans.substring(ans.length() - 8);

// function F explained above.

private String f(String plainText)

String a[] = new String[4];

String ans = "";

for (int i = 0; i < 8; i += 2) {

// the column number for S-box

// is 8-bit value(8*4 = 32 bit plain text)

long col

= Long.parseUnsignedLong(

hexToBin(

plainText

.substring(i, i + 2)),

2);

a[i / 2] = S[i / 2][(int)col];


}

ans = addBin(a[0], a[1]);

ans = xor(ans, a[2]);

ans = addBin(ans, a[3]);

return ans;

// generate subkeys.

private void keyGenerate(String key)

int j = 0;

for (int i = 0; i < P.length; i++) {

// xor-ing 32-bit parts of the key

// with initial subkeys.

P[i] = xor(P[i], key.substring(j, j + 8));

System.out.println("subkey "

+ (i + 1) + ": "

+ P[i]);

j = (j + 8) % key.length();

// round function
private String round(int time, String plainText)

String left, right;

left = plainText.substring(0, 8);

right = plainText.substring(8, 16);

left = xor(left, P[time]);

// output from F function

String fOut = f(left);

right = xor(fOut, right);

System.out.println(

"round " + time + ": "

+ right + left);

// swap left and right

return right + left;

// encryption

private String encrypt(String plainText)

for (int i = 0; i < 16; i++)

plainText = round(i, plainText);


// postprocessing

String right = plainText.substring(0, 8);

String left = plainText.substring(8, 16);

right = xor(right, P[16]);

left = xor(left, P[17]);

return left + right;

Main()

// storing 2^32 in modVal

//(<<1 is equivalent to multiply by 2)

for (int i = 0; i < 32; i++)

modVal = modVal << 1;

String plainText = "123456abcd132536";

String key = "aabb09182736ccdd";

keyGenerate(key);

System.out.println("-----Encryption-----");

String cipherText = encrypt(plainText);

System.out.println("Cipher Text: " + cipherText);

}
public static void main(String args[])

new Main();

Decryption SNIPPET

import java.util.*;

public class Main {

String S[][]

= { { "d1310ba6", "98dfb5ac", "2ffd72db", "d01adfb7", "b8e1afed",

"6a267e96", "ba7c9045", "f12c7f99", "24a19947", "b3916cf7",


"0801f2e2", "858efc16", "636920d8", "71574e69", "a458fea3",

"f4933d7e", "0d95748f", "728eb658", "718bcd58", "82154aee",

"7b54a41d", "c25a59b5", "9c30d539", "2af26013", "c5d1b023",

"286085f0", "ca417918", "b8db38ef", "8e79dcb0", "603a180e",

"6c9e0e8b", "b01e8a3e", "d71577c1", "bd314b27", "78af2fda",

"55605c60", "e65525f3", "aa55ab94", "57489862", "63e81440",

"55ca396a", "2aab10b6", "b4cc5c34", "1141e8ce", "a15486af",

"7c72e993", "b3ee1411", "636fbc2a", "2ba9c55d", "741831f6",

"ce5c3e16", "9b87931e", "afd6ba33", "6c24cf5c", "7a325381",

"28958677", "3b8f4898", "6b4bb9af", "c4bfe81b", "66282193",

"61d809cc", "fb21a991", "487cac60", "5dec8032", "ef845d5d",

"e98575b1", "dc262302", "eb651b88", "23893e81", "d396acc5",

"0f6d6ff3", "83f44239", "2e0b4482", "a4842004", "69c8f04a",

"9e1f9b5e", "21c66842", "f6e96c9a", "670c9c61", "abd388f0",

"6a51a0d2", "d8542f68", "960fa728", "ab5133a3", "6eef0b6c",

"137a3be4", "ba3bf050", "7efb2a98", "a1f1651d", "39af0176",

"66ca593e", "82430e88", "8cee8619", "456f9fb4", "7d84a5c3",

"3b8b5ebe", "e06f75d8", "85c12073", "401a449f", "56c16aa6",

"4ed3aa62", "363f7706", "1bfedf72", "429b023d", "37d0d724",

"d00a1248", "db0fead3", "49f1c09b", "075372c9", "80991b7b",

"25d479d8", "f6e8def7", "e3fe501a", "b6794c3b", "976ce0bd",

"04c006ba", "c1a94fb6", "409f60c4", "5e5c9ec2", "196a2463",

"68fb6faf", "3e6c53b5", "1339b2eb", "3b52ec6f", "6dfc511f",

"9b30952c", "cc814544", "af5ebd09", "bee3d004", "de334afd",

"660f2807", "192e4bb3", "c0cba857", "45c8740f", "d20b5f39",


"b9d3fbdb", "5579c0bd", "1a60320a", "d6a100c6", "402c7279",

"679f25fe", "fb1fa3cc", "8ea5e9f8", "db3222f8", "3c7516df",

"fd616b15", "2f501ec8", "ad0552ab", "323db5fa", "fd238760",

"53317b48", "3e00df82", "9e5c57bb", "ca6f8ca0", "1a87562e",

"df1769db", "d542a8f6", "287effc3", "ac6732c6", "8c4f5573",

"695b27b0", "bbca58c8", "e1ffa35d", "b8f011a0", "10fa3d98",

"fd2183b8", "4afcb56c", "2dd1d35b", "9a53e479", "b6f84565",

"d28e49bc", "4bfb9790", "e1ddf2da", "a4cb7e33", "62fb1341",

"cee4c6e8", "ef20cada", "36774c01", "d07e9efe", "2bf11fb4",

"95dbda4d", "ae909198", "eaad8e71", "6b93d5a0", "d08ed1d0",

"afc725e0", "8e3c5b2f", "8e7594b7", "8ff6e2fb", "f2122b64",

"8888b812", "900df01c", "4fad5ea0", "688fc31c", "d1cff191",

"b3a8c1ad", "2f2f2218", "be0e1777", "ea752dfe", "8b021fa1",

"e5a0cc0f", "b56f74e8", "18acf3d6", "ce89e299", "b4a84fe0",

"fd13e0b7", "7cc43b81", "d2ada8d9", "165fa266", "80957705",

"93cc7314", "211a1477", "e6ad2065", "77b5fa86", "c75442f5",

"fb9d35cf", "ebcdaf0c", "7b3e89a0", "d6411bd3", "ae1e7e49",

"00250e2d", "2071b35e", "226800bb", "57b8e0af", "2464369b",

"f009b91e", "5563911d", "59dfa6aa", "78c14389", "d95a537f",

"207d5ba2", "02e5b9c5", "83260376", "6295cfa9", "11c81968",

"4e734a41", "b3472dca", "7b14a94a", "1b510052", "9a532915",

"d60f573f", "bc9bc6e4", "2b60a476", "81e67400", "08ba6fb5",

"571be91f", "f296ec6b", "2a0dd915", "b6636521", "e7b9f9b6",

"ff34052e", "c5855664", "53b02d5d", "a99f8fa1", "08ba4799",

"6e85076a" },
{ "4b7a70e9", "b5b32944", "db75092e", "c4192623", "ad6ea6b0",

"49a7df7d", "9cee60b8", "8fedb266", "ecaa8c71", "699a17ff",

"5664526c", "c2b19ee1", "193602a5", "75094c29", "a0591340",

"e4183a3e", "3f54989a", "5b429d65", "6b8fe4d6", "99f73fd6",

"a1d29c07", "efe830f5", "4d2d38e6", "f0255dc1", "4cdd2086",

"8470eb26", "6382e9c6", "021ecc5e", "09686b3f", "3ebaefc9",

"3c971814", "6b6a70a1", "687f3584", "52a0e286", "b79c5305",

"aa500737", "3e07841c", "7fdeae5c", "8e7d44ec", "5716f2b8",

"b03ada37", "f0500c0d", "f01c1f04", "0200b3ff", "ae0cf51a",

"3cb574b2", "25837a58", "dc0921bd", "d19113f9", "7ca92ff6",

"94324773", "22f54701", "3ae5e581", "37c2dadc", "c8b57634",

"9af3dda7", "a9446146", "0fd0030e", "ecc8c73e", "a4751e41",

"e238cd99", "3bea0e2f", "3280bba1", "183eb331", "4e548b38",

"4f6db908", "6f420d03", "f60a04bf", "2cb81290", "24977c79",

"5679b072", "bcaf89af", "de9a771f", "d9930810", "b38bae12",

"dccf3f2e", "5512721f", "2e6b7124", "501adde6", "9f84cd87",

"7a584718", "7408da17", "bc9f9abc", "e94b7d8c", "ec7aec3a",

"db851dfa", "63094366", "c464c3d2", "ef1c1847", "3215d908",

"dd433b37", "24c2ba16", "12a14d43", "2a65c451", "50940002",

"133ae4dd", "71dff89e", "10314e55", "81ac77d6", "5f11199b",

"043556f1", "d7a3c76b", "3c11183b", "5924a509", "f28fe6ed",

"97f1fbfa", "9ebabf2c", "1e153c6e", "86e34570", "eae96fb1",

"860e5e0a", "5a3e2ab3", "771fe71c", "4e3d06fa", "2965dcb9",

"99e71d0f", "803e89d6", "5266c825", "2e4cc978", "9c10b36a",

"c6150eba", "94e2ea78", "a5fc3c53", "1e0a2df4", "f2f74ea7",


"361d2b3d", "1939260f", "19c27960", "5223a708", "f71312b6",

"ebadfe6e", "eac31f66", "e3bc4595", "a67bc883", "b17f37d1",

"018cff28", "c332ddef", "be6c5aa5", "65582185", "68ab9802",

"eecea50f", "db2f953b", "2aef7dad", "5b6e2f84", "1521b628",

"29076170", "ecdd4775", "619f1510", "13cca830", "eb61bd96",

"0334fe1e", "aa0363cf", "b5735c90", "4c70a239", "d59e9e0b",

"cbaade14", "eecc86bc", "60622ca7", "9cab5cab", "b2f3846e",

"648b1eaf", "19bdf0ca", "a02369b9", "655abb50", "40685a32",

"3c2ab4b3", "319ee9d5", "c021b8f7", "9b540b19", "875fa099",

"95f7997e", "623d7da8", "f837889a", "97e32d77", "11ed935f",

"16681281", "0e358829", "c7e61fd6", "96dedfa1", "7858ba99",

"57f584a5", "1b227263", "9b83c3ff", "1ac24696", "cdb30aeb",

"532e3054", "8fd948e4", "6dbc3128", "58ebf2ef", "34c6ffea",

"fe28ed61", "ee7c3c73", "5d4a14d9", "e864b7e3", "42105d14",

"203e13e0", "45eee2b6", "a3aaabea", "db6c4f15", "facb4fd0",

"c742f442", "ef6abbb5", "654f3b1d", "41cd2105", "d81e799e",

"86854dc7", "e44b476a", "3d816250", "cf62a1f2", "5b8d2646",

"fc8883a0", "c1c7b6a3", "7f1524c3", "69cb7492", "47848a0b",

"5692b285", "095bbf00", "ad19489d", "1462b174", "23820e00",

"58428d2a", "0c55f5ea", "1dadf43e", "233f7061", "3372f092",

"8d937e41", "d65fecf1", "6c223bdb", "7cde3759", "cbee7460",

"4085f2a7", "ce77326e", "a6078084", "19f8509e", "e8efd855",

"61d99735", "a969a7aa", "c50c06c2", "5a04abfc", "800bcadc",

"9e447a2e", "c3453484", "fdd56705", "0e1e9ec9", "db73dbd3",

"105588cd", "675fda79", "e3674340", "c5c43465", "713e38d8",


"3d28f89e", "f16dff20", "153e21e7", "8fb03d4a", "e6e39f2b",

"db83adf7" },

{ "e93d5a68", "948140f7", "f64c261c", "94692934", "411520f7",

"7602d4f7", "bcf46b2e", "d4a20068", "d4082471", "3320f46a",

"43b7d4b7", "500061af", "1e39f62e", "97244546", "14214f74",

"bf8b8840", "4d95fc1d", "96b591af", "70f4ddd3", "66a02f45",

"bfbc09ec", "03bd9785", "7fac6dd0", "31cb8504", "96eb27b3",

"55fd3941", "da2547e6", "abca0a9a", "28507825", "530429f4",

"0a2c86da", "e9b66dfb", "68dc1462", "d7486900", "680ec0a4",

"27a18dee", "4f3ffea2", "e887ad8c", "b58ce006", "7af4d6b6",

"aace1e7c", "d3375fec", "ce78a399", "406b2a42", "20fe9e35",

"d9f385b9", "ee39d7ab", "3b124e8b", "1dc9faf7", "4b6d1856",

"26a36631", "eae397b2", "3a6efa74", "dd5b4332", "6841e7f7",

"ca7820fb", "fb0af54e", "d8feb397", "454056ac", "ba489527",

"55533a3a", "20838d87", "fe6ba9b7", "d096954b", "55a867bc",

"a1159a58", "cca92963", "99e1db33", "a62a4a56", "3f3125f9",

"5ef47e1c", "9029317c", "fdf8e802", "04272f70", "80bb155c",

"05282ce3", "95c11548", "e4c66d22", "48c1133f", "c70f86dc",

"07f9c9ee", "41041f0f", "404779a4", "5d886e17", "325f51eb",

"d59bc0d1", "f2bcc18f", "41113564", "257b7834", "602a9c60",

"dff8e8a3", "1f636c1b", "0e12b4c2", "02e1329e", "af664fd1",

"cad18115", "6b2395e0", "333e92e1", "3b240b62", "eebeb922",

"85b2a20e", "e6ba0d99", "de720c8c", "2da2f728", "d0127845",

"95b794fd", "647d0862", "e7ccf5f0", "5449a36f", "877d48fa",

"c39dfd27", "f33e8d1e", "0a476341", "992eff74", "3a6f6eab",


"f4f8fd37", "a812dc60", "a1ebddf8", "991be14c", "db6e6b0d",

"c67b5510", "6d672c37", "2765d43b", "dcd0e804", "f1290dc7",

"cc00ffa3", "b5390f92", "690fed0b", "667b9ffb", "cedb7d9c",

"a091cf0b", "d9155ea3", "bb132f88", "515bad24", "7b9479bf",

"763bd6eb", "37392eb3", "cc115979", "8026e297", "f42e312d",

"6842ada7", "c66a2b3b", "12754ccc", "782ef11c", "6a124237",

"b79251e7", "06a1bbe6", "4bfb6350", "1a6b1018", "11caedfa",

"3d25bdd8", "e2e1c3c9", "44421659", "0a121386", "d90cec6e",

"d5abea2a", "64af674e", "da86a85f", "bebfe988", "64e4c3fe",

"9dbc8057", "f0f7c086", "60787bf8", "6003604d", "d1fd8346",

"f6381fb0", "7745ae04", "d736fccc", "83426b33", "f01eab71",

"b0804187", "3c005e5f", "77a057be", "bde8ae24", "55464299",

"bf582e61", "4e58f48f", "f2ddfda2", "f474ef38", "8789bdc2",

"5366f9c3", "c8b38e74", "b475f255", "46fcd9b9", "7aeb2661",

"8b1ddf84", "846a0e79", "915f95e2", "466e598e", "20b45770",

"8cd55591", "c902de4c", "b90bace1", "bb8205d0", "11a86248",

"7574a99e", "b77f19b6", "e0a9dc09", "662d09a1", "c4324633",

"e85a1f02", "09f0be8c", "4a99a025", "1d6efe10", "1ab93d1d",

"0ba5a4df", "a186f20f", "2868f169", "dcb7da83", "573906fe",

"a1e2ce9b", "4fcd7f52", "50115e01", "a70683fa", "a002b5c4",

"0de6d027", "9af88c27", "773f8641", "c3604c06", "61a806b5",

"f0177a28", "c0f586e0", "006058aa", "30dc7d62", "11e69ed7",

"2338ea63", "53c2dd94", "c2c21634", "bbcbee56", "90bcb6de",

"ebfc7da1", "ce591d76", "6f05e409", "4b7c0188", "39720a3d",

"7c927c24", "86e3725f", "724d9db9", "1ac15bb4", "d39eb8fc",


"ed545578", "08fca5b5", "d83d7cd3", "4dad0fc4", "1e50ef5e",

"b161e6f8", "a28514d9", "6c51133c", "6fd5c7e7", "56e14ec4",

"362abfce", "ddc6c837", "d79a3234", "92638212", "670efa8e",

"406000e0" },

{ "3a39ce37", "d3faf5cf", "abc27737", "5ac52d1b", "5cb0679e",

"4fa33742", "d3822740", "99bc9bbe", "d5118e9d", "bf0f7315",

"d62d1c7e", "c700c47b", "b78c1b6b", "21a19045", "b26eb1be",

"6a366eb4", "5748ab2f", "bc946e79", "c6a376d2", "6549c2c8",

"530ff8ee", "468dde7d", "d5730a1d", "4cd04dc6", "2939bbdb",

"a9ba4650", "ac9526e8", "be5ee304", "a1fad5f0", "6a2d519a",

"63ef8ce2", "9a86ee22", "c089c2b8", "43242ef6", "a51e03aa",

"9cf2d0a4", "83c061ba", "9be96a4d", "8fe51550", "ba645bd6",

"2826a2f9", "a73a3ae1", "4ba99586", "ef5562e9", "c72fefd3",

"f752f7da", "3f046f69", "77fa0a59", "80e4a915", "87b08601",

"9b09e6ad", "3b3ee593", "e990fd5a", "9e34d797", "2cf0b7d9",

"022b8b51", "96d5ac3a", "017da67d", "d1cf3ed6", "7c7d2d28",

"1f9f25cf", "adf2b89b", "5ad6b472", "5a88f54c", "e029ac71",

"e019a5e6", "47b0acfd", "ed93fa9b", "e8d3c48d", "283b57cc",

"f8d56629", "79132e28", "785f0191", "ed756055", "f7960e44",

"e3d35e8c", "15056dd4", "88f46dba", "03a16125", "0564f0bd",

"c3eb9e15", "3c9057a2", "97271aec", "a93a072a", "1b3f6d9b",

"1e6321f5", "f59c66fb", "26dcf319", "7533d928", "b155fdf5",

"03563482", "8aba3cbb", "28517711", "c20ad9f8", "abcc5167",

"ccad925f", "4de81751", "3830dc8e", "379d5862", "9320f991",

"ea7a90c2", "fb3e7bce", "5121ce64", "774fbe32", "a8b6e37e",


"c3293d46", "48de5369", "6413e680", "a2ae0810", "dd6db224",

"69852dfd", "09072166", "b39a460a", "6445c0dd", "586cdecf",

"1c20c8ae", "5bbef7dd", "1b588d40", "ccd2017f", "6bb4e3bb",

"dda26a7e", "3a59ff45", "3e350a44", "bcb4cdd5", "72eacea8",

"fa6484bb", "8d6612ae", "bf3c6f47", "d29be463", "542f5d9e",

"aec2771b", "f64e6370", "740e0d8d", "e75b1357", "f8721671",

"af537d5d", "4040cb08", "4eb4e2cc", "34d2466a", "0115af84",

"e1b00428", "95983a1d", "06b89fb4", "ce6ea048", "6f3f3b82",

"3520ab82", "011a1d4b", "277227f8", "611560b1", "e7933fdc",

"bb3a792b", "344525bd", "a08839e1", "51ce794b", "2f32c9b7",

"a01fbac9", "e01cc87e", "bcc7d1f6", "cf0111c3", "a1e8aac7",

"1a908749", "d44fbd9a", "d0dadecb", "d50ada38", "0339c32a",

"c6913667", "8df9317c", "e0b12b4f", "f79e59b7", "43f5bb3a",

"f2d519ff", "27d9459c", "bf97222c", "15e6fc2a", "0f91fc71",

"9b941525", "fae59361", "ceb69ceb", "c2a86459", "12baa8d1",

"b6c1075e", "e3056a0c", "10d25065", "cb03a442", "e0ec6e0e",

"1698db3b", "4c98a0be", "3278e964", "9f1f9532", "e0d392df",

"d3a0342b", "8971f21e", "1b0a7441", "4ba3348c", "c5be7120",

"c37632d8", "df359f8d", "9b992f2e", "e60b6f47", "0fe3f11d",

"e54cda54", "1edad891", "ce6279cf", "cd3e7e6f", "1618b166",

"fd2c1d05", "848fd2c5", "f6fb2299", "f523f357", "a6327623",

"93a83531", "56cccd02", "acf08162", "5a75ebb5", "6e163697",

"88d273cc", "de966292", "81b949d0", "4c50901b", "71c65614",

"e6c6c7bd", "327a140a", "45e1d006", "c3f27b9a", "c9aa53fd",

"62a80f00", "bb25bfe2", "35bdd2f6", "71126905", "b2040222",


"b6cbcf7c", "cd769c2b", "53113ec0", "1640e3d3", "38abbd60",

"2547adf0", "ba38209c", "f746ce76", "77afa1c5", "20756060",

"85cbfe4e", "8ae88dd8", "7aaaf9b0", "4cf9aa7e", "1948c25c",

"02fb8a8c", "01c36ae4", "d6ebe1f9", "90d4f869", "a65cdea0",

"3f09252d", "c208e69f", "b74e6132", "ce77e25b", "578fdfe3",

"3ac372e6" } };

// Subkeys initialisation with digits of pi.

String P[] = { "243f6a88", "85a308d3", "13198a2e", "03707344", "a4093822",

"299f31d0", "082efa98", "ec4e6c89", "452821e6", "38d01377",

"be5466cf", "34e90c6c", "c0ac29b7", "c97c50dd", "3f84d5b5",

"b5470917", "9216d5d9", "8979fb1b" };

// to store 2^32(for addition modulo 2^32).

long modVal = 1;

// to convert hexadecimal to binary.

private String hexToBin(String plainText)

String binary = "";

Long num;

String binary4B;

int n = plainText.length();

for (int i = 0; i < n; i++) {

num
= Long.parseUnsignedLong(

plainText.charAt(i) + "", 16);

binary4B = Long.toBinaryString(num);

// each value in hexadecimal

// is 4 bits in binary.

binary4B = "0000" + binary4B;

binary4B

= binary4B.substring(

binary4B.length() - 4);

binary += binary4B;

return binary;

// convert from binary to hexadecimal.

private String binToHex(String plainText)

long num = Long.parseUnsignedLong(plainText, 2);

String hexa = Long.toHexString(num);

while (hexa.length() < (plainText.length() / 4))

// maintain output length same length

// as input by appending leading zeroes.

hexa = "0" + hexa;


return hexa;

// xor two hexadecimal strings of same length.

private String xor(String a, String b)

a = hexToBin(a);

b = hexToBin(b);

String ans = "";

for (int i = 0; i < a.length(); i++)

ans += (char)(((a.charAt(i) - '0')

^ (b.charAt(i) - '0'))

+ '0');

ans = binToHex(ans);

return ans;

// addition modulo 2^32 of two hexadecimal strings.

private String addBin(String a, String b)

String ans = "";

long n1 = Long.parseUnsignedLong(a, 16);

long n2 = Long.parseUnsignedLong(b, 16);

n1 = (n1 + n2) % modVal;

ans = Long.toHexString(n1);
ans = "00000000" + ans;

return ans.substring(ans.length() - 8);

// function F explained above.

private String f(String plainText)

String a[] = new String[4];

String ans = "";

for (int i = 0; i < 8; i += 2) {

// the column number for S-box

// is 8-bit value(8*4 = 32 bit plain text)

long col

= Long.parseUnsignedLong(

hexToBin(

plainText.substring(i, i + 2)),

2);

a[i / 2] = S[i / 2][(int)col];

ans = addBin(a[0], a[1]);

ans = xor(ans, a[2]);

ans = addBin(ans, a[3]);

return ans;

}
// generate subkeys.

private void keyGenerate(String key)

int j = 0;

for (int i = 0; i < P.length; i++) {

P[i] = xor(P[i], key.substring(j, j + 8));

System.out.println("subkey "

+ (i + 1) + ": "

+ P[i]);

j = (j + 8) % key.length();

// round function

private String round(int time, String plainText)

String left, right;

left = plainText.substring(0, 8);

right = plainText.substring(8, 16);

left = xor(left, P[time]);

String fOut = f(left); // output from F function

right = xor(fOut, right);

System.out.println("round " + time + ": "

+ right + left);
// swap left and right

return right + left;

// decryption

private String decrypt(String plainText)

for (int i = 17; i > 1; i--)

plainText = round(i, plainText);

// postprocessing

String right = plainText.substring(0, 8);

String left = plainText.substring(8, 16);

right = xor(right, P[1]);

left = xor(left, P[0]);

return left + right;

Main()

// storing 2^32 in modVal

//(<<1 is equivalent to multiply by 2)

for (int i = 0; i < 32; i++)

modVal = modVal << 1;


String cipherText = "d748ec383d3405f7";

String key = "aabb09182736ccdd";

keyGenerate(key);

System.out.println("-----Decryption-----");

String plainText = decrypt(cipherText);

System.out.println("Plain Text: "

+ plainText);

public static void main(String args[])

new Main();

}
CONCLUSION

In this paper, we studied two popular encryption algorithms: DES and Blowfish. We overviewed the
basic flow of the two algorithms and analyzed the security. Both algorithms have high security to resist
differential cryptanalysis and linear cryptanalysis attacks. We evaluated encryption function speed
based on different memory sizes. The experimental results show Blowfish is much faster than DES but
the speed increasing for Blowfish is slower compared to DES because it needs much more memory for
sub-key and Sboxes initialization.
REFERENCES
[1] Coppersmith, D. "The Data Encryption Standard (DES) and Its Strength Against
Attacks."IBM Journal of Research and Development, May 1994, pp. 243 -250.
[2] Bruce Schneier. The Blowfish Encryption Algorithm Retrieved October 25, 2008,
http://www.schneier.com/blowfish.html
[3] Diaa Salama Abdul. Elminaam, Hatem Mohamed Abdul Kader and Mohie Mohamed
Hadhoud3, “Performance Evaluation of Symmetric Encryption Algorithms,” in IJCSNS
International Journal of Computer Science and Network Security, vol.8 No.12, December
2008, pp. 280286.
[4] Nadeem, A. and Javed, M.Y., "A Performance Comparison of Data Encryption
Algorithms," IEEE Information and Communication Technologies, 2005. ICICT 2005. First
International Conference, February, 2006, pp. 84- 89. [5] Aaron E. Earle, Wireless Security
Handbook. Auerbach Publications, Boston, MA, 2005.
[6] “Data Encryption Standard,” Federal Information Processing Standards Publication No.
46, National Bureau of Standards, January 15, 1977.
[7] William C. Barker, “Recommendation for the Triple Data Encryption Algorithm (TDEA)
Block Cipher,” NIST Special Publication 800-67 Version 1.1, May 2008. [8] Daemen, J., and
Rijmen, V. "Rijndael: The Advanced Encryption Standard."D r. Dobb's Journal, March 2001,
pp. 137-139.
[9] E. Biham and A. Shamir, "Differential Cryptanalysis of the Full 16Round DES,"
Advances in Cryptology-CRYPTO '92 Proceedings, Springer-Verlag, 1993, pp. 487- 496.
[10] M. Matsui, "Linear Cryptanalysis Method for DES Cipher," Advances in Cryptology-
EUROCRYPT '93 Proceedings, Springer-Verlag, 1994, pp. 386-397.
[11] M. Matsui, "The First Experimental Cryptanalysis of the Data Encryption Standard,"
Advances in Cryptology-CRYPTO '94 Proceedings, Springer-Verlag, 1994, pp. 1-11.
[12] S. Vaudenay, “On the Weak Keys in Blowfish,” Fast Software Encryption, Third
International Workshop Proceedings, SpringerVerlag, 1996, pp. 27-32.
[13]S. Dey, K. p. kaur, Mehak and U. Kaur, "RSA and SFQ based Secure Heuristic Load Balancing
Approach for Cloud Data Centers," 2019 International Conference on Computer Communication and
Informatics (ICCCI), Coimbatore, Tamil Nadu, India, 2019, pp. 1-7. doi:
10.1109/ICCCI.2019.8821907 keywords: {cloud computing;computer centres;optimisation;public key
cryptography;resource allocation;virtual machines;cloud environment;cloud data centers;cloud
computing;secure management;cloud services;RSA;SFQ based secure heuristic load balancing
approach;start fair queuing algorithm;resource utilization;Heuristic algorithms;Cloud computing;Load
management;Security;Data centers;Dynamic scheduling;Resource management;Cloud Service
Provider (CSPs);RSA;SFQ;Load Balancing;Heuristic rules;Start Fair Queuing (SFQ);Cloudsim
3.0.3;Cloud Analyst 3.0.3}, URL:
http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8821907&isnumber=8821791
[14]S. Majumder and M. M. Rahman, "Implementation of Security Enhanced Image Steganography
with the Incorporation of Modified RSA Algorithm," 2019 International Conference on Electrical,
Computer and Communication Engineering (ECCE), Cox'sBazar, Bangladesh, 2019, pp. 1-5. doi:
10.1109/ECACE.2019.8679147 keywords: {cryptography;image coding;image enhancement;image
resolution;steganography;cryptographic algorithm;cipher text;image object;cipher pixel;lower
resolution image;grayscale image;security enhanced image steganography;modified RSA
algorithm;Ciphers;Encryption;Receivers;Standards;Gray-scale;image steganography;cryptographic
algorithm;modified RSA;median filter}, URL:
http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8679147&isnumber=8678913

You might also like