**Open Access**-
**Total Downloads**: 5 -
**Authors :**Akanksha Mathur, Arshi Riyaz, Jyoti Vyas -
**Paper ID :**IJERTCONV2IS03032 -
**Volume & Issue :**ETRASCT – 2014 (Volume 2 – Issue 03) -
**Published (First Online):**30-07-2018 -
**ISSN (Online) :**2278-0181 -
**Publisher Name :**IJERT -
**License:**This work is licensed under a Creative Commons Attribution 4.0 International License

#### Encryption of text characters using ASCII values

Encryption of text characters using ASCII values

Akanksha Mathur Gujarat University Ahmedabad, India akanmamthur@gmail.com

Arshi Riyaz

Department of Computer Science and Engineering JIET Universe, Jodhpur, India arshiriyaz@gmail.com

Jyoti Vyas

Department of Computer Science and Engineering JIET Universe, Jodhpur, India jyotivyas@jietjodhpur.com

AbstractThis paper is demonstrating the encryption and decryption of text characters using their ASCII values. This is a kind of symmetric Encryption algorithm in which same key is used for both encryption and decryption purpose.

KeywordsASCII, encryption, Decryption, ciphertext, plaintext, cryptographic algorithm

A cryptographic algorithm is a mathematical functions and unchanging set of steps to perform encryption and decryption of the original data. These algorithms work in combination with a secret key which can be a combination of alphabets, numbers, words or phrases. For the purpose of encryption, the algorithm combines the original data or the text to be encoded (plaintext which is input to the encryption process) with the secret key supplied for the encryption. This combination will yield a ciphertext (which is our desired code or we can say output). Similarly, for the purpose of decryption, the algorithm combines the encrypted data or ciphertext with may or may not be the same secret key and this combination will yield again the same plaintext. If there is any modification takes place in any of the secret key or the plaintext, the algorithm will yield a different result than before. The main objective of every cryptographic algorithm is to make it as difficult as possible to decrypt the generated ciphertext without using the key. If a really good cryptographic algorithm is used, then there is no technique significantly better than methodically trying every possible combination of key.

Introduction

This algorithm is used to encrypt data by using ASCII values of the data to be encrypted. The secret key used will be modified to another string and that string is used as a key to encrypt or decrypt the data.[3] So, it can be said that it is a

kind of symmetric encryption algorithm. In symmetric encryption algorithm, only one key is used for both encryption and decryption process. The key is transmitted to both the sender and receiver before the process of encryption and decryption. So, the secret key plays an important role and its strength depends on the length of key (in bits). The longer the length of key is, it is harder to break it and shorter the length of key is it is even easier to break it. [1] Thus it violates the security purpose of encryption. Similarly .it uses same key for encryption and decryption but by slightly modifying it.

The main limitation of this algorithm is that it will operates when the length of input and the length of key are same. That is, if the length of input is 3 then the length of key must be 3 neither less or nor more than 3.

Algorithm for encryprion process

Start

Input the string (can include numbers, alphabets and special symbols) from the user. This string is known as the plain text to be encrypted.

Get the ASCII values of each character of plain text and store them in an array asciicontent.

Find out the minimum value min from the array asciicontent. This min value is used further in the algorithm.

For I = 1 to n where n is the length of the input of the plain text

modcontent[I] = asciicontent[I] % min

If the value of mod content is greater than 16, then again perform modcontent %16, and record the places where changes occur or record the positions in record array where the value of mod content is greater than 16.

Input the string (can include numbers, alphabets and special symbols) from the user. This string is the key which is used to encrypt the plain text.\

Get the ASCII values of each character of key and store them in an array asciikey.

For I = 1 to n where n is the length of the input of the key modkey[I] = asciikey[I] % min

Take the binary values of each value of modkey.

Perform the right circular shifts of binary values n times (where n is the length of input i.e. plain text) and save them in binary array.

Add min value to each ASCII value of each character of encrypt key after shifting.

Encryptkey[I]=ASCII (Binary[I]) + min Encryptkey is the final key which is used to encrypt the plain text.

To encrypt the original data (input) or plaintext to generate ciphertext, add each mod content value to the ASCII values of final encrypt key.

