0% found this document useful (0 votes)
61 views7 pages

Text Encryption Algorithms Based On Pseudo Random Number Generator

Uploaded by

Dinesh Oswal
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)
61 views7 pages

Text Encryption Algorithms Based On Pseudo Random Number Generator

Uploaded by

Dinesh Oswal
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/ 7

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/272475087

Text Encryption Algorithms based on Pseudo Random Number Generator

Article  in  International Journal of Computer Applications · February 2015


DOI: 10.5120/19507-0756

CITATIONS READS

17 1,898

2 authors:

Mina Mishra Vijay H Mankar


Christian College of Engineering & Technology Government Polytechnic Nagpur, India
14 PUBLICATIONS   58 CITATIONS    75 PUBLICATIONS   1,025 CITATIONS   

SEE PROFILE SEE PROFILE

Some of the authors of this publication are also working on these related projects:

Electronic Mini Lab View project

Anti-Phising View project

All content following this page was uploaded by Mina Mishra on 18 February 2015.

The user has requested enhancement of the downloaded file.


International Journal of Computer Applications (0975 – 8887)
Volume 111 – No 2, February 2015

Text Encryption Algorithms based on Pseudo Random


Number Generator
Mina Mishra V.H. Mankar
Ph. D. Scholar Lecturer
Electronics & Telecommunication, Nagpur Department of Electronics Engineering,
University, Nagpur, Maharashtra, India Government Polytechnic, Nagpur,
Maharashtra, India

ABSTRACT plaintext and key sensitive test. Known plaintext attack is also
This paper presents algorithms for encryption and decryption performed by taking into consideration a small string of
developed using pseudo random number generator (PRNG) plaintext and the complete cipher text for small text. Simple
and non-Linear functions. PRNG used in the work are matlab pseudorandom number generator like matlab random number
random number generator (RNG) and Linear congruential generator (RNG) and linear congruential generator (LCG)
generator (LCG). The developed algorithms are named have been used here. The developed algorithms are named
according to PRNG used in it. State of PRNG is considered as according to PRNG used in it.
secret key of the cipher. The encryption schemes have been The analysis is performed on different keys selected randomly
cryptanalyzed for four different methods to test its strength from key space for various texts and files. Key sensitivity up
like key space analysis, plaintext and key sensitive test. to 50 % and plaintext sensitivity ranging from 3% to 50 %
Known plaintext attack is also performed by taking into have been obtained in the developed ciphers. It is concluded
consideration a small string of plaintext and the complete that proposed encryption algorithms have strength against
cipher text for small text. The analysis is performed on linear, differential and statistical attacks.
different keys selected randomly from key space for various
texts and files. The rest of the paper is organized as follow. Section II,
presents the brief introduction of PRNG‟s used in the
Key sensitivity up to 50 % and plaintext sensitivity ranging developed algorithm. Next section presents and discusses
from 3% to 50 % have been obtained in the developed about the algorithm. In section IV, analysis and results have
ciphers. It is concluded that proposed encryption algorithms been discussed. Section V gives conclusion of the work.
have strength against linear, differential and statistical attacks.
2. PSEUDORANDOM NUMBER
Keywords
Cryptography, Pseudo random number generator (PRNG),
GENERATOR
Random number generator, Linear Congruential Generator. PRBG plays an important role in cryptography. They have
been frequently used in the designing of the ciphering
1. INTRODUCTION methods. Two of the simple PRBG used in designing of
Cryptography has remained important over the centuries, used encryption algorithm have been discussed in brief here:
mainly for military and diplomatic communications. With the A. Random Number Generator (RNG)
advent of the internet and electronic commerce, cryptography Matlab Rand produces uniformly distributed pseudorandom
has become vital for the functioning of the global economy, numbers, scalar value drawn from a uniform distribution on
and is something that is used by millions of people on a daily the unit interval.
basis. Various schemes of encryption using different
techniques have been proposed in recent years. The Pseudo Rand („twister‟, k), r = rand, produces a pseudorandom
random number generators have been used for design of number corresponding to state k, which is the seed (also
ciphers and found to be fundamental tool in many known as initial condition) of generator, acting as key for
cryptographic applications like key generation, encryption, cryptosystem.
masking protocols and for internet gambling [1]- [4]. B. Linear Congruential Generator (LCG)
A pseudorandom number generator (PRNG), also known as a A Linear Congruential Generator (LCG) represents one of the
deterministic random bit generator (DRBG) is an algorithm oldest and best-known pseudorandom number generator
for generating a sequence of numbers that approximates the algorithms. The generator is defined by the recurrence
properties of random numbers. The sequence is not truly relation:
random in that it is completely determined by a relatively x(k+1) = (ax(k)+b) mod c
small set of initial values, called the PRNG's state, which
includes a truly random seed. Good statistical properties are a Where, x(k) is the sequence of pseudorandom values, and c,0
central requirement for the output of a PRNG, and common < c - the “modulus”, a, 0 < a < c - the “multiplier”, b, 0 < = b
classes of suitable algorithms include linear congruential < c - the "increment”, x0, 0 < = x0 < c - the “seed” or” start
generator, lagged fibonacci generator, and linear feedback value” are integer constants that specify the generator. The
shift register [5], [6]. period of a general LCG is at most c, and for some choices of
a much less than that. Provided that b is nonzero, the LCG
This paper aims to develop a number of algorithms for will have a full period for all seed values if and only if:
encryption/decryption using PRNG‟s and non-linear
functions. The encryption techniques are crypt analyzed for  b and c are relatively prime,
linear and differential attacks to test their validity. Various
methods of cryptanalysis used in this work are key space,  ( a -1) is divisible by all prime factors of c,

