Image To Text Encryption and Decryption Using Modified RSA Algorithm

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

Interna tional Jo urna l o f Applied Research 2018 ; 4 (6 ): 170 -17 4

ISSN Print: 2394-7500


ISSN Online: 2394-5869
Impact Factor: 5.2
Image to text encryption and decryption using
IJAR 2018; 4(6): 170-174
www.allresearchjournal.com
modified RSA algorithm
Received: 23-04-2018
Accepted: 24-05-2018
Charru Kalra
Charru Kalra
PG Student, Department of Abstract
Computer Science Engineering Security is required to transmit confidential information over the network. Security is also demanding
(CSE) Prannath Parnami in wide range of applications. Cryptographic algorithms play a d very important role in providing the
Institute, Chaudharywas,
data security over malicious attacks. RSA encryption algorithm is Public key cryptography is also
Hisar, Haryana, India
called as asymmetric key cryptography. This paper presents the literature review of methods of
implementation of RSA algorithm and modified RSA algorithm.

Keywords: Encryption, decryption, public key cryptography, pairwise RSA

1. Introduction
In the today’s era the internet provides communication between people and facilitates for
electronic payment, military communication and many others. This cause a major concern
for privacy, identify theft, security etc. cryptography is a standard way of safe the data over
the medium. Cryptography has been developed from the Greek word crypto which means is
hiding the information person who study and discover cryptography are called
cryptographers and study of cryptography is name by cryptanalysis. Cryptography is a part of
secret information,it is science and art of protecting theinformation over the medium. It is
process of convert readable text to unreadable text. By using the cryptography we can help
this fickle information by private document on over computer network. In a distributed
network cryptography become important part of secure communication,there are three type
of cryptography algorithm: symmetric key cryptography, Hashing, Asymmetric key
cryptography. An algorithm for cryptography that uses the same keys for both encryption of
normal text and decryption for cipher text is called symmetric key cryptography,e.g. Data
Encryption standard(DES) and Advance Encryption standard(AES).To solve the key
distribution problem Maryam Ahmed developed the concept of public key cryptography in
1976.

2. Public Key Cryptosystem


In this cryptosystem, we have two different types of keys: one is the public key and second is
the private key. Public key is publicly known and private key is kept secret. The system is
called asymmetric system. If data encrypted by the public key so it can only decrypted by the
private key. In public key cryptosystem, no need to share the secret data between two parties.
So there is less chance of data stolen & manipulation and data is more secure.

3. RSA Cryptosystem
RSA algorithm is the first practicable public-key cryptosystems and is mainly used for secure
data transmission. In cryptosystem, the encryption key is public and the decryption key is
secret. In RSA, this asymmetry is based on the factoring the product of two large prime
numbers that is called factoring problem. RSA stands for Ron Rivest, Adi Shamir and
Correspondence Leonard Adleman, who is the founder of this algorithm and discovered in 1977.
Charru Kalra
PG Student, Department of
Computer Science Engineering
(CSE) Prannath Panamá
Institute, Chaudharywas,
Hisar, Haryana, India
~ 170 ~
International Journal of Applied Research

5. Choose an integer e such that 1 < e <φn) and gcd(e,


φ(n)) = 1; i.e., e and φ(n) are co-prime. Where e is the
public key exponent. And having a short bit-length and
small Hamming weight results such as: 216 + 1 =
65,537. However, if the value of e is small.
6. Determine d as d ≡ e−1 (modφ(n));i.e., d isthe
multiplicative inverse of e (modulo φ(n)).

Decryption
m≡ cd(mod n)

4. The Security of the RSA Cryptosystem


The security of the RSA cryptosystem relies on the integer
factorization problem to find the secret key (d, R), which
many cryptologists try to recover. If anyone can get the
factors p and q of R, then it is so easy to find φ (R) and d
and since e is known. Many studies showed that if R is a
large composite number, then it is hard to obtain the prime
factors of R Thus, hacking or cracking the RSA
cryptosystem by factoring R would not be easy, and it is a
It involves three steps conjecture in mathematics. Nevertheless, there might other
• Key Generation ways to obtain d. It can be obtained by finding φ(R) from R,
• Encryption such that find φ(R)= φ( pq)= φ(p) φ(q)=( p-1)(q-1). Then p
• Decryption and q, that factorize R, can be found easily. Note that
finding φ(R) is not easier that factoring R. Moreover, when
Key Generation p and q both have approximately 300 decimal digits, R=pq
In this, we need keys that are public and private. We will has approximately about 600 decimal digits. Using the
generate public and private key by using following steps. fastest factorization algorithm to factor an integer of this
Public key is visible to both sender and receiver. But the size, more than millions of years of computer time are
private key is kept secret and not visible to end user. required to factor it.

