Está en la página 1de 4

Innovative Enhancement Of The Caesar Cipher

Algorithm For Cryptography


Shreyank N Gowda
kini5gowda@gmail.com

AbstractThe Caesar Cipher algorithm for cryptography is one


of the oldest algorithms. Now much newer algorithms have The Caesar cipher is one of the simplest and one of the earliest
arrived that are much more secure, however in terms of speed of known ciphers. It is a type of substitution cipher, in which
execution Caesar cipher algorithm is still the fastest owing to its each letter in the plaintext is made to shift by a certain number
simplicity. However the algorithm is extremely easy to crack. of places down the series of the alphabet. For example, a shift
This is because in this algorithm each character of a message is of the 2 would mean A would then be replaced by the letter C,
always replaced by the same fixed character that has been B would be replaced by the letter D, and so on. This method is
predetermined. To improve the algorithm and enhance it's named after Julius Caesar, the king, who it is claimed used this
security feature, a few changes can be added. This paper method to communicate with his generals.
proposes an enhancement to the existing algorithm by making
use first of a simple Diffie-Hellman key exchange scenario to
obtain a secret key and later using simple mathematics to ensure More complex encryption schemes have been developed in
the encryption of data is much more safer. Once a private shared recent times such as the Vigenre cipher[2] which employs the
key is obtained by making use of the Diffie-Hellman method, the Caesar cipher as just one part of the entire encryption process.
key is subject to the mod operation with 26 to obtain a value less The widely known ROT13[3] 'encryption' is nothing but a
than or equal to 26, then the current character is taken and to Caesar cipher with an offset of 13. The problem with the
this the key value obtained is added to obtain a new character. Caesar cipher is that it offers no communication security, and
For any character in the 'x' position the key is simply first it can be easily broken.
multiplied with 'x' and then mod is done to obtain the encrypted
character. So 2nd character of the message is multiplied with 2, To pass an encrypted message from one person to another
third character with 3 and so on. This enhances the security and person, it is first necessary that both the parties have the 'key'
also does not increase the time of execution by a large margin. for the cipher so that the sender may then encrypt information
using this key and the receiver may decrypt it again using the
Keywords-Caesar-Cipher, Diffie-Hellman, Security
exact same key. For the caesar cipher, the key is nothing but
the number of characters to shift the cipher alphabet.
I. INTRODUCTION
Data privacy and security presently make up one of the Following is an example, of how the Caesar cipher works. It is
most important features of a person's life. One cannot done using a key of the value 1.
communicate securely anymore. There is always some
eavesdropper or a chance of leak of information. Cryptography Plaintext: This is not me.
deals with helping to make data more secure.
Cryptography along with protection of data from theft or Cipher: Uijt jt opu nf.
alteration, can also be used for user authentication[1]. The
modern day cryptographic methods are of two types: It is easy to see, how each character in the plaintext is simply
symmetric key cryptography and public key cryptography. shifted up the alphabet. Decryption is just as easy, by using an
Symmetric key cryptography, is the method where the same offset of -1.
key is used for both the encryption phase and the decryption
phase. Public key cryptography is the method where only one Cipher: Mjgf jt bnbajoh.
key is used for encryption process and another different key is
used for the decryption process. Plaintext form: Life is amazing.
The main advantage of symmetric key cryptography is that
it becomes much easier to take care of the key relative to public Obviously if a different key is used, then the cipher alphabet
key method. Since only one key is used for both encryption as will be shifted a different amount. As can be seen the
well as for decryption purpose it becomes easy to maintain it. simplicity of the algorithm makes it vulnerable to attacks,
The key however should at no cost be revealed to the outside since there is are repetitions and it becomes easy to decrypt the
world as it is the most important feature of this type of encrypted information.
cryptography.

978-1-5090-3480-2/16/$31.00 2016 IEEE


