Content uploaded by Nitin Gupta
Author content
All content in this area was uploaded by Nitin Gupta on Aug 28, 2015
Content may be subject to copyright.
Security aspects of the Extended Playfair cipher
Shiv Shakti Srivastava & Nitin Gupta
Department of Computer Science and Engineering
National Institute of Technology
Hamirpur, India
shivshakti45@gmail.com , nitin@nitham.ac.in
Abstract— The well known multiple letter encryption cipher is
the Playfair cipher. Here the digrams in the plaintext are
treated as single units and converted into corresponding cipher
text digrams. However because of the drawbacks inherent in
the 5*5 Playfair cipher which adversely affects the security we
proposed an 8*8 Playfair cipher and then coupled it with
LFSR (Linear Feedback Shift Register) to make the traditional
Playfair cipher at par with the advanced ciphers available like
AES and DES. For details one can refer to [1]. Now for all
practical applications, performance and speed are also prime
concerns besides security. The LFSR not only enhances the
security upto a considerable level by generating random
sequences but also provides a much faster rate of encryption
and decryption. This paper deals in with the security issues of
the new proposed system. Various types of cryptography
attacks have been taken under consideration and the resistance
of the proposed cipher to all these attacks has been discussed.
At the end we find that the proposed cipher is not vulnerable
to attacks.
Keywords- Playfair cipher, matrices, Special symbols, Random
number, crptanalysis,brute force,LFSR.
I. INTRODUCTION
The Playfair cipher shows a great advancement over the
monoalphabetic ciphers. The identification of digrams is
more difficult than individual letters.In the Monoalphabetic
cipher, the attacker searches in 26 letters only.But by using
the Playfair cipher, the attacker has to search in 26 x 26 =
676 digrams.The relative frequencies of individual letters
exhibit a much greater range than that of digrams, making
frequency analysis much more difficult.
Some of the peculiarities of Playfair cipher can be-
xNo plaintext letter can be represented in the cipher by
itself.
xAny given letter cannot represent a letter that it
combines with diagonally.
xIt is twice as probable that the two letters of any pair are
at the corners of a rectangle, than as in the same row or
column.
xWhen a cipher letter has once been identified as a
substitute for a plaintext letter, their is a 20% chance
that it represents the same plaintext letter in each other
appearance.
These peculiarities make the cryptanalysis of Playfair cipher
an easy task. The cryptanalysis of the Playfair cipher is also
aided by the fact that a diagram and its reverse will encrypt
in a similar fashion. That is, if AB encrypts to XY, then BA
will encrypt to YX [2][5]. So by looking for words that
begin and end in reversed diagrams, one can try to compare
them with plaintext words that are similar.
In recent investigation[1] we have modified the Playfair
cipher by using 8x8 matrix along with LFSR for random
number generation. In our research, we assume that the
characters of the plaintext belong to the set of ASCII
characters denoted by the codes 0 to 127. Here, our interest
is to see that the strength of the cipher is enhanced
significantly and no cryptanalytic attack is possible on
account of the modifications. For this we try to analyze all
the drawbacks and security loopholes and provide a new
cipher. In this paper we have tried to deal in with different
types of attacks that generally pose threats to any
cryptography system. The resistance of our proposed system
to these well known attacks has been visualized and we find
that the cipher turns out to be a strong one and less prone to
threats.
II. RELATED WORK
In recent times [1] we extended the playfair cipher using
8*8 matrix and hence it would be using 64 grids. The
proposed system not only encrypts the alphabets but also the
numerals and special characters. It also shows space
between words where required. The system uses different
blocks for different alphabet, numerals and symbols. In
Proposed System, | is used at the time of encryption to
provide space between two words, ^ is used for stuffing
between two alphabets if they are repeated in a pair and ^
will also be used to put at the end to get the last alphabet in
pair if the total length at comes out to be odd. At the time of
decryption | will be replaced by blank space of one alphabet
and the symbol ^ will be discarded. Rules for encoding and
decoding will be same as that for existing traditional
playfair cipher.
Selecting SHIV@SHAKTI as keyword we can have the
matrix as follows.
2011 International Conference on Communication Systems and Network Technologies
978-0-7695-4437-3/11 $26.00 © 2011 IEEE
DOI 10.1109/CSNT.2011.37
144
Using the 8x8 matrix and the defined keyword we can
convert any plaintext into corresponding intermediary
cipher text which acts as input for the LFSR after being
converted into equivalent ASCII code. The ASCII codes are
converted into their binary equivalent before being fed into
LFSR mechanism. Actually for these binary sequences we
have to apply LFSR in order to get the permuted sequence
of bits. The schematic diagram of the encryption and
decryption is given below. OPOL is the overall process of
LFSR and has been illustrated at the end of the paper.
Fig 1: Encrytion
Fig 2: Decrytion
LFSR is a shift register whose input state is a linear function
of its previous state The only linear functions of single bits
are XOR and inverse-XOR, thus it is a shift register whose
input bit is driven by the exclusive-or (XOR) of some bits of
the overall shift register value. Initially we have to decide a
seed value for the LFSR. Seed value is basically the initial
values held in the register design. The seed value can even
act as the secondary key in the cipher because any change in
its value results in the change of overall output sequence.
We make use of 7 bit LFSR with tapping applied at
preferred places.
III. CRYPTOGRAPHIC ATTACKS
Cryptographic attacks are designed to focus on the
drawbacks of cryptographic algorithms and thus subvert the
security. There are six related cryptographic attack
methods.These methods are used as the foundation of
cryptographic attacks.
plaintext-based attack ciphertext-based attack
known plaintext Ciphertext-Only
chosen plaintext Chosen Ciphertext
Adaptive Chosen Plaintext Adaptive Chosen
Ciphertext
Known Plaintext and Ciphertext-Only Attacks-
A known plaintext attack is an attack where a cryptanalyst
has access to a plaintext and the corresponding ciphertext
and seeks to discover a correlation between the two. This
type of attack is possible with encryption of documents
which are known to follow certain templates.
A ciphertext-only attack is an attack where a cryptanalyst
has access to a ciphertext but does not have access to
corresponding plaintext.
Chosen Plaintext and Chosen Ciphertext Attacks-
A chosen plaintext attack is an attack where a cryptanalyst
can encrypt a plaintext of his choosing and study the
resulting ciphertext. This is most common against
asymmetric cryptography, where a cryptanalyst has access
to a public key. A chosen ciphertext attack is an attack
where a cryptanalyst chooses a ciphertext and attempts to
find a matching plaintext. This is also often performed on
attacks versus public key encryption; it begins with a
ciphertext and searches for matching publicly-posted
plaintext data.
Adaptive Chosen Plaintext and Adaptive Chosen Ciphertext
Attacks-
In both adaptive attacks, a cryptanalyst chooses further
plaintexts or ciphertexts (adapts the attack) based on prior
results.
After a brief discussion over the cryptographic attacks we
now visualize our proposed ciphers security in terms of
these attacks.
IV. SECURITY ASPECTS OF CIPHER
The strength of the encryption method comes from the
algorithm, secrecy of the key, length of the key,
initialization vectors, and how they all work together. When
strength is discussed in encryption, it refers to how hard it is
to figure out the algorithm or key, whichever is not made
public.
Brute Force Attack-Keys play a major role in determining
the secrecy level of numerous cryptographic primitives.
Accessing them allows an attacker to perfectly usurp the
owner’s identity. Consequently, protecting keys must be an
essential topic when cryptography is employed.
Nevertheless, in many cases keys, or more generally secrets
Read Plaintext
,
Keyword
Construct 8x8 matrix with keyword and
encr
yp
t
p
laintext with it
The ASCII values of ciphertext from 8x8
matrix converted into 7 bit
b
inar
y
e
q
uivalent
Read Seed value, OPOL
Final Ci
p
hertext
Read Ci
p
hertext, Ke
y
word
(
OPOL
)
-1
Binary sequensec are converted into their
ASCII values taking 7 bits at a time
Decrypt values corresponding to ASCII
usin
g
8x8 matrix and known
p
alintext
Final Plaintext
145
are(deliberately or not) mishandled. A brute force attack
systematically attempts every possible key. It is most often
used in a known plaintext or ciphertext-only attack. In the
proposed system we use 8x8 matrix for encryption and
decryption purpose using the same old principles as in 5x5
playfair cipher. Instead of having 26*26 digrams the
attacker has to now search in 64*64=4096 digrams. This
surely somewhat increases the resistance to brute force
attack. The LFSR used later on initially has a seed value.
This seed value is the values stored in the the registers
initially which is known to the user only. This seed value
acts as secondary key and and the whole process of
permutation depends upon it. Depending upon the size of
the LFSR the keyspace varies.In our system we took 7 bit
LFSR thus giving a key space of 27. Altogether the keyspace
obtained is of the order 64*64*27=219 which is quite
substantial value.
In our proposed cryptosystem we have used two keys
inspite of one and both are completely different in their
nature because one uses English alphabets and the other
uses binary bits. This ensures further security against the
attacker . Moreover each of the element in the matrix is
represented by 7 bits in binary therefore the size of our
plaintext and cipher text for n element plaintext would be
n*7. Considering a very small plaintext of 16 bits we will
have the length of ciphertext as 16*7=112 binary bits and
the length of plaintext is also 112 bits. Thus, in order to
arrive at the cipher text, thesize of the plaintext space which
is to be searched is 2112(ѩ1033.6). The time required for this
is enormously large. Hence, this sort of ciphertext only
attack is ruled out.
Frequency Analysis- In cryptanalysis, frequency analysis is
the study of the frequency of letters or groups of letters in a
ciphertext. Frequency analysis is based on the fact that, in
any given stretch of written language, certain letters and
combinations of letters occur with varying frequencies.
Moreover, there is a characteristic distribution of letters that
is roughly the same for almost all samples of that language.
On an average, the probability of occurrence of any
particular element in 5x5 Playfair matrix is
1/26=0.0384.Whereas the probability of occurrence of an
element in 8x8 playfair matrix is 1/64=0.0156. This value is
far less when compared and frequency analysis is now a
tougher job.
Confusion and diffusion-Confusion involves making the
statistical relation between plaintext and ciphertext as
comples as possible. Diffusion refers to the property that the
redundancy in the statistics of the plaintext is dissipated in
the statistics of the ciphertext[2],[6]. In our proposed sytem
the plaintext is known at the beginning whereas the
ciphertext at the end and in the between we have the
procedure which not only includes substitution through 8x8
cipher but also randomization through LFSR. The
randomization can even be extended to higher levels
depending upon the overall design of LFSR. Therefore the
correlation between plaintext and ciphertext is not possible.
Thus, breaking the cipher in the case of the known
plaintext attack also is impossible. Based on these facts are
the linear and differential cryptanalysis and it can be easily
inferred that it would be a tough job for an attacker to try
out these analysis over our cryto-system.
Meet-in-the-Middle Attack- Since our system uses two keys
for encryption hence meet-in-the-middle attack can be used
by attackers. The meet-in-the-middle attack is a known
plaintext attack; the cryptanalyst has access to both the
plaintext and resulting ciphertext. The cryptanalyst wants to
recover the two keys (called Key1 and Key2) used for
encryption.Key1 corresponds to the key used along with
8x8 matrix whereas key2 is the seed value of the LFSR.This
process of attack involves a brute force attack on key1,i.e.
encrypting the given plaintext with all possible keys
obtained through brute force and storing the keys and their
corresponding cipher text in a table. This cipher text
obtained is the intermediary cipher text. The analyst then
brute forces Key2, decrypting the final cipher text using 27
combinations of LFSR.
When the 2nd brute force attack decrypts an intermediate
ciphertext that is in the table, the attack is complete and both
keys are known to the cryptanalyst. Our cryptosystem can
be considered vulnerable to this type of attack and further
improvement might be required.
Pseudorandom generator-Good keys are random-bit strings
generated by some automatic process. Generate the key bits
from either a reliably random source or a cryptographically
secure pseudo-random-bit generator. We have used the
concept of LFSR which not is effective in generating
random numbers but is also quite fast.It is held responsible
for creating random subkeys. LFSR actually acts as a
pseudorandom sequence generator that feeds values to the
algorithm, which in turn creates the onetime pad and then
XORs it to the message. A one-time pad is unbreakable if
the same pad is never used more than once and the bits used
in the key are truly random. This ensures that even if an
attacker intercepted a message, he would not be able to
decrypt it because he would have to have the one-time pad
value. If an attacker was actually successful in intercepting a
copy of the one-time pad key, it would not be useful
because the pad is only good for a one-time use.
V. ANALYSIS AND RESULT
In cryptography, the avalanche effect refers to a desirable
property of cryptographic algorithms, typically block
ciphers and cryptographic hash functions. The avalanche
effect is evident when an input is changed slightly (for
example, flipping a single bit) the output changes
significantly. In the case of quality block ciphers, such a
small change in either the key or the plaintext should cause
a drastic change in the cipher text. We implemented our
proposed system in C++ language and carried out this
146
avalanche analysis on several test cases. For one such test
case the result is shown below-
The input given to LFSR assumes the following binary
representation.
101001110010011001010101101110100101010011101010
11111011100111’0’10101001001111111110110010001000
11110100101010111 .
(X)
Now we simply change 1 bit in the the input to LFSR.
The binary representation now assumes the form-
101001110010011001011101101110100101010011101010
11111011100111’1’10101001001111111110110010001000
11110100101010111.
(Y)
The output sequence corresponding to (X) and (Y) are –
101010110011100111000100011001101101001110100111
010011001010110100010101100111000001101010010001
1110000100110001.
And
101010110011100111000100011001101101001110100111
010011001010110011101010011000111010010101101110
0001111011001110.
These output sequences differ by 48 bits which is quite
substantial. This shows and proves that the cipher is a strong
one.
VI. CONCLUSION
Cryptography is the heart of security. Understanding
cryptographic attacks is important to the science of
cryptography, and it serves to improve cryptographic
algorithms. While strong cryptography does not guarantee
strong security, weak cryptography certainly guarantees
weak security.
Equally important is the protocol and management involved
in implementing the cryptography.In this paper, we dealt in
with the security aspects of the proposed cipher and found
that it is considerably secure against attacks. Moreover from
the analysis made we conclude that the cipher is potentially
a strong one.
REFERENCES
[1] Shiv Shakti Srivastava, Nitin Gupta and Rajaram jaiswal “Modified
Version of Playfair Cipher by using 8x8 Matrix and Random Number
Generation” in Proceedings of IEEE 3rd International Conference on
Computer Modeling and Simulation (ICCMS 2011), Mumbai, pages
615-617, January, 2011.
[2] William Stallings, Cryptography and Network Security Principles and
Practice. Second edition, Pearson Education.
[3] Mohit Kumar, Reena Mishra, Rakesh Kumar Pandey and Poonam
Singh “Comparing Classical Encryption With Modern Techniques”in
proceedings of S-JPSET, Vol. 1, Issue 1,2010
[4] Packirisamy Murali and Gandhidoss Senthilkumar, Modified version
of Playfair cipher using Linear Feedback Shift Cipher, International
Conference on Information Management and Engineering
ICIME,pp.488-490,2009.
[5] Johannes A.Buchmann, Introduction to Cryptography.Second
Edition, Springer –Verlag NY, LLC, 2001.
[6] Behrouz A. Forouzan, Cryptography and Network Security. Special
Indian Edition, The McGraw- Hill companies, New Delhi,2007.
[7] Dhiren R.Patel, Information Security Theory and Practice. First
Edition, Prentice-Hall of India Private Limited, 2008.
[8] Anne-Canteaut(Editor)“Ongoing Research Areas in Symmetric
Cryptography” ECRYPT, 2006.
[9] Lausanne, Statistical Cryptanalysis of Block Ciphers,Doctoral Thesis,
EPFL, 2005. IJCSNS International Journal of Computer Science and
Network Security, VOL.8 No.4, April 2008290.
[10] B. Schneier, J. Kelsey, “Unbalanced Feistel networks and block
cipher design,” Fast Software Encryption (FSE’96), LNCS 1039, D.
Gollmann, Ed., Springer-Verlag, 1996, pp. 121–144.
LFSR LFSR LFSR
Fig 3: OPOL ( Overall process of LFSR )
LFSR
7 bit binar
y
out
p
ut 7 bit binar
y
out
p
ut 7 bit binar
y
out
p
ut 7 bit binar
y
out
p
ut
ct11 ctn2
ct21ct12
7 bit binary
e
q
uivalent of A11
7 bit binary
e
q
uivalent of A11 7 bit binary
e
q
uivalent of A11
7 bit binary
e
q
uivalent of A11
{
l1
,
l2...l7
}
{
l1
,
l2...l7
}
{
l1
,
l2...l7
}
Seed Value
..……
………
………
147