Steps are 5. Image Decryption


1. Choose two distinct prime numbers p and q. To decrypt the cipher image, the private key a and X are
2. For security purposes, these prime numbers p and q necessary to be known by the receiver. The process as the
should be chosen at random, and must be of similar bit- following (done by MATLAB):
length. 1. Import to data (Y) from the encrypted image.
3. Compute n = pq. n is used as the modulus for both the 2. Restore the plain image M, such that M ≡ [ Y ((X)a)-1]
public and private keys. It length is expressed in bits (mod p)
which is key length. 3. Obtain the original image (decrypted image).
4. Compute φ(n) = φ(p)φ(q) = (p − 1)(q − 1) = n - (p + q -
1), where φ is Euler's totient function. The following flow chart shows the image Encryption and
Decryption process:

~ 171 ~
International Journal of Applied Research

Literature Review Dr. U. S. Bhadade [4] discuss about Security is required to


Recently, there have been significant research works on transmit confidential information over the network. Security
Spam Detection. This section covers the literature survey of is also demanding in wide range of applications.
the work of the paper. Cryptographic algorithms play a d very important role in
V. Kapoor [1] tells about cryptography is the art and science providing the data security over malicious attacks. RSA
of achieving security by encoding message to make them encryption algorithm is Public key cryptography is also
non readable to secure data or information transmits over the called as asymmetric key cryptography. This paper presents
network. In this paper introduced modified RSA approach the literature review of methods of implementation of RSA
based on multiple public keys and n prime number. RSA algorithm and modified RSA algorithm.
algorithm is mostly used in the popular implementation of Hayder Raheem Hashim [5] tells about need of exchanging
public key cryptography. In public key cryptography two messages and images secretly over unsecure networks
keys are developed in RSA one keys is used for encryption promoted the creation of cryptosystems to enable receivers
data and other corresponding key used for decryption. No to interpret the exchanged information. In this paper, a
other key decrypt the data. Even if it is efficient algorithm it particular public key cryptosystem called the ElGamal
is vulnerable to other person. With the help of all brute force Cryptosystem is presented considered with the help
attacks can obtain private keys. In this research paper new MATLAB Program to be used over Images. Since the
approach we used n prime number and multiple public keys. ElGamal cryptosystem over a primitive root of a large prime
Which is not easily crack able. In here implementation RSA is used in messages encryption in the free GNU Privacy
algorithm,using some mathematical logic integer Guard software, recent versions of Pretty Good Privacy
factorization and discrete logarithm problem. (PGP), and other cryptosystems. This paper shows a
Sunita [2] discuss about cryptography is a process used for modification of the this cryptosystem by applying it over
sending information in secret way. Goal of cryptography is gray and color images. That would be by transforming an
to provide the protection for information but in various way. image into its corresponding matrix using MATLAB
In this paper our motive to represent a new method for Program, then applying the encryption and decryption
protection that is generated by combination of RSA and 2 algorithms over it. Actually, this modification gives one of
bit rotation mechanism of cryptography. There are many the best image encryptions that have been used since the
algorithms exist for this process. For cryptography there are encryption procedure over any image goes smoothly and
algorithms like RSA, IDEA, AES, and DES but here we are transfers the original image to completely undefined image
using only one algorithm from these that is RSA which is which makes this cryptosystem is really secure and
enough to implement combined process using 2 bit rotation. successful over image encryption. As well as, the decryption
The encrypted image is used as input for network for further procedure of the encrypted image works very well since it
implementation. RSA encrypt image with 1 bit transfers undefined image to its original. Therefore, this new
rotation. In 1 bit rotation only 1 bit is shifted and at decrypt modification can make the cryptosystem of images more
side shifted bit are reversed. immune against some future attacks since breaking this
Karrar Dheiaa Mohammed AlSabti [3] The need of making cryptosystem depends on solving the discrete logarithm
important information that is being exchanged between two problem which is really impossible with large prime
persons by unsecure websites has intersted cryptoligists to numbers.
create and modify some secure cryptosytems to secure these Dipali B. Khairnar [6] Main goal of Pair wise RSA
information from getting hacked or cracked. In this paper, a Encryption Algorithm is secure transmission of confidential
strategy in the public key cryptosystem called RSA information over network. RSA encryption algorithm is
Cryptosystem is used to be applied over gray and color Public key cryptography is also called as asymmetric key
images with the help of MATLAB Program. Even the RSA cryptography. Public key cryptosystem use key pair one use
cryptosystem is a well- known secure cryptosystem, we use as public other use as private or secret key and private key
MATLAB to use this cryptosystem over gray and color cryptosystem use same private key for encryption and
images. That would be generating two algorithms for the decryption. For encryption and decryption RSA encryption
encryption and decryption. These algorithms are applied algorithm use key pair one key use for encryption which
over the plain image and cipher image after reading them in called as public key and other key use for decryption called
the matrices forms. However, the image is partitioned into as private key. In this paper, we have done an efficient
blocks that are n x m matrices. Since the RSA cryptosystem implementation of Pair wise RSA algorithm using key pairs
is a secure public key cryptosystem since its security based and using Euclidean algorithm rather than sending the e
on the difficulty of the factoring problem, which is factoring value directly as a public key. Because it avoid
a positive integer R into a product of two primes, we apply mathematical attacks and brute force attack. In this paper
this cryptosystem over images using MATLAB with key size increased 512bit to 1024 bit in Pairwise RSA which
increasing the number of the primes in R. This gives the provide highest security in the network.
modified RSA cryptosystem has a higher security than the Ravi Shankar Dhakar [7] The algorithms (RSA & MREA)
RSA cryptosystem, because decrypting any encrypted have many important parameters affecting its level of
images requires factoring the large integer composed of the security and speed [10]. By increasing the modulus length it
product of many large primes, and it requires knowing the is caused of increasing the complexity of decomposing it
size of the blocks that are formed from plain matrix. into its factors. This also increases the length of private key
Therefore, this approach of encrypting and decrypting and hence difficulty to detect the key. Another parameter is
images using RSA cryptosystem with some modifications modular multiplicative inverse. Where the modular
more immune against any attacks in the transmission of multiplicative inverse is new factor of private key, so it will
images in all agencies in the era of the information be more difficult to choose by trying all possible private
technology. keys for brute force attack hence the security also increases
~ 172 ~
International Journal of Applied Research