1
International Journal of Computer Applications (0975 – 8887)
Volume 111 – No 2, February 2015

 (a -1) is a multiple of 4 if c is a multiple of 4. A. Modified RNG Method:


Encryption Algorithm:
Parameter b is the best choice as encryption key for chaotic Step-1. Input plaintext as p, key as k.
cryptosystem.
Step-2. Convert p into ASCII form.
3. ENCRYPTION AND DECRYPTION
Step-3. Read length of plaintext as n.
ALGORITHM
This section discusses the algorithms of various encryption Step-4. Read index of iterations as i and index of length of
methods. Encryption process for each of the method has been plaintext as m.
explained using algorithm. Decryption process is just reverse Step-5.
of the encryption process. State of the PRNG‟s is used as a
secret key in the method. (a) For i = 1, do following steps:
A. RNG Method i. Convert each number into its binary form, which
Encryption Algorithm: forms matrix of dimension containing rows equal to
Step-1. Read the plain text as p and key as k, which is the the length of text and number of columns is eight.
state of the random number generator.
ii. Above matrix dimension is changed into dimension
Step-2. Convert each text into its ASCII values. where no. of rows is half the length of text and no. of
columns is sixteen.
Step-3. Transform each character of text using the expressions
given as: iii. For each column, elements of each row are circularly
shifted by one in anticlockwise direction. Element of
y = p + 2 sin (100) first row of each column is shifted to last row.
c = y + 10 r iv. From second row to last row, for each row elements of
k = k + 1. each column is shifted by one in right direction.
Where, p is input text; c is output text; r = random number v. Again matrix dimension is changed into dimension of
generated by the state, „k‟ of Matlab random number matrix as in (a) (i).
generator; vi. Binary form of numbers is changed into decimal form.
Step-4. Plot output of the system.
vii. Read output sequence of numbers as p.
Step-5. Convert integer values into its character values. (b) For m = 1, do following steps:
Step-6. Read c as output text as cipher text. i. Generate random number corresponding to key (state).
B. LCG Method ii. Do Xor operation between random number and p and
Encryption Algorithm: store the result in p.
Step-1. Read plaintext as p, key as b and length as n.
iii. Increment key by one, go to (b)(i) and the loop
Step-2. Change the character values of text into its ASCII continues till m = n is completed. The loop outputs new
values. values of p having length n.
Step-3. Each ASCII values are transformed into five
(c) i = i+1 and go to step (5) (a) (i). Repeat process till i = 16
corresponding values using the following transformations: is completed.
y = p + sin (b); Step-6. For i = 1, do following steps.
c = y + r; i. Generate random number r corresponding to value of
y is intermediate variable. key (state).

r is the random numbers generated corresponding to the key; b ii. Calculate = p + mod (r, 128).
is state of LCG; c is any variable. iii. Convert each number of p into its binary form, which
Step-4. Plot „c‟ obtained from above step. forms matrix of dimension containing rows equal to
the length of text and number of columns is eight.
Step-5. The sequences of numbers in c are then converted into
character values. iv. Above matrix dimension is changed into dimension
where no. of rows is half the length of text and no. of
Step-6. Read the output text (cipher text). columns is sixteen.
Algorithm For Linear Congruential Generator: v. Matrix is partitioned into two equal halves, first and
Step-1. Read iteration as N, initial condition as x (1), values of second.
parameters a, b and c where b is considered as key for the
system. vi. Mix both matrix and obtain new matrix of same
dimension. Mixing is done in such a way that elements
Step-2. Calculate, for k=1: N of second column of new matrix becomes elements of
x(k+1) = mod (a x(1) + b, c) first column of second matrix, third columns elements
becomes elements third column of first matrix, fourth
Step-3. Read output states as x. columns elements becomes elements of second
column of second matrix and so on.