Ciphertext[I]=ASCII(Excryptley[I])+modcontent[I Convert the ASCII values into their corresponding characters to get the cipher text.

Algorithm for decryption purpose

Start

Get the ASCII values of each character of cipher text in

asciicipher.

Find out the minimum from ASCII values of each character of cipher text.

Subtract ASCII values of final encrypt key from asciicipher

Difference[I]=asciicipher[I]-ASCII(Encryptkey[I]) Add 16 to the stored positions from record array where the modcontent value is greater than 16.

Add minimum to each value of difference to generate plaintext.

Here, representing some of the examples of encryption and decryption process of varying length of input (or key) say 2, 3, 4, 5.

Example 1: Input Length:- 2

Let Plain text is: – am Key is: – ab

TABLE 1. EXAMPLE 1

Encryptkey (After adding min)

101

97

Encryptkey

e

a

ASCII(Excryptley)+modcontent

101

109

Ciphertext

e

m

DECRYPTION

Cipher

e

m

ASCIICipher

101

109

minimum=101

asciifinalencryptkey

101

97

difference

0

12

asciiplain

97

109

plaintext`

a

m

Execution time: 320ms.

Example 2: Input Length: – 3

Let Plain text=bcf Key=cbc

ENCRYPTION

Input (Plain Text)

b

c

f

asciicontent

98

99

102

min=98

modcontent

0

1

4

Key

c

b

c

asciikey

99

98

99

modkey

1

0

1

binary

0001

0000

0001

Right Circular Shifts (3 times)

Shift 1

1000

1000

0000

Shift2

0100

0100

0000

Shift 3

0010

0010

0000

Encryptkey

2

2

0

Encryptkey (After adding min)

100

100

98

Encryptkey

d

d

b

ASCII(Excryptley)+modcontent

100

101

102

Ciphertext

d

e

f

DECRYPTION

TABLE 2. EXAMPLE 2.

ENCRYPTION

Input (Plain Text)

a

m

asciicontent

97

109

min=97

modcontent

0

12

Key

a

b

asciikey

97

98

modkey

0

1

binary

0000

0001

Right Circular Shifts (2 times)

Shift 1

1000

0000

Shift 2

0100

0000

Encryptkey

4

0

Cipher

d

e

f

Difference

13

4

7

0

ASCIICipher

100

101

1

02

Asciiplain

110

101

104

97

minimum=100

plaintext`

n

e

h

a

asciifinalencryptkey

100

100

98.

imated Time: 3679 ms.

Example 4:Inuput Length: -5

plaintext= pacgl Key=abcde

difference

0

1

4Est

asciiplain

98

99

10D2 .

plaintext`

b

c

fLet

Execution Time: 2098ms.

Example 3: Input Length: – 4

Let Plain Text= neha Key= abcd

TABLE 3. EXAMPLE 3

ENCRYPTION

Input (Plain Text)

p

a

c

g

l

asciicontent

112

97

99

103

108

min=97

modcontent

15

0

2

6

11

Key

a

b

c

d

e

asciikey

97

98

99

100

101

modkey

0

1

2

3

4

binary

0000

0001

0010

0011

0100

Right Circular Shifts (5 times)

Shift 1

0000

0000

1001

0001

1010

Shift 2

0000

0000

0100

1000

1101

Shift 3

1000

0000

0010

0100

0110

Shift 4

0100

0000

0001

0010

0011

Shift 5

1010

0000

0000

1001

0001

Encryptkey

10

0

0

9

1

Encryptkey

(After adding min)

107

97

97

106

98

Encryptkey

k

a

a

j

b

ASCII(Excryptley)+

modcontent

122

97

99

112

109

Ciphertext

z

a

c

p

m

DECRYPTION

Cipher

z

a

c

p

m

ASCIICipher

122

97

99

112

109

minimum=97

Asciifinal

encryptkey

107

97

97

106

98

difference

15

0

2

6

11

asciiplain

112

97

99

103

108

plaintext`

p

a

c

g

l

TABLE 4. EXAMPLE 4

ENCRYPTION

Input (Plain Text)

n

e

h

a

asciicontent

110

101

104

97

min=97

Modcontent

13

4

7

0

Key

a

b

c

d

Asciikey

97

98

99

100

Modkey

0

1

2

3

Binary

0000

0001

0010

0011

Right Circular Shifts (4 times)

Shift 1

1000

0000

1001

0001

Shift 2

1100

0000

0100

1000

Shift 3

0110

0000

0010

0100

Shift 4

0011

0000

0001

0010

Encryptkey

3

0

1

2

Encryptkey (After

adding min)

100

97

98

99

Encryptkey

d

a

b

c

ASCII(Excryptley)+

modcontent

113

<>101 105

99

Ciphertext

q

e

i

c

DECRYPTION

Cipher

q

e

i

c

ASCIICipher

113

101

105

99

minimum=99

Asciifinalencryptkey

100

97

98

99

Execution Time:: 3780ms.

The proposed algorithm has the following limitations:-

More Execution time

Key Length and length of plain text must be same.[3]

If it is applied on any file then the length of key is equal to the length of file which is not considered as good

In the future wok related to proposed algorithm, the limitations of proposed algorithm are overcome by

Encrypting and decrypting data with may or may not be same key length size in comparison with input size.

Appling on files of different length

Applied on images

Gurjeevan Singh, Ashwani Kumar Singla, K.S. Sandha, Throughput Analysis of Various Encryption Algorithms, International Journal of Computer Science and Technology, Vol. 2, Issue 3, Septemver 2011.

Diaa Salama Abd Elminaam, Hatem Mohamed Abdual Kader, and Mohiy Mohamed Hadhoud, Evaluating the Performance of Symmetric Encryption Algorithms, International Journal of Network Security, Vol.10, No.3, PP.216222, May 2010.