as well as difficulty of detecting the private key. The RSA (India), Implementation of RSA algorithm and modified
and MREA parameters are changed one parameter at a time rsa algorithm 2017, 5.
and the others are kept fixed to study the relative importance 5. Hayder Raheem Hashima, Irtifaa Abdalkadum Neamaa.
[7]
. Image Encryption and Decryption in A Modification of
Rajan. S. Jamgekar [8] The algorithms (RSA & MREA) have ElGamal Cryptosystem in MATLAB
many important parameters affecting its level of security 6. Dipali B Khairnar, Sandeep Kadam, Dr. Patil DY.
and speed. By increasing the modulus length it is caused of College of Engineering, Ambi University of Pune,
increasing the complexity of decomposing it into its factors. Maharashtra, India, Secure RSA: Pair Wise Key
This also increases the length of private key and hence Distribution using Modified RSA Algorithm. 2016;
difficulty to detect the key. Another parameter is modular 6(4).
multiplicative inverse μ where the modular multiplicative 7. Ravi Shankar Dhakar, Amit Kumar Gupta, Prashant
inverse μ is new factor of private key, so it will be more Sharma. Modified RSA Encryption Algorithm
difficult to choose μ by trying all possible private keys (MREA), Second International Conference on
(brute force attack) hence the security also increases as well Advanced Computing & Communication Technologies,
as difficulty of detecting the private key. The RSA and 978-0-7695-4640- 7/12 $26.00 © 2012 IEEE, 2012.
MREA parameters are changed one parameter at a time and 8. Rajan S, Jamgekar, Geeta Shantanu Joshi. “File
the others are kept fixed to study the relative importance. Encryption and Decryption Using Secure RSA,
The results vary depending on type of file and size of file [11]. International Journal of Emerging Science and
A. Anagaw Ayele [9] RSA Encryption algorithm provide ngineering (IJESE) ISSN: 2319–6378, 2013; 1(4),
single public key, Less communication overload, More 9. Anagaw Ayele A, Dr. Vuda Sreenivasarao. A Modified
vulnerable to brute force attack, less security, The Public RSA Encryption Technique Based on Multiple public
key is sent once. As compare with RSA Modified RSA keys” International Journal of Innovative Research in
provide Use two public key, High communication overload, Computer and Communication Engineering. 2013; 1(4).
less vulnerable to brute force attack, more security, The 10. Sheela K, George E, Dharma Prakash Raj. InKeSi-
Public key is sent separately twice [6]. Increased Key Size Method in SRNN Public Key
Allam Mousa [10] The 1024bit InKeSi SRNN Cryptography Algorithm, IJCSMC, 2013; 2(8).
implementation the methodology for computing the modular 11. Maryam Ahmed, Baharan Sanjabi, Difo Aldiaz,
exponentiation is used. This is chosen because it can achieve Amirhossein Rezaei, Habeeb. “Diffie- Hellman and Its
an appreciable decrease of covered area and sometimes Application in Security Protocols” International Journal
increase the time- performance comparing with other of Engineering Science and Innovative Technology
methodologies. The senders encrypt the message with (IJESIT) 2012; 1(2).
Public Key of InKeSi SRNN algorithm and then the data is 12. Golle P, Staddon J, Gagne M, Rasmussen P. A Content-
signed with the Private Key of InKeSi SRNN algorithm. Driven Access Control System, Proc. Symp. Identity
The verification of digital signature is started after this and Trust on the Internet, 2008, 26-35.
process with the help of Public key at the recipient side. The 13. Rangarajan A Vasudevan, Sugata Sanyal. Jigsaw-based
decryption of the digital signature is done in this process Secure Data Transfer over Computer Networks
which eventually results in the generation of message [5]. Information Technology: Coding and Computing,.
Proceedings. ITCC 2004. International Conference on
Conclusion 2004, 1
With the implementation of RSA algorithm using 2 bit 14. Wuling Ren, Zhiqian Miao. College of Computer and
rotation, we reach a conclusion that for better security of any Information Engineering, Zhejiang Gongshang
text or image. In this work there choose an image and apply University, A Hybrid Encryption Algorithm Based on
RSA algorithm on it. Then we got encrypted image and DES and RSA in Bluetooth Communication Second
applies the 2 bit rotation algorithm on encrypted image and International Conference on Modeling, Simulation and
after that we apply Hill Cipher algorithm for better security. Visualization Methods, 2010.
Then got an encrypted image which is very difficult to 15. Neal R Wagner. The Laws of Cryptography with Java
decrypt by any other person. So, the conclusion is that the, Code, Technical Report, 2003, 78-112.
image is more secure. 16. Allam Mousa. Sensitivity of Changing the RSA
Parameters on the Complexity and Performance of the
References Algorithm, ISSN 1607 – 8926, Journal of Applied
1. Kapoor V. Institute of Engineering and Technology, Science, Asian Network for Scientific Information,
DAVV, Indore, India,” Data Encryption and 2005, 60-63.
Decryption Using Modified RSA Cryptography Based 17. Atul Kahate. Cryptography and Network Security,
on Multiple Public Keys and ‘n’prime, 1(2) ISBN-10:0-07-064823-9, Tata McGraw- Hill
2. Sunita Bhagat Phool Singh Mahila Vishwavidhalaya, Publishing Company Limited, India, Second Edition,
Khanpur Kalan, Sonepat, Image Encryption/Decryption pages 38-62,152-165,205-240.
using RSA Algorithm. 2017; 5(5):1-14. 18. Gagandeep Shahi, Charanjit Singh. Cryptography and
3. Karrar Dheiaa Mohammed Al Sabti. University Of its two Implementation Approaches International
Kufa, Iraq. A New Approach for Image Encryption in Journal of Innovative Research in Computer and
the Modified RSA Cryptosystem Using MATLAB” Communication Engineering. 2013; 1(3):668-672.
ISSN 0973-1768 2016; 12(4):3631-3640 19. Rupali Verma, Maitreyee Dutta, Renu Vig. FPGA
4. Sarika Y Bonde, Dr. Bhadade US, SSBT. College of Implementation of RSA based on Carry Save
Engineering & Technology Bambhori, Jalgaon, (M.S) Montgomery Modular Multiplication‖, IEEE
International Conference on Computational Techniques
~ 173 ~
International Journal of Applied Research

in Information and Communication Technologies


(ICCTICT), 2016, 1-6
20. Narander Kumar, Priyanka Chaudhary, -
Implementation of Modified RSA Cryptosystem for
Data Encryption and Decryption based on n Prime
number and Bit Stuffing‖, International Conference on
Information and Communication Technology for
Competitive Strategies (ICTCS- 2016), March 04-05,
Udaipur, India, 2016, 1-6.

~ 174 ~

You might also like