2
International Journal of Computer Applications (0975 – 8887)
Volume 111 – No 2, February 2015

vii. Dimension of new mixed matrix is changed into defined and key space has been properly characterized, the
dimension i.e., equal to the dimension of matrix as good key is chosen randomly from the large key ranges [7].
instep (6) (iii).
B. Plaintext sensitivity: This method corresponds to the
viii. Binary forms of numbers in matrix are changed into percentage of change in bits of cipher text obtained after
decimal form. encryption of plaintext, which is derived by changing single
bit from the original plaintext from the bits of cipher text
ix. Read output as p. obtained after encryption of original plaintext. With the
x. Again key is incremented by one, k = k + 1. change in single bit of plaintext, there, must be ideally 50%
change in bits of cipher text to resist differential cryptanalysis
xi. i = i + 1, go to step (6) (i). The process repeats until i = (chosen-plaintext attack) and statistical analysis, corresponds
16 is completed. to plaintext sensitivity test [8].
Step-5. Read output generated by completion of above steps C. Key sensitivity: This method corresponds to the
as c and plot it. percentage of change in bits of cipher text obtained after
Step-6. Convert integer values of c into character form. encryption of plaintext using key, which is flipped by single
bit from the original key, from bits of cipher text obtained
Step-7. Read c as cipher text. after encryption of plaintext using original key, which
requires ideally 50% change in cipher text bits to resist Linear
4. ANALYSIS AND RESULTS and statistical attacks [9].
The analysis part consists of testing the validity of methods
against the most basic attacks like linear, statistical and D. Known plaintext attack: It is assumed that the opponent
differential attacks. Cryptanalysis is the necessary for testing knows everything about the algorithm; he/she has the
the strength of the developed ciphers. The cryptanalytic corresponding cipher text of plaintext and some portion of
procedures used in this work include: plaintext. With this much information, the opponent tries to
find out the secret key [10].
A. Key Space Analysis: The size of the key space is the
number of encryption/decryption key pairs that are available For each of the methods the analysis result is cited in tabular
in the cipher system. In the proposed method, the key space form as follows:
(range of keys) is defined clearly. Once the key has been
Table 1: Analysis Table for RNG method

Key Robustness
Plaintext
Sl. sensitivity against known
Plaintext Key value Cipher text sensitivity
No. plaintext attack
(in %). (in %). for p = [p1 p2].
1. What is your 0 %[lf}"qs(yvvs'siogE 1.5038 22.3684 R
name?
2. I am going to 19 N cr)ormuo&vw"meythy2 0.6494 25.3247 R
market.
3. My college name 265 %Mz!eurneii)rbrf$lx(u/t3j0e0|4 0.9524 27.6190 R
is s.s.c.e.t.
4. Hello!how are 4765 !Qgrmx#lry%ezl#ryF 1.3158 28.2895 R
you?
5. Sita is singing very 39846 %Uryg)mw&ukqkqri(zjr•'jnu3 0.9259 28.7037 R
well.
6. Ram scored 98 874976 &Wdq"zlqvmd#?<"pfroy!or(Tfuo{3 0.4762 29.0476 R
marks in Maths.

7. Jaycee publication. 1234567 "Kf{ffk!uydlmddvioq3 0.7143 27.8571 R


8. Thank you,sir. 87649034 "Wjcwn%zxz5wjx7 0.9524 24.1667 R
9. The match was 945672345 !\nm$rgzhn)zfx!xmv|'j•gl{lth7 0.8621 26.7241 R
very exciting.
10. I will be leaving at 3760321854 )R'~msl!hi)mjbxjuj$e{)Bt6u1 1.0582 29.6296 R
9p.m.
[ R- Robust; p [p1 p2…p n]- First ‘n’ characters of available plaintext string. ]

3
International Journal of Computer Applications (0975 – 8887)
Volume 111 – No 2, February 2015

Table 2: Analysis Table for LCG method

Sl. Key Key Robustness


Plaintext Plaintext
No. value sensitivity against known
Cipher text sensitivity
plaintext attack
(in %) (in %) for p=[p1 p2].
1. What is your name? 0 1.25 24.8684 R
Xlgb]i}xsnbvqlgu‰„• z!50+&j~ytotˆƒ~
y!50+&zމ„• p„• zuvŠ…€{s‡‚}x!50+
&oƒ~ytbvqlgn‚}xsfzupk@TOJE

