Design and Implementation of AES and SHA-256 Cryptography For Securing Multimedia File Over Android Chat Application
Design and Implementation of AES and SHA-256 Cryptography For Securing Multimedia File Over Android Chat Application
Noveline Aziz Fauziah Eko Hari Rachmawanto De Rosal Ignatius Moses Setiadi
Department of Informatics Engineering Department of Informatics Engineering Department of Informatics Engineering
Dian Nuswantoro University Dian Nuswantoro University Dian Nuswantoro University
Semarang, Indonesia Semarang, Indonesia Semarang, Indonesia
Email: [email protected] Email: [email protected] Email: [email protected]
Abstract— In the current era of globalization, security is the most widely used utilities where the application allows
one of the most important aspects in the development of Android users to keep communicating via the internet, both
communication applications, especially when sending for sending and receiving messages, photos and videos. One
confidential files. Advanced Encryption Standard (AES) is one of the many instant message applications used is WhatsApp.
method that can be used to secure data by encrypting and WhatsApp has facilities that allow users to transfer various
decrypting an information. AES is also an algorithm that has a media files, such as images, audio and video [9]. There are
fast encryption process and has been widely implemented in about 1.7 billion WhatsApp application accounts for Android
various fields. To provide data security that is transferred to users [10]. Besides messaging apps like WhatsApp have
the network, AES is considered a fast and best algorithm. AES
implemented end-to-end encryption that makes data
is an open source cryptography with symmetric keys used for
transmission safer.
encryption and decryption of files. Files to be encrypted are
multimedia files such as images, audio and video. The file is Whatsapp also has facilities to be accessed via computer
entered into the application, then the user inputs a key that is devices via the web.whatsapp.com URL. WhatsApp is one of
encrypted with the SHA-256 algorithm to secure the contents the largest platforms in the world for online communication
of the file. Encrypted files are stored in the UUencoding format that is able to send data and information both between
to avoid the compression process when sending files via the individuals and groups [11]. The process of sending files on
chat application. The file is also safer, because the message
WhatsApp is very efficient because the transmitted file will
cannot be seen directly. Based on the results of experiments in
be compressed where the file is compressed so that it only
this study, multimedia file encryption applications have been
successfully built. Although the process of encryption and
requires smaller storage space and shortens the data
decryption changes the size of the original file a little, the exchange time. But this method makes users unable to use
contents and meaning of the file remain the same and has been WhatsApp when they want to send files with original quality.
wrapped up by measuring the PNSR value that produces an A broad user base also makes this application vulnerable to
infinity value. hacker attacks and a number of other security risks. In the
study [12] an experiment was carried out by retrieving
Keywords—AES, Cryptography, Secure Transmission, information from two phones that had the WhatsApp
WhatsApp, UUencoding application installed, and testing them using the IP protocol
found some information, such as messages sent, call logs,
I. INTRODUCTION timestamps, and so on. Therefore in this study data and
Today more and more human activities need an internet information that will be sent in the form of encrypted data
connection. The internet makes it easy for humans to access that is packaged in a .enc format so that the data can be
data and information. As time goes by, storage of large data received safely and intact. .Enc file format is a uuencoded
and information is needed. Therefore a security system is file extension that represents encrypted data using
needed to maintain data integrity [1] [2] [3]. This raises the UUencoding technology. UUencoding is a binary-to-text
demand for a better data security system to secure data from coding method with UUencode-based ASCII on UNIX. Files
various threats that may arise [4] [5]. So research on data that are encoded in this way are generally safe for
security systems and their implementation continues to be transmission over the internet network and uuencode is also
developed to protect the transmitted data through a often used to send binary files via email [13].
communication network [6] [7]. Using Uuencode, files can be customized by applying
The rapid development of mobile internet and certain encryption algorithms to improve security. AES
smartphone technology makes it a daily human need. The cryptography algorithm is a bit-oriented cipher, making it
use of smartphones with the Android operating system (OS) possible to be implemented efficiently into the software [14].
reaches around 87% of mobile markets worldwide [8]. Some of the other advantages that AES possesses are
Instant messaging application on the Android OS is one of resistance to various types of attacks, having a simple design
and speed on various platforms [4] [15] [16]. So in this study data to a different form that called ciphertext. That the
AES algorithm is implemented to encrypt the sending of process to inverse ciphertext to original data (plaintext) is
multimedia files such as images, audio or video in an decryption. There are three kinds of size of AES keys 128,
Android application where the encryption results will be 192, and 256 bits. Where, the size of the block data and the
transmitted through the WhatsApp application. key will determine the number of processes that must be
passed for the encryption and decryption process. Encryption
II. RESEARCH METHOD process in AES algorithm consists of four kinds of bytes
A. Interface Design transformation, namely SubBytes, ShiftRows, Mixcolumns,
and AddRoundKey [16]. Where the encryption process in
Interface design is the most important part of the AES algoritm can be seen clearly in Figure 1 [17].
application because when the application is run the first one
is the application interface. Interface design consists of the
main menu and about the app. Interface design using
Android Studio tools and Java language. The main menu
consists of an input file sub-menu, input key or generate a
key, encrypt, and decrypt.
B. CryptoHelper Class Design
This class is a class that is used to process the encryption
and decryption of files. In the program creation process,
Android Studio software is used using the Java language.
The table below shows the application modules along with
the information that has been made. The display on the
application in the Android OS is set by the XML file
contained in the res folder and layout. Table I is a module
that has functions in each class. Where the class is
interconnected to be able to access the file to be encrypted or
decrypted, and the process of sending files to the chat
application. Table II shows the layout used in the application.
TABLE I. PROGRAM MODULES OF FILE ENCRYPTION AND Fig. 1. AES Encryption Algorithm
DECRYPTION APPLICATIONS
147
2018 International Seminar on Research of Information Technology and Intelligent Systems (ISRITI)
F. Decryption Method
148
2018 International Seminar on Research of Information Technology and Intelligent Systems (ISRITI)
(a) (b)
(c) (d)
Fig. 5. Multimedia files used in the experiment {(a) Audio files, (b) Video
files, (c) Tulips.jpg, (d) Chrysanthemum.jpg}
Then each file is encrypted with the resulting method so Fig. 8. Sample Encryption results of the image file (Tulips.mp3)
that the encryption data is obtained as shown in Figure 6 to
Figure 8.
149
2018 International Seminar on Research of Information Technology and Intelligent Systems (ISRITI)
TABLE III. ENCRYPTED AND DECRYPTED FILE SIZE IN BYTES confidential multimedia files will be more protected. It's just
Original File Encrypted Decrypted that the encryption and decryption process produces negative
File Name
Size File Size File Size side effects that can increase file size, even though the
Kalimba.mp3 8415232 9898557 9437184 increase is not significant. Even though the file size is fruitful
but the contents of the file have not changed and have been
Sleep Away.mp3 4843520 5494538 5242880 tested using the PSNR function in Matlab. The PSNR value
Tulips.jpg 621568 1075200 1048576 obtained is infinity, this proves that the original file contents
are exactly the same as the decrypted files. Changes in file
Chrysantemum.jpg 879616 1075200 1048576 size may be due to changes in the value in the header file due
Wildlife.wmv 26246144 27674624 27262976 to the encryption and decryption process.
Based on Table III it appears that there is a difference in REFERENCES
file size. Where this file changes in size, both encrypted files
[1] R. D. Ardy, O. R. Indriani, C. A. Sari, D. R. I. M. Setiadi and E. H.
and decrypted files. This happens because the blocking Rachmawanto, "Digital image signature using triple protection
length in the header cipher text file is caused by both the cryptosystem (RSA, Vigenere, and MD5)," in International
encryption process and the use of the extension .enc. Conference on Smart Cities, Automation & Intelligent Computing
However, the decrypted file does not change the value and Systems (ICON-SONICS), Salatiga, 2017.
meaning of the file contents. This is evidenced by the PSNR [2] U. Sudibyo, F. Eranisa, E. H. Rachmawanto, D. R. I. M. Setiadi and
value that produces an infinity value. The PSNR value is C. A. Sari, "A secure image watermarking using Chinese remainder
theorem based on haar wavelet transform," in International
generated from the comparison of the original file and the Conference on Information Technology, Computer, and Electrical
decrypted file [19]. The infinity value indicates that the Engineering (ICITACEE), Semarang, 2017.
contents of the original file are the same as the contents of [3] E. J. Kusuma, C. A. Sari, E. H. Rachmawanto and D. R. I. M. Setiadi,
the decrypted file [20]. The PSNR calculation process is "A Combination of Inverted LSB, RSA, and Arnold Transformation
performed with the PSNR function contained in Matlab. The to get Secure and Imperceptible Image Steganography," Journal of
measurement results of PSNR values are shown in table IV. ICT Research and Applications, vol. 12, no. 2, pp. 103-122, 2018.
[4] A. Vichare, J. Tiwari and . U. Yadav, "Data Security using
TABLE IV. PSNR RESULTS FROM THE COMPARISON OF THE Authenticated Encryption and Decryption Algorithm for Android
ORIGINAL FILE AND DECRYPTED FILE Phones," in International Conference on Computing, Communication
and Automation (ICCCA), Greater Noida, 2017.
File Name PSNR (dB) [5] E. J. Kusuma, O. R. Indriani, C. A. Sari, E. H. Rachmawanto and D.
R. I. M. Setiadi, "An Imperceptible LSB image Hiding on Edge
Kalimba.mp3 inf
Region using DES Encryption," in International Conference on
Sleep Away.mp3 inf Innovative and Creative Information Technology (ICITech), Salatiga,
2017.
Tulips.jpg inf [6] G. Ardiansyah, C. A. Sari, D. R. I. M. Setiadi and E. H.
Rachmawanto, "Hybrid Method using 3-DES, DWT and LSB for
Chrysantemum.jpg inf Secure Image Steganography Algorithm," in International
Wildlife.wmv inf conferences on Information Technology, Information Systems and
Electrical Engineering (ICITISEE), Yogyakarta, 2017 .
[7] D. R. I. M. Setiadi, H. A. Santoso, E. H. Rachmawanto and C. A.
TABLE V. ENCRYPTED AND DERYPTED TIME IN SECONDS Sari, "An improved message capacity and security using divide and
modulus function in spatial domain steganography," in International
Encrypted Decrypted
File Name Conference on Information and Communications Technology
Time Time
(ICOIACT), Yogyakarta, 2018.
Kalimba.mp3 7.3 9.1 [8] K. Rathi, U. Karabiyik, T. Aderibigbe and H. Chi, "Forensic Analysis
of Encrypted Instant Messaging Applications on Android," in
Sleep Away.mp3 5.4 6.4
International Symposium on Digital Forensic and Security (ISDFS),
Tulips.jpg 2.6 2.9 Antalya, 2018.
[9] P. E. Hertzog and A. J. Swart, "The use of WhatsApp in design-based
Chrysantemum.jpg 2,3 2.7 modules," in IEEE Global Engineering Education Conference
(EDUCON), Tenerife, 2018.
Wildlife.wmv 21.0 23.9
[10] A. Shortall and M. A. H. Bin Azhar, "Forensic acquisitions of
Table IV shows the results of calculations with PSNR WhatsApp data on popular mobile platforms," in International
generating inf values, this means that the contents of the file Conference on Emerging Security Technologies (EST),
are exactly the same as the original file, even though the file Braunschweig, 2015.
size changes. Changes may occur only in metadata and have [11] K. F. Mefolere, "WhatsApp and Information Sharing: Prospect and
Challenges," International Journal of Social Science and Humanities
no effect on the contents of the file. Research , vol. 4, no. 1, pp. 615-625, 2016.
In Table V also presented the results of measuring the [12] F.Karpisek, I. Baggili and F.Breitinger, "WhatsApp network
time of the encryption and decryption process. It can be seen forensics: Decrypting and understanding the WhatsApp call signaling
messages," Digital Investigation, vol. 15, pp. 110-118, 2015.
that the decryption process takes longer than the encryption
[13] IBM Knowledge Center, "uuencode() function," IBM, 15 August
process. This is directly proportional to the size of the 2015. [Online]. Available:
enlarged file. https://www.ibm.com/support/knowledgecenter/en/SSULQD_7.2.1/c
om.ibm.nz.sqltk.doc/r_sqlext_uuencode.html. [Accessed 26
IV. CONCLUSION September 2018].
Based on the testing and analysis conducted in this study, [14] S. Tayde and S. Siledar, "File Encryption, Decryption Using AES
it can be concluded that the application made in this study Algorithm in Android Phone," International Journal of Advanced
Research in Computer Science and Software Engineering, vol. 5, no.
successfully implemented the AES algorithm with the SHA- 5, pp. 550-554, 2015.
256 key to encrypt and decrypt multimedia files such as
images, audio and video. That way, of course, sending
150
2018 International Seminar on Research of Information Technology and Intelligent Systems (ISRITI)
[15] B. Rao, D. Tejaswi, K. Varshini, K. P. Shankar and B. Prasanth, [18] R. P. Naik, "Optimising the SHA256 Hashing Algorithm for Faster
"Design Of Modified AES Algorithm For Data Security," and More Efficient Bitcoin Mining," Department cf Computer
International Journal For Technological Research In Engineering, vol. Science University College London, London , 2013.
4, no. 8, pp. 1289-1292, 2017. [19] M. N. M. Najih, D. R. I. M. Setiadi, E. H. Rachmawanto, C. A. Sari
[16] E. H. Rachmawanto, R. S. Amin, D. R. I. M. Setiadi and C. A. Sari, and S. Astuti, "An improved secure image hiding technique using PN-
"A performance analysis StegoCrypt algorithm based on LSB-AES sequence based on DCT-OTP," in International Conference on
128 bit in various image size," in International Seminar on Informatics and Computational Sciences (ICICoS), Semarang, 2017.
Application for Technology of Information and Communication [20] D. R. I. M. Setiadi and J. Jumanto, "An Enhanced LSB-Image
(iSemantic), Semarang, 2017. Steganography Using the Hybrid Canny-Sobel Edge Detection,"
[17] F. Shao, Y. Zhang and Z. Chang, "AES Encryption Algorithm Based Cybernetics and Information Technologies, vol. 18, no. 2, pp. 74-88,
on the High Performance Computing of GPU," in Second 2018.
International Conference on Communication Software and Networks,
Nanjing, China, 2010.
151