Diffie-Helman[4] is a method of generating a shared secret an innovative enhancement of DES called the 3-DES algorithm
between two parties, in such a way that the secret can't be seen exists as well.
by just observing the communication. This is particularly RSA[8] is an algorithm used by modern computers to
useful because you can use then this technique to create an encrypt and decrypt messages. It is an asymmetric
encryption key with someone, and then start encrypting your cryptographic algorithm. Asymmetric means that there are two
traffic with that same key. And even if the traffic is recorded different keys. This is also called public key cryptography,
and later analyzed, there is absolutely no way to figure out because one of them can be given to everyone.
what the key was, even though the exchanges, that created it
may have been visible. The DES (Data Encryption Standard) algorithm is one of
the most widely used encryption algorithm in the world[9].
But even though it makes use of the same important principles For many years, and among many people, "secret code
as public key cryptography, it is not asymmetric cryptography making" and DES have been synonymous.
because nothing is being encrypted or decrypted during the
exchange of key. It is, nonetheless, an essential building- 3-DES[10] is similar to the standard DES algorithm, it is
block, and was in fact the foundation upon which asymmetric actually the DES algorithm implemented using 3 different
cryptography was later built.
keys to enhance the security level of the algorithm. The
original DES cipher's key size of 56 bits was generally
II. BACKGROUND sufficient when that algorithm was designed, but the
Before getting to the proposed algorithm, let us look at availability of increasing computational power made brute-
some of the recent developments in cryptographic algorithms. force attacks feasible. Triple DES provides a relatively simple
method of increasing the key size of DES to protect against
In [5] the authors presented a new symmetric key algorithm such attacks, without the need to design a completely new
using the extended MSA method called the DJSA symmetric block cipher algorithm.
key algorithm. The advantage of the algorithm is that it is
almost impossible to break the decrypted information without
its key matrix being compromised. AES is an iterative[11] rather than Feistel cipher. It is based
on substitutionpermutation network. It comprises of a
In terms of the advancement or enhancement of the
series of linked operations, some of which involve replacing
Caesar's cipher algorithm, nothing much has been done. Most
new algorithms involve the change of existing algorithms by inputs by specific outputs (substitutions) and others involve
adding efficiency. shuffling bits around (permutations).
In [6] the authors, proposed an algorithm based on Modulo
37. This algorithm makes use of two keys namely k1=positive III. PROPOSED ALGORITHM
number, k2=negative number. Next they find the inverse of
both keys using modulo 37, giving 'K1, K2. Using these keys First a key exchange happens between the two users, say A
encryption is done. and B. This key exchange is a slight modification of the Diffie-
Hellman method. Following are the steps followed.
In [7] the author first generates the ASCII value of the
character and then converts that into binary. The 8 digit binary Step 1: Start
number is then reversed. Any 4 digit number is then taken as a Step 2: Choose two different private keys for A and B and a
divisor. The reversed number is divided by the 4 digit number. shared secret key for both A and B
The remainder is stored in the first 3 digits & the quotient in Step 3: Send the value of private key multiplied with shared
the next 5 digits. If any of these are less then 3 and 5 digits
respectively we need to add required number of 0s (zeros) in key from A to B and similarly from B to A
the left hand side. Example consider letter T and taking divisor Step 4: Multiply the obtained value with the private key to
as 1000 we get the encrypted character as E. obtain a key called the shared crypto key, let this value be
Many such algorithms have been proposed. Mostly called 'z'
modifying the existing algorithms. However the proposed Step 5: Stop
algorithm would always take more time in terms of execution.
This is understandable as to increase security of data more and As can be seen, the algorithm is similar to the Diffie-Hellman
more complex algorithms are being developed.
method, however the numbers do not have to be prime in
The changes that have been developed are mostly done to nature and the key exchange is much more simpler.
enhance the security of the existing algorithm, but each
modification is being done at the compromise of the speed of
execution. Consider an example, Let's assume there are two users A and
B. Let's say that they share a public key is present it's value is
In terms of the most popular encryption algorithms
10. All keys do not have to be prime, as was the case of
presently are RSA, AES, DES and blowfish algorithms. Also
Diffie-Hellman. The fact that the numbers are not prime
makes it even harder to factorise out the private keys for any else store x = z / k then find m = z + x and store k = m mod 26
intruder. Now consider A has a private key of 14. So A sends and shift character by k
the value 140 (private multiplied with shared) to B over the Step 5: Stop
insecure channel. Now B also has a private key, let us say 16.
So B sends 160 to A. Now A gets the value of shared crypto Figure 1 explains the full work flow of the algorithm.
key as 140 multiplied with 16 which is 2240. B
simultaneously calculates the key value as 160 multiplied with Start
14 which is the same, 2240. So now we can declare that 2240
is the shared crypto key.
Perform key exchange, store
Now that the most important part of the algorithm is done, the shared key as 'z'
exchange of keys, let us look at how using this key we modify
the existing algorithm of Caesar Cipher. For first character shift by z
mod 26 and store k= z mod 26
Let us continue with the example above, the shared key is
2240. Say we want to encrypt the word "hi".

So first we perform a mod operation of 2240 with 26. We get Is the full
an output of 4. So the letter 'h' is replaced by shifting 4 in the message Yes
Stop
series of alphabet. Hence 'h' is replaced by 'i'. over?

Next we divide the key by the value we previously obtained


i.e 4 and add the quotient of this division to the key again. So
quotient of 2240 divided by 4 is 560. No