2. I am going to market. 20 1.0227 26.4773 R


"1'6,KZP_U"1'6,crhwmo~ty"1'6,ixn}sqv
{kzp• up• uzixn}s"1'6,v{qv{"1'6,o~tycr
hwmty~m|r•wgvl{qv{0?5D:
3. My college name is 301 0.6667 27.7586 R
s.s.c.e.t.
!6-8%NcZeRz•~!6-
8%dyp{hp|tmyqmyqf{r}jh}t• lf{r}j!6-
8%o{sbwnyfnzrf{r}j!6-8%j• v•ntx!6-
8%tx/D;F3tx/D;F3dyp{h/D;F3f{r}j/D;F3
u•y/D;F3
4. Hello!how are you? 2465 1.3889 30.5556 R
JT^OYgq{lvnxs}nxs}q{v#-
7(2jt~oyq{vy•~",6'1cmwhrt~ygq{lv",6'1
{•q{vw•|AKUFP
5. Sita is singing very 96785 0.7692 25.9615 R
well.
TY^chjoty~uz• bglqv!&+05joty~ty~!&+
05ty~joty~oty~hmrw|joty~oty~hmrw|!&
+05w|•fkpuzsx}z• !&+05x}fkpuzmrw|
•mrw|•/49>C
6. Ram scored 98 marks 123456 0.5714 23.2381 R
in Maths.
STi`Rbcxoano{m!"7.
tu•sdezqcpq}ostrfg|seef{rd!"7.
:;PG99:OF8!"7.
no{mbcxoastrlmyktu•s!"7. jkwiop|n!"7.
NOd[Mbcxoauvtij• vhtu•s/0E<.
7. Jaycee publication. 259239 1.0526 23.1579 R
8
K]`TRbtwkiz••dvymkfx{omfx{om!36*
(qzxv• }cuxljm• vtj|• sqdvymkbtwkiu~|j
|• sqpywo•xv/AD86
8. Thank you,sir. 400986 2.1429 27.1429 R
45
UdZi_ixn}sbqgvlo~tyl{qv!0&5+z• p• uz
v{-<2A7ty~jyo~tsx}/>4C9
9. The match was very 120765 0.7143 38.0357 R
exciting. 956
UVkbTij• vhfg|se!"7.
no{mbcxoauvtdezqcij• vh!"7.
xywbcxoatu•s!"7.
wx•vfg|sestrz{•y!"7.
fg|seyz•xdezqcjkwiuvtjkwiop|nhi~ug/0E
<.
10. I will be leaving at 400000 1.25 23.7500 R
9p.m. 000000
0000 K_ZUP"61,'y•~k• zupn}xsn}xs"61,'dxs
nig{vql"61,'n}xsg{vqlcwrmhx}k• zupp•
zui}xsn"61,'cwrmhv{"61,';OJE@r•|w0D
?:5o~yt0D?:5>>

4
International Journal of Computer Applications (0975 – 8887)
Volume 111 – No 2, February 2015

Table 3: Analysis Table for Modified RNG method.


Robustness
against
Key known
Plaintext
Sl. sensitivity plaintext
Plaintext Key value Cipher text sensitivity
No. attack for p
(in %) (in %) = [p1 p2
…p(length
of p-1)]
1. What is your 0 úY¸3+9ùìNÚâ9= Ó[ 46.0526 49.3750 R
name?
2. I am going to 19 y&ý 48.2955 46.0227 R
market. ½ÙV;¯U1ó°
3. My college 265 "A°î$IMÀ`óö•*ZõäPy¤»õÏÀ¥ 48.7500 50.4167 R
name is
s.s.c.e.t.
4. Hello!how 4765 Ã*[Í@w1ËÅVt•É=Ü! 43.4211 46.0526 R
are you?
5. Sita is 39846 \*£¨gúµÇLÄH´C$×!¹-Õ¿LS 50 48.6111 R
singing very
well.
6. Ram scored 874976 ý¬u•U¹WG°Ú0ù2ÏmH*NÌ¢D®Ê^ÂÆô 34.1667 49.1667 R
98 marks in
Maths.
7. Jaycee 1234567 îD=õñ*XáW¢¡÷• ª? 46.2500 52.5000 R
publication.
8. Thank 87649034 ä_¼5Qÿ(1ÖI2%E" 30.8333 52.5000 R
you,sir.
9. The match 945672345 àW-7ÛË_lBM«¥wiVâßfëémâplT8 45.2586 53.4483 R
was very
exciting.
10. I will be 3760321854 ÙðÖÄ*w¯UT4#÷rzðc 49.5370 51.3889 R
leaving at ô©!}h
9p.m.

5. CONCLUSION
This paper proposes an encryption algorithm based on pseudo Table 4: Comparison between the three methods
random number generator (PRNG). The performance of Robustness
developed encryption scheme is evaluated by performing key Range of Range of against
space analysis, plaintext and key sensitive test and known Name of
plaintext key known
plaintext attack on them. Known plaintext attack is performed cipher
sensitivity sensitivity plaintext
by taking into consideration a small string of plaintext and the tattack
complete cipher text for small text.
The analysis is performed on different keys selected randomly RNG 0.5 to 1.5 % 22 to 30 % Yes
from key space for various texts and files. Developed
algorithm showed key sensitivity up to 50 %. Plaintext
sensitivity in modified algorithm has been increased from 3% LCG 0.5 to 3 % 23 to 39 % Yes
to 50 %.Thus, proposed encryption algorithm have shown
strength against linear, differential and statistical attacks. A MODIFIED
comparative result analysis is briefed in table 4. Modified 34 to 50 % 43 to 54% Yes
RNG
RNG possess good plaintext and key sensitivity property.

5
International Journal of Computer Applications (0975 – 8887)
Volume 111 – No 2, February 2015

6. ACKNOWLEDGMENTS [4] Jiantao zho, au, o.c, 2010, “cryptanalysis of chaotic


The authors would like to thank the anonymous reviewers for convolutional coder ”, proceedings of ieee symposium
their valuable suggestions and the proposed references. circuits and systems (iscas ) , 145-148.
[5] S. Li, X. Zheng, 2010, “Cryptanalysis of a chaotic image
7. AUTHOR’S PROFILE encryption method”, Proceedings of the IEEE
Mina Mishra, is pursuing Ph.D. (Engg) from Nagpur International. Symposium on circuits and systems,
University, Maharashtra, India. She received M.E. degree Scottsdale, AZ, USA.
specialization in communication in the year 2010. Her
research area covers chaotic systems, chaotic cryptology, [6] P. Xu; J. Zhao; D. Wang, 2011, “A selective image
network security and secure communication. encryption algorithm based on hyper-chaos”, IEEE 3rd
International Conference on Communication Software
Vijay H. Mankar received M. Tech. degree in Electronics and Networks (ICCSN), 2011, 376-379.
Engineering from VNIT, Nagpur University, India in 1995
and Ph.D. (Engg) from Jadavpur University, Kolkata, India in [7] Mishra Mina, Mankar V.H., 2012, “Design and Analysis
2009 respectively. He has more than 16 years of teaching of Cipher Based on Henon and Burger Maps”
experience and presently working as a Lecturer (Selection Proceedings of IEEE 4th International Conference on
Grade) in Government Polytechnic, Nagpur (MS), India. He Electronics Computer Technology (ICECT- 2012), 978-
has published more than 45 research papers in international 1-4673-1850, 466-471.
conference and journals. His field of interest includes digital
[8] Mishra Mina, Mankar V.H., 2012, “A Chaotic encryption
image processing, data hiding and watermarking.
algorithm: Robustness against Brute-force attack”
8. REFERENCES Advanced Intelligent and soft computing (AISC),
[1] L. P. de Oliveira and M. Sobottka, 2008, “Cryptography Springer, 167, 169-179.
with chaotic mixing” Chaos, Solitons and Fractals, vol. [9] Mishra Mina, Mankar V. H.,2012, “Hybrid Message-
35, pp. 466–471. Embedded cipher using logistic map” published in
[2] Ruming Yin, Jian Yuan, Qiuhua Yang, Xiuming Shan, International Journal of Security, Privacy and Trust
Xiqin Wang, 2009,” Linear cryptanalysis for a chaos- Management ( IJSPTM), 1(3/4), 81-91.
based stream cipher,” World Academy of Science, [10] Mishra Mina, Mankar V.H., 2012, “Message Embedded
Engineering and Technology ,60, 799-804. cipher using 2-D Chaotic map” published in International
[3] Xianfeng Guo, Jiashu Zhang, Xianfeng Guo, 2010,” An Journal of Chaos, Control, Modelling and Simulation
Efficient Cryptanalysis of a Chaotic Cryptosystem and (IJCCMS), 1(1), 13-23, July 2012.
Its Improvement”, IEEE conference on Information
Theory and Information Security, China, 578-581.

IJCATM : www.ijcaonline.org 6

View publication stats

You might also like