Content uploaded by Robbi Rahim
Author content
All content in this area was uploaded by Robbi Rahim on Jan 21, 2017
Content may be subject to copyright.
Vigenere Cipher Algorithm with Grayscale Image
Key Generator for Secure Text File
Imam Saputra1
Departement of Computer Engineering
STMIK Budi Darma
Medan, Indonesia
Jl. Sisingamangaraja XII No. 338, Siti Rejo I, Medan Kota,
Kota Medan, Sumatera Utara, 20216
Mesran2
Departement of Computer Engineering
STMIK Budi Darma
Medan, Indonesia
Jl. Sisingamangaraja XII No. 338, Siti Rejo I, Medan Kota,
Kota Medan, Sumatera Utara, 20216
Nelly Astuti Hasibuan3
Departement of Computer Engineering
STMIK Budi Darma
Medan, Indonesia
Jl. Sisingamangaraja XII No. 338, Siti Rejo I, Medan Kota,
Kota Medan, Sumatera Utara, 20216
Robbi Rahim4
Departement of Computer Engineering
Medan Institute of Technology
Medan, Indonesia
Jl. Gedung Arca No.52 Kota Medan, Sumatera Utara,
Abstract - With the changing of the times, information is crucial
today especially for technological developments, especially in
data security systems. In maintaining data security, there is a
branch of science in its development, namely cryptography.
Classical cryptography as vigenere cipher is a cryptographic
algorithm implementation is very simple but quite powerful in
his era. Having discovered methods kasiski, vigenere cipher
algorithm is very easy to be analyzed by cryptanalyst to get a
key. This is due to the relationship between the cipher, plaintext,
and the key cryptography. The core used is usually composed of
some characters arrangement either letters or numbers that are
not too long, so it is easy to remember. So as to facilitate
cryptanalyst to determine the key cryptography. To that end,
the key must be an array of random characters long, so that the
relationship between plaintext, ciphertext and key becomes very
apparent that it would be difficult to solve by cryptanalyst.
Which is the key arrangement of random characters that can
obtain the pixel values of an image that being converted into
ASCII characters? The pixel values of 8-bit grayscale images
ranging from 0-255 equal the number of characters in the
ASCII table. So that all pixel values in an 8-bit grayscale image
can be converted into random characters and can be used as a
key for the Vigenere Cipher Algorithm.
Keywords: Vigenere Cipher, Key Generator, Grayscale Image 8
Bit I. INTRODUCTION
Computer technology needed in human life. Almost every
man needs computer assistance in their daily lives. Each
person will have an important document that is confidential
which can only be accessed by certain people. The problem of
computer security is something crucial in this information age.
There are several techniques for data security one of which is
a disguise or cryptographic techniques. Cryptography is the art
and science to protect the data by transforming it into a
specific code and is intended only for people who have the
key to change the code back to normal. In the field of
cryptography, there are three crucial concepts that encryption,
decryption, and key. Encryption is the process of transforming
information (plaintext) into a code that is not recognizable
(ciphertext) by using a key. Decryption is the process of
converting code that is not identifiable (ciphertext) into
information (plaintext) using a key, in this case, the encrypted
files in text files.
One of the famous classic cryptographic algorithms is
Vigenere Cipher Algorithm. Vigenere Cipher is a form
polyalphabetic substitution like the idea expressed Caesar but
by adding more secure locks are formed. Vigenere Cipher is
well known because it is easily implemented. This method is
strong enough to avoid a cryptanalyst who uses frequency
analysis until. Finally, someone named Frederick Kasiski to
find an efficient method to solve the Vigenere Cipher
Algorithm keys. Vigenere Cipher Algorithms have abandon
for quite easily analyzed by cryptanalyst. Especially with the
technology that exists today and the discovery of Kasiski
methods then if we want to use Vigenere Cipher Algorithms
need to be modified. The manner in which this time is to
generate a key from an 8-bit grayscale image pixel value has
been converted into a row of characters with ASCII table.
With a key which is an image, then the key can be longer and
more random characters so that the relationship between the
plaintext and ciphertext will be more apparent, so cryptanalyst
does not easily analyze it. With long locks and randomly
generated from the picture, it is not necessary to remember the
order of the key characters, quite remember where the image
is used as a key.
II. THEORY
A. Cryptography
Cryptography is a science that is used to maintain the
confidentiality of the data, by using certain methods so that
data can only read by a person who is entitled to such data, in
the maintenance of the confidentiality of data, cryptography
alters original data (plaintext) into data that is encrypted
(ciphertext). This process is called encryption process.
Cryptography can be classified into two categories, namely
[1]:
1. Shared Key Cryptography
2. Public Key Cryptography
www.ijert.org
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181http://www.ijert.org
IJERTV6IS010223 (This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by :
Vol. 6 Issue 01, January-2017
266
Shared Key Cryptography is also often called symmetric
key cryptography or cryptographic private key or secret key
because of the key used in the encryption and decryption
process at [2].
Fig 1. Shared Key Cryptography
Public Key Cryptography is also often called asymmetric key
cryptography uses different keys in the encryption and decryption
process. Only the private key used for encryption. Moreover, the
public key used during the decryption process.
Fig 2. Public Key Cryptography
B. Vigenere Cipher Algorithm
Vigenere Cipher Algorithm is a classical cryptographic
technique are more secure than a Caesar cipher. Vigenere
Cipher cipher alphabet included in the compound
(Polyalphabetic Substitution Cipher) with a 26 x 26 matrix
with Caesar shift cipher [3]. Vigenere Cipher is a method of
encrypting text with rows cipher based on keywords. Vigenere
cipher algorithm using a square table vigenere to perform the
encryption process. Each row in the table squares states
ciphertext letters were obtained by the caesarian cipher. Here
is a square table vigenere [4].
TABLE I. Vigenere Cipher Square Table
Encryption and decryption process vigenere cipher
algorithm can be represented mathematically [4]:
Encryption : Ci = (Pi + Ki) mod 26
Decryption : Pi¬ = (Ci + Ki) mod 26
Where C0....Cn is ciphertext, P0....Pn is plaintext and K0...Kn
is key
If vigenere cipher applied in computer application, the
code used by the ASCII table as many as 256 characters, so if
represented mathematically be:
Encryption : Ci = (Pi + Ki) mod 256
Decryption : Pi¬ = (Ci + Ki) mod 256
C. Digital Image
The image of the other terms of the picture as a
multimedia component that plays a crucial form of visual
information. The image has characteristics that are not owned
by text data, i.e., information-rich image. The image is a two-
dimensional function that represents some features such as
brightness or color of a scene and can be defined as a two-
dimensional function f (x, y) where (x, y) position of the
projected and f (x, y) defines the brightness at that point [ 5].
Digital image composed of elements called picture
elements, image elements, and pixels. Pixel is the smallest
part of an image [6]. Digital image is divided into several
types based on the depth of color a binary image, grayscale
image (8 bits), a color image (24-bit) and color images (32
bit). For a grayscale image (8 bits) then the value of a pixel is
represented by an 8-bit binary number with a minimum value
of 0 and a maximum value of 255.
Fig 3. Grayscale Image 8 bit
www.ijert.org
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181http://www.ijert.org
IJERTV6IS010223 (This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by :
Vol. 6 Issue 01, January-2017
267
D. ASCII
ASCII (American Standard Code for Information
Interchange) is an international standard in the code of letters
and symbols is always used by computers and other
communication tools to show the text. ASCII code has a
composition of as much as 8-bit binary number. ASCII
characters are divided into five groups according to their use,
namely consistent communication, device control,
information separator, code extension and real
communication [7].
III. RESULT & DISCUSSION
A. Key Generator
To generate a series of random keys, resulting the
relationship between plaintext and ciphertext are false, then
used an 8-bit grayscale image with a size of 5 x 5 pixels. The
pixel values of the grayscale image converted to use an ASCII
table in the form of symbols or characters that will be used to
perform the encryption and decryption process.
Fig 4. Key Generator With Grayscale Image 8 bit
If the pixel values are converted using the ASCII table
Table II
Conversion Values of Pixel Become Character
Decimal
Character
48
0
41
)
39
‘
42
*
48
0
46
.
58
:
134
å
74
J
44
,
46
.
37
%
142
Ä
88
X
45
-
26
SUB
42
*
152
Ϋ
72
H
20
DC4
15
SI
20
DC4
44
,
26
SUB
14
SO
So after being converted into a character, then the key to
0) '* 0 .: AJ.% AX-SUB * ΫHDC4SIDC4, SUBSO key that
will be used for encryption and decryption process is the
result of the conversion of the pixel values of the 8-bit
grayscale image size of 5 x 5 pixels.
B. Encryption Process
Text data to be encrypted is NEVER underestimate
YOURSELF and keys to be used in the encryption process is
0) '* 0 .: AJ.% AX-SUB * ΫHDC4SIDC4, SUBSO. If the
plaintext is longer than the key, the key will be automatically
restarted from the beginning so that all the characters in the
encryption of plaintext completed, if the plaintext is shorter
than lock the remaining locks will not be used.
C0=(78+48) mod 256 = 126 character t
C1=(69+41) mod 256 = 110 character n
C2=(86+39) mod 256 = 125 character }
C3=(69+42) mod 256 = 111 character o
C4=(82+48) mod 256 = 130 character é
C5=(32+46) mod 256 = 78 character N
C6=(85+58) mod 256 = 143 character Å
C7=(78+134) mod 256 = 212 character È
C8=(68+74) mod 256 = 142 character Ä
C9=(69+44) mod 256 = 113 character q
C10=(82+46) mod 256 = 128 character Ç
C11=(69+37) mod 256 = 106 character j
C12=(83+142) mod 256 = 225 character ß
C13=(84+88) mod 256 = 170 character ̚
C14=(73+45) mod 256 = 118 character v
C15=(77+26) mod 256 = 103 character g
C16=(65+42) mod 256 = 109 character m
C17=(84+152) mod 256 = 236 character ẏ
C18=(69+72) mod 256 = 141 character ĺ
C19=(32+20) mod 256 = 52 character 4
C20=(89+15) mod 256 = 104 character h
C21=(79+20) mod 256 = 99 character c
C22=(85+44) mod 256 = 129 character ȕ
C23=(82+26) mod 256 = 108 character l
C24=(83+14) mod 256 = 97 character a
C25=(69+48) mod 256 = 117 character u
C26=(76+41) mod 256 = 117 character u
C27=(70+39) mod 256 = 109 character m
After performing the encryption process cipherteksnya be tn}
oéNÅÈÄqÇjß ̚vgmẏĺ4hcȕlauum
C. Decryption Process
After the plaintext is converted into ciphertext in the
encryption process, the next step is to change ciperteks back
into plaintext with the same key used during the encryption
process. Which will decrypt ciphertext is tn}
oéNÅÈÄqÇjß ̚vgmẏĺ4hcȕlauum using keys 0) '* 0 .: AJ.%
AX-SUB * ΫHDC4SIDC4, SUBSO.
P0=(126-48) mod 256 = 78 character N
P1=(110-41) mod 256 = 69 character E
P2=(125-39) mod 256 = 86 character V
P3=(111-42) mod 256 = 69 character E
P4=(130-48) mod 256 = 82 character R
P5=(78-46) mod 256 = 32 character
P6=(143-58) mod 256 = 85 character U
P7=(212-134) mod 256 = 78 character N
P8=(142-74) mod 256 = 68 character D
P9=(113-44) mod 256 = 69 character E
P10=(128-46) mod 256 = 82 character R
P11=(106-37) mod 256 = 69 character E
P12=(225-142) mod 256 = 83 character S
P13=(170-88) mod 256 = 84 character T
48
41
39
42
48
46
58
134
74
44
46
37
142
88
45
26
42
152
72
20
15
20
44
26
14
www.ijert.org
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181http://www.ijert.org
IJERTV6IS010223 (This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by :
Vol. 6 Issue 01, January-2017
268
P14=(118-45) mod 256 = 73 character I
P15=(103-26) mod 256 = 77 character M
P16=(109-42) mod 256 = 65 character A
P17=(236-152) mod 256 = 84 character T
P18=(141-72) mod 256 = 69 character E
P19=(52-20) mod 256 = 32 character
P20=(104-15) mod 256 = 89 character Y
P21=(99-20) mod 256 = 79 character O
P22=(129-44) mod 256 = 85 character U
P23=(108-26) mod 256 = 82 character R
P24=(97-14) mod 256 = 83 character S
P25=(117-48) mod 256 = 69 character E
P26=(117-41) mod 256 = 76 character L
P27=(109-39) mod 256 = 70 character F
After performing the decryption process tn}
oéNÅÈÄqÇjß ̚vgmẏĺ4hcȕlauum with key 0) '* 0 .: AJ.% AX-
SUB * ΫHDC4SIDC4, SUBSO then back into plaintext
NEVER underestimate YOURSELF. To be more concise can
be seen in the following table:
Table III
Result Vigenere Cipher Encryption and Decryption
Process
Result
Plainteks
NEVER UNDERESTIMATE YOURSELF
Kunci
0)’*0.: åJ,.% ÄX-SUB* ΫHDC4SIDC4,SUBSO
Cipherteks
tn}oéNÅÈÄqÇjß ̚vgmẏĺ4hcȕlauum
Can be seen in the relationship between plaintext to
ciphertext is very apparent that would make it harder to find a
cryptanalyst of cryptographic Vigenere Cipher Algorithms
keys such as a row of keys generated from a very random
image and key length depends on the dimensions of the
picture that is used as a key. No need to remember the key
because the key consists of random characters that are tough
to remember, just remember the image employed in the
encryption process so that the picture can also be utilized in
the decryption process as long as there are changes to the
pixel values of the image. Vigenere Cipher Algorithm key
generation is quite practical and generated keys are also very
random, so it will be difficult if analyzed by either method
kasiski cryptanalyst and the brute force method.
III. CONCLUSION
This study discusses the formation of a row of keys
vigenere cipher algorithm that is very random to secure a text
file, so it will be difficult to analyze by cryptanalyst. By using
a key generated from the 8-bit grayscale image that has been
converted into a character pixel value using ASCII table it
will produce a series of the main characters were very
random and the length determined by the size or dimensions
of the image are used as the key. In Vigenere Cipher
Algorithm, there is no limit on the duration of the key utilized
so it matches the key generation through the 8-bit grayscale
image. So it is not difficult to find images that can be used as
a key generator. The length and randomness of the key do not
need to remember, to keep in mind is the image that is used
as the key. Because if the imagery used at the time of
encryption, there are differences with the image pixel value
used at the time decryption of the ciphertext will not go back
into the original plaintext.
IV. REFERENCES
[1] G. C. Kessler, An Overview of Cryptography, 2013.
[2] Y. Rajput, D. Naik dan C. Mane, “An Improve Cryptography
Technique to Encrypt Text Using Double Encryption,” International
Journal of Computer Application, vol. 86, no. 6, pp. 24-28, 2014.
[3] W. Stallings, Cryptography and Network Security – Principles and
Practice (Fifth Edition), Pearson Education, Inc, 2011.
[4] A.-A. M. Aliyu and A. Olaniyan, "Vigenere Cipher: Trends, Review
and Possible Modifications," Internasional Journal of Computer
Application, vol. 135, no. 11, pp. 46-50, 2016.
[5] S. Jayaraman, S. Esakkirajan dan T. Veerakumar, Digital Image
Processing, New Delhi: Tata McGraw-Hill Education Private Limited,
2009.
[6] R. C. Gonzales dan R. E. Woods, Digital Image Processing (Third
Edition), Pearson Education, Inc, 2009.
[7] H. Randal, Understanding the Machine, No Stark Press, Inc, 2004.
www.ijert.org
International Journal of Engineering Research & Technology (IJERT)
ISSN: 2278-0181http://www.ijert.org
IJERTV6IS010223 (This work is licensed under a Creative Commons Attribution 4.0 International License.)
Published by :
Vol. 6 Issue 01, January-2017
269