PENGAMANAN FILE GAMBAR PADA PERANGKAT MOBILE ANDROID MENGGUNAKAN METODE STEGANOGRAFI LSB DAN ALGORITMA KRIPTOGRAFI AES
SKRIPSI
Gede Wisnu Bhaudhayana NIM. 1008605013
JURUSAN ILMU KOMPUTER FAKULTAS MATEMATIKA DAN ILMU PENGETAHUAN ALAM UNIVERSITAS UDAYANA BUKIT JIMBARAN 2015
i
LEMBAR PENGESAHAN TUGAS AKHIR
Judul Skripsi
: Pengamanan File Gambar Pada Perangkat Mobile Android Menggunakan Metode Steganografi LSB Dan Algoritma Kriptografi AES
Kompetensi
: Jaringan Komputer
Nama
: Gede Wisnu Bhaudhayana
NIM
: 1008605013
Tanggal Seminar : 7 Agustus 2015 Disetujui oleh: Pembimbing I
Penguji I
I Made Widhi Wirawan, S.Si., M.Cs. NIP. 197511052005011004
Drs. I Wayan Santiyasa, M.Si NIP. 196704141992031002
Pembimbing II
Penguji II
I Komang Ari Mogi, S.Kom., M.Kom
Ida Bagus Made Mahendra,S.Kom, M.Kom NIP. 198006212008121002
NIP. 198409242008011007
Penguji III
I Made Widiartha, S.Si, M.Kom NIP. 198212202008011008 Mengetahui, Jurusan Ilmu Komputer FMIPA UNUD Ketua,
Drs. I Wayan Santiyasa, M.Si NIP. 196704141992031002
ii
Judul
: Pengamanan File Gambar Pada Perangkat Mobile Android Menggunakan Metode Steganografi LSB Dan Algoritma Kriptografi AES Nama : Gede Wisnu Bhaudhayana NIM : 1008605013 Pembimbing I : I Made Widhi Wirawan, S.Si., M.Cs. Pembimbing II : I Komang Ari Mogi, S.Kom., M.Kom ABSTRAK Penggunaan perangkat mobile berbasis Android mengalami perkembangan yang pesat di masyarakat pada saat ini. Oleh karena itu, informasi-informasi penting dari pengguna perangkat Android perlu untuk diamankan demi mencegah adanya kebocoran informasi oleh pihak-pihak yang tidak berwenang. Salah satunya adalah informasi dari gambar yang penting. Demi melindungi informasi gambar yang penting, perlu dilakukan keamanan terhadap informasi tersebut. Adapun cara untuk mengamankan dan menjaga kerahasiaan informasi dari gambar tersebut adalah dengan kriptografi dan steganografi Dengan algoritma kriptografi AES dan metode steganografi LSB, pada penelitian ini dibuat sebuah aplikasi yang mampu mengamankan file gambar pada perangkat mobile Android. Adapun beberapa pengujian yang dilakukan. Pengujian integritas data dengan SHA-1, pengujian kualitas hasil penyisipan dengan PSNR untuk mengetahui nilai error dan kualitas hasil penyisipan, pengujian secara visual terhadap gambar chiper dan gambar stegano. Dari hasil pengujian SHA-1, file gambar pesan asli memiliki nilai hash yang sama dengan file gambar hasil dekripsi. Pengujian kualitas hasil penyisipan menggunakan PSNR mendapatkan nilai error rata-rata sebesar 0,177866667 dB dan nilai PSNR rata-rata sebesar 56,67151667 dB yang menunjukkan bahwa kualitas hasil penyisipan yang baik. Pengujian secara visual menunjukkan bahwa gambar pesan asli dapat diubah menjadi gambar chiper, dan cover image tidak terlihat perbedaan dengan stego image. Dari pengujian yang dilakukan, menunjukkan bahwa aplikasi yang dibuat dapat mengamankan file gambar pada perangkat mobile Android. Kata kunci : Kriptografi, Steganografi, AES (Advanced Encryption Standard), LSB (Least Significant Bit), SHA-1, PSNR, Android.
iii
Title
Name Student Number Main Supervisor Co-Supervisor
: Securing Image Files on Android Mobile Device Using LSB Steganography and AES Cryptographic Algorithm Methods : Gede Wisnu Bhaudhayana : 1008605013 : I Made Widhi Wirawan, S.Si., M.Cs. : I Komang Ari Mogi, S.Kom., M. Kom ABSTRACT
The use of Android-based mobile devices experiences rapid growth in the community today. Therefore, important information from users of Android devices needs to be secured in order to prevent the leakage of information by unauthorized parties. One of them is the information of important images. In order to protect important image information, it is necessary to secure that information. As for how to secure and maintain the confidentiality of the information of the image is through the use of cryptography and steganography With AES cryptographic algorithm and LSB steganographic method, this study made an application which is able to secure an image file on an Android mobile device. There were some tests performed: testing the integrity of the data with SHA-1, testing the quality of the insertion in PSNR to determine the error value and the quality of insertion, and visual examination of stegano and cipher images. From the SHA-1test results, the original image file messages had the same hash value as the image file of decryption results. Testing the quality of the insertion using PSNR gained the error value at an average of 0.177866667 dB and the PSNR value at an average of 56.67151667 dB which indicated that the quality of insertion was good. Testing visually indicated that the image of the original message could be converted to cipher images, and the cover image did not have visible differences from stego images. From the tests, it showed that the application was made to secure the image files on Android mobile devices. Keywords: Cryptography, Steganography, AES (Advanced Encryption Standard), LSB (Least Significant Bit), SHA-1, PSNR, Android
iv
KATA PENGANTAR Puji syukur penulis panjatkan kehadirat TuhanYang Maha Esa karena atas rahmat dan berkatnya, penulis dapat menyelesaikan Laporan Tugas Akhir dengan judul, “Pengamanan File Gambar Pada Perangkat Mobile Android Menggunakan Metode Steganografi LSB Dan Algoritma Kriptografi AES” dapat diselesaikan tepat pada waktunya. Sehubungan dengan telah terselesaikannya Laporan Tugas Akhir ini, penulis secara khusus mengucapkan terima kasih kepada pihak yang telah membantu dalam menyusun Laporan Tugas Akhir ini, yaitu kepada: 1. Bapak Drs. I Wayan Santiyasa, M.Si selaku ketua jurusan Ilmu Komputer Fakultas Matematika dan Ilmu Pengetahuan Alam Universitas Udayana. 2. Bapak I Made Widhi Wirawan, S.Si., M.Cs. selaku Pembimbing I dan Bapak I Komang Ari Mogi, S.Kom., M.Kom selaku Pembimbing II yang telah banyak membantu, menuntun, dan mengarahkan penulisan dalam menyempurnakan Laporan Tugas Akhir ini. 3. Bapak dan Ibu dosen di Jurusan Ilmu Komputer yang telah meluangkan waktu untuk memberikan saran dan masukan untuk menyempurnakan Laporan Tugas Akhir ini. 4. Semua pihak yang telah memberi dukungan sehingga laporan ini dapat diselesaikan sesuai dengan waktu yang ditentukan. Pada akhirnya penulis berharap agar adanya perbaikan pada Laporan Tugas Akhir ini mengingat keterbatasan penulis, sehingga sangat diharapkan untuk adanya kritik dan saran yang membangun untuk pencapaian yang lebih baik. .
Bukit Jimbaran, Februari 2015 Penulis
v
DAFTAR ISI LEMBAR PENGESAHAN TUGAS AKHIR ........................................................ ii ABSTRAK ............................................................................................................. iii ABSTRACT ........................................................................................................... iv KATA PENGANTAR .............................................................................................v DAFTAR ISI .......................................................................................................... vi DAFTAR TABEL .................................................................................................. ix DAFTAR GAMBAR ...............................................................................................x BAB I.. .....................................................................................................................1 PENDAHULUAN ...................................................................................................1 1.1 Latar Belakang ...............................................................................................1 1.2 Rumusan Masalah ..........................................................................................3 1.3 Tujuan Penelitian............................................................................................3 1.4 Batasan Masalah .............................................................................................3 1.5 Manfaat Penelitian..........................................................................................3 1.6 Metodelogi Penelitian ....................................................................................4 1.6.1 Desain Penelitian .....................................................................................4 1.6.3 Pengumpulan Data ...................................................................................4 1.6.4 Analisis Kebutuhan ..................................................................................4 1.6.5 Pengujian Sistem .....................................................................................5 BAB II......................................................................................................................7 TINJAUAN PUSTAKA ..........................................................................................7 2.1 Kriptografi ......................................................................................................7 2.1.1 Kunci Kriptografi.....................................................................................7 2.2 Algoritma AES ...............................................................................................8 2.3 Proses Enkripsi AES ....................................................................................10
vi
2.3.1 SubBytes.................................................................................................11 2.3.2 ShiftRows ...............................................................................................11 2.3.3 MixColumns ..........................................................................................12 2.4 Proses Dekripsi AES ....................................................................................12 2.4.1 InvShiftRows ..........................................................................................13 2.4.2 InvSubBytes............................................................................................13 2.4.3 InvMixColumns ......................................................................................14 2.5 AddRound Key ..............................................................................................14 2.6 Key Schedule ................................................................................................15 2.7 Steganografi .................................................................................................15 2.8 Metode LSB (Least Significant Bit) .............................................................16 2.9 Algoritma SHA (Secure Hash Algorithm) ...................................................17 2.9.1 SHA-1 ....................................................................................................17 2.10 PSNR (Peak Signal To Noise Ratio) ..........................................................20 2.11 Android.......................................................................................................21 BAB III ..................................................................................................................22 ANALISIS DAN PERANCANGAN ....................................................................22 3.1 Objek Penelitian ...........................................................................................22 3.2 Variabel Penelitian .......................................................................................22 3.3 Analisis Kebutuhan ......................................................................................22 3.4 Teknik Observasi..........................................................................................23 3.5 Desain Perancangan Sistem .........................................................................23 3.5.1 Skema Enkripsi Dan Penyisipan ............................................................23 3.5.2 Skema Ekstraksi Dan Dekripsi ..............................................................24 3.5.3 Flowchart Enkripsi Algoritma AES 256................................................25 3.5.4 Flowchart Dekripsi Algoritma AES 256 ...............................................26
vii
3.5.5 Flowchart Penyisipan Metode LSB .......................................................27 3.5.6 Flowchart Ekstraksi Metode LSB ..........................................................28 3.5.7 Flowchart Enkripsi Dan Penyisipan .........................................................29 3.5.8 Flowchart Ekstraksi Dan Dekripsi ........................................................30 3.6 Kebutuhan Hardware.................................................................................30 3.7 Kebutuhan Software ...................................................................................31 BAB IV ..................................................................................................................32 HASIL DAN PEMBAHASAN..............................................................................32 4.1 Implementasi Sistem ..................................................................................32 4.1.1 Implementasi Tampilan Antar Muka Sistem .........................................32 4.1.2 Implementasi Pengamanan File dalam Sistem ......................................37 4.2 Pengujian Sistem ..........................................................................................47 4.2.1 Pengujian Integritas Data .......................................................................47 4.2.2 Pengujian Kualitas Hasil Penyisipan .....................................................48 4.2.3 Pengujian Waktu Proses ........................................................................50 4.2.4 Pengujian Visualisasi .............................................................................51 4.2.5 Pengujian Black Box ..............................................................................53 BAB V ...................................................................................................................57 KESIMPULAN ......................................................................................................57 5.1 Kesimpulan...................................................................................................57 5.2 Saran .............................................................................................................58 DAFTAR PUSTAKA ............................................................................................59
viii
DAFTAR TABEL Tabel 2.1 Panjang Kunci Algoritma AES ................................................................9 Tabel 2.2 Rcon .......................................................................................................15 Tabel 4.1 Daftar Gambar Pesan .............................................................................47 Tabel 4.2 Hasil Pengujian SHA-1 ..........................................................................48 Tabel 4.3 Daftar Gambar Penampung....................................................................49 Tabel 4.4 Hasil Pengujian PSNR ...........................................................................50 Tabel 4.5 Pengujian Waktu Proses ........................................................................51 Tabel 4.6 Pengujian Visual Gambar Chiper ..........................................................51 Tabel 4.7 Pengujian Visual Stego Image ...............................................................53 Tabel 4.8 Pengujian Black Box Proses Penyisipan ................................................54 Tabel 4.9 Pengujian Black Box Proses Ekstraksi ...................................................54 Tabel 4.10 Pengujian Black Box Proses Pengujian ................................................55
ix
DAFTAR GAMBAR Gambar 2.1 Proses input bytes, state array, output bytes ........................................9 Gambar 2.2 Proses Enkripsi Algoritma AES .........................................................10 Gambar 2.3 S-Box ..................................................................................................11 Gambar 2.4 Pemetaan pada setiap byte pada state.................................................11 Gambar 2.5 Proses ShiftRows ................................................................................12 Gambar 2.6 Skema Dekripsi Algoritma AES ........................................................13 Gambar 2.7 Transformasi InvShiftRows ................................................................13 Gambar 2.8 Inverse S-Box .....................................................................................14 Gambar 2.9 Ukuran Message Digest Pada Algoritma SHA ..................................17 Gambar 2.10 Analogi fungsi hash pada SHA-1 ...................................................19 Gambar 3.1 Skema Enkripsi Dan Penyisipan ........................................................23 Gambar 3.2 Skema Ekstraksi Dan Dekripsi...........................................................24 Gambar 3.3 Flowchart Proses Enkripsi Algoritma AES 256 ................................25 Gambar 3.4 Flowchart Proses Dekripsi Algoritma AES 256 ................................26 Gambar 3.5 Flowchart Penyisipan Metode LSB ...................................................27 Gambar 3.6 Flowchart Ekstraksi Metode LSB......................................................28 Gambar 3.7 Flowchart Enkripsi dan Penyisipan ...................................................29 Gambar 3.8 Flowchart Ekstraksi Dan Dekripsi .....................................................30 Gambar 4.1 Tampilan Menu Sistem ......................................................................32 Gambar 4.2 Tampilan Enkripsi Dan Penyisipan ....................................................33 Gambar 4.3 Tampilan Ekstraksi Dan Dekripsi ......................................................34 Gambar 4.4 Tampilan Pengujian ...........................................................................35 Gambar 4.5 Tampilan Hasil Enkripsi Gambar.......................................................36 Gambar 4.6 Tampilan Hasil Penyisipan Gambar...................................................36 Gambar 4.7 Tampilan Hasil Ekstraksi Gambar Stegano .......................................37
x
Gambar 4.8 Tampilan Hasil Dekripsi ....................................................................37 Gambar 4.9 Code Proses SubBytes ........................................................................38 Gambar 4.10 Code Proses ShiftRows .....................................................................38 Gambar 4.11 Code Proses MixColumns ................................................................39 Gambar 4.12 Code Proses Enkripsi AES ...............................................................40 Gambar 4.13 Code Proses Inverse SubBytes .........................................................41 Gambar 4.14 Code Proses Inverse ShiftRows ........................................................41 Gambar 4.15 Code Proses Inverse MixColumns ....................................................42 Gambar 4.16 Code Proses Dekripsi AES...............................................................43 Gambar 4.17 Code Proses AddRoundKey ..............................................................44 Gambar 4.18 Code Proses Key Expansion .............................................................45 Gambar 4.19 Code Proses Penyisipan ...................................................................46 Gambar 4.20 Code Proses Ekstraksi ......................................................................46
xi
12