Adding 2240 with 560 we get 2800. 2800 mod 26 gives us 18.
So 'i' is replaced with 'a'. So the encrypted word becomes "ia". Is
character Yes Replace blank space
There is one exception which has to be handled. If the key blank with kth alphabet
space?
mod 26 is zero we add 1 to the key. Another exception to be
considered is the use of a blank space.

In this algorithm if a blank space is encountered it is replaced No


by the previous value of the mod function as that number in
Store x = z/k, then m=z+x
the series of the alphabet.
and k=m mod 26, then shift
character by k and move to
So if after "hi" there is a space, using above example the space next character
is replaced by 18th character in the alphabet which is 'r'.

Figure 1. Flowchart of algorithm


Now let us look at the algorithm step by step to get a better
understanding.
IV. EXPERIMENTAL ANALYSIS AND RESULTS
To determine how efficient, the algorithm could be, it is
Step 1: Start
tested against two of the most common encryption algorithms,
Step 2: Key Exchange takes place and shared crypto key say the AES and DES algorithms. Table I shows the time needed
'z' is obtained for execution for all 3 algorithms in terms of the encryption
Step 3: For first character shift by z mod 26, store k = z mod part for files of different sizes.
26 TABLE I. Comparison of time for encryption
Step 4: Now for second character onwards repeat the Size of
Time of Encrpytion
following till the end S.No File
(kB)
if character is space replace by kth character of alphabet Proposed AES DES
Size of
Time of Encrpytion ACKNOWLEDGMENT
S.No File
(kB) Proposed AES DES Any achievement, be it scholastic or otherwise does not
1. 5 0.114 0.739 0.765
depend just on the individual efforts of a person but also on the
guidance, encouragement and cooperation of intellectuals, elders
2. 10 0.501 1.794 2.165 and friends. A number of personalities, in their own capacities
3. 20 2.014 3.768 3.956 have helped me in carrying out this project work. I would like to
take this opportunity to thank them all.
I would like to thank the Head Of Department, Computer
Table II shows the comparison for the decryption part of Science And Engineering, Dr. Shoba G for invaluable advise and
the algorithm. guidance during this work along with all the faculty members of
TABLE II. Comparison of time for decryption the department.
I would also like to thank my parents and brother along
Size of with my friends for their constant support.
Time of Encrpytion
S.No File
(kB) Proposed AES DES
REFERENCES
1. 5 0.125 0.747 0.785

2. 10 0.564 1.998 2.215 [1] M. Abdalla, J. H. An, M. Bellare, and C. Namprempre, From
identification to signatures via the Fiat-Shamir transform: Necessary and
3. 20 2.098 3.782 3.971 sufficient conditions for security and forward-security, IEEE Trans. Inf.
Theory, vol. IT-54, no. 8, pp. 36313646, Aug. 2008
As can be seen from the results the proposed algorithm is [2] Mohammed, Al-Amin, and Abdulrahman Olaniyan. "Vigenere Cipher:
giving a significantly faster speed of execution for much Trends, Review and Possible Modifications." International Journal of
Computer Applications 135, no. 11 pp 46-50, Feb 2016.
smaller files than that would be used for real time
[3] Sanchez, J., Correa, R., Buena, H., Arias, S. and Gomez, H.,
execution. "Encryption techniques: A theoretical overview and future proposals"
CONCLUSION in Third International Conference on eDemocracy & eGovernment pp.
60-64 March 2016.
A cryptographic algorithm is considered efficient enough only
[4] Diffie, Whitfield, Paul C. Van Oorschot, and Michael J. Wiener.
when it has enough guarantee given in terms of security of "Authentication and authenticated key exchanges." Designs, Codes and
some data. But while security does it matter, the time of cryptography 2, no. 2 pp107-125, 1992.
execution is also equally important since it should not take too [5] D. Chatterjee, J.Nath, S. Dasgupta, A.Nath "A new Symmetric key
much time to execute a particular algorithm. The proposed Cryptography Algorithm using extended MSA method: DJSA
algorithm as can be seen from the results, provides much symmetric key algorithm", 2011 International Conference on
Communication Systems and Network Technologies, pp 89-94, June
better results than the ones that have are most widely used. 2011.
Also it is an advance of the standard Caesar cipher by [6] Prakash Kuppuswamy, Dr. Saeed Q Y Al-Khalidi, "Implementation of
providing more security and also ensuring character such as Security through Simple Symmetric Key Algorithm Based On Modulo
blank space is also hidden. It maintains the essence of the 37", International Journal of Computers & Technology, Volume 3, pp.
Caesar cipher algorithm in the sense that it ensures quick 335-338 OCT 2012.
encryption and provides greater security which is an added [7] Ayushi, "A Symmetric Key Cryptographic Algorithm" International
Journal of Computer Applications, Volume 1, pp 1-4 2010.
bonus.

También podría gustarte