KRIPTOGRAFI VISUAL DENGAN ALGORITMA ELGAMAL YANG DIMODIFIKASI UNTUK CITRA BERWARNA DENGAN TIGA CITRA HASIL ENKRIPSI MENGGUNAKAN PERANGKAT LUNAK MATLAB Alexander Edi Suranta Kacaribu Email: [email protected] Jurusan Teknik Elektro, Fakultas Teknik Universitas Kristen Maranatha Jl. Prof. Drg. Suria Sumantri 65, Bandung 40164, Indonesia ABSTRAK Pada zaman modern ini, teknologi pengiriman pesan makin sering digunakan. Tetapi apabila pesan yang ingin dikirimkan bersifat rahasia, maka pesan tersebut harus dimodifikasi agar hanya dapat dimengerti oleh penerima yang dituju. Hal ini dapat dilakukan dengan memakai kriptografi. Algoritma ElGamal pertama kali diperkenalkan oleh Taher ElGamal pada tahun 1985. Algoritma ini adalah algoritma kunci publik dan keamanannya terletak pada kesulitan untuk mencari logaritma diskrit. Algoritma ElGamal telah sering digunakan untuk mengenkripsi dan mendekripsikan text, email, file, dan software. Pada tugas akhir ini, algoritma ElGamal akan digunakan sebagai algoritma kriptografi visual untuk mengenkripsi dan mendekripsikan satu gambar. Pengujian dilakukan dengan 4 citra berbeda. Dilakukan penilaian dengan MSE (Mean Squared Error) untuk membandingkan citra awal dengan citra hasil dekripsi untuk mendeteksi adanya error. Hasil dari pengujian MSE adalah 0 untuk semua citra. Hal ini membuktikan bahwa citra awal dan citra hasil dekripsi mempunyai nilai matrix yang sama. Kata Kunci : kriptografi, kriptografi visual, elgamal, matlab Universitas Kristen Maranatha i VISUAL CRYPTOGRAPHY WITH MODIFIED ELGAMAL ALGORITHM FOR COLORED IMAGE TO PRODUCE THREE CIPHER IMAGES USING MATLAB Alexander Edi Suranta Kacaribu Email: [email protected] Department of Electrical Engineering, Faculty of Engineering Maranatha Christian University Jl. Prof. Drg. Suria Sumantri 65, Bandung 40164, Indonesia ABSTRACT Nowadays, messaging technology more often used in daily life. But if the message is confidential, it should be modified so that only can be understood by the intended recipients. This can be done by using cryptography. ElGamal algorithm was first introduced by Taher ElGamal in 1985. This algorithm is public key algorithm and the security lies in the difficulty to find discrete logarithm. ElGamal algorithm has often been used to encrypt and decrypt a text, email, file and software. In this final assignment, ElGamal algorithm will be used as algorithm of visual cryptography to encrypt and decrypt a digital image. Tests will be conducted with 4 different images. Assessment is conducted using MSE (Mean Squared Error) to calculate the difference between the matrix of the initial image with the decrypted image to detect if there are errors. The result of MSE are 0 for all images. This proves that the initial images and the decrypted image has same matrix value. Keyword : cryptography, visual cryptography, elgamal, matlab Universitas Kristen Maranatha ii DAFTAR ISI LEMBAR PENGESAHAN PERNYATAAN ORISINALITAS LAPORAN PERNYATAAN PUBLIKASI LAPORAN TUGAS AKHIR KATA PENGANTAR ABSTRAK................................................................................................................i ABSTRACT.............................................................................................................ii DAFTAR ISI ..........................................................................................................iii DAFTAR GAMBAR ...............................................................................................v DAFTAR TABEL...................................................................................................vi BAB I PENDAHULUAN........................................................................................1 I.1 Latar Belakang........................................................................................1 I.2 Perumusan Masalah.................................................................................2 I.3 Tujuan Penelitian.....................................................................................2 I.4 Pembatasan Masalah...............................................................................2 I.5 Sistematika Pemahasan...........................................................................2 BAB II LANDASAN TEORI...................................................................................4 II.1 Kriptografi.............................................................................................4 II.1.1 Definisi dan Terminologi........................................................4 II.1.2 Prinsip Dasar Kriptografi[ ] ..................................................5 II.1.3 Jenis-Jenis Kriptografi............................................................6 II.2 Kriptografi Visual..................................................................................8 Universitas Kristen Maranatha iii II.3 Citra Digital.........................................................................................10 II.4 Algoritma ElGamal..............................................................................14 II.4.1 Besaran-Besaran dalam Algoritma Elgamal.........................14 II.4.2 Pembangkitan Kunci[ ] .......................................................15 II.4.3 Proses Enkripsi[ ] ................................................................15 II.4.4 Proses Dekripsi[ ] ................................................................17 II.5 Pengujian Gambar dengan MSE..........................................................18 BAB III PERANCANGAN DAN REALISASI.....................................................19 III.1 Perancangan Perangkat Lunak............................................................19 III.2 Pembangkitan Kunci...........................................................................20 III.3 Prosedur Proses Enkripsi....................................................................23 III.4 Prosedur Proses Dekripsi....................................................................27 BAB IV DATA PENGAMATAN DAN ANALISIS DATA..................................31 IV.1 Data Pengamatan................................................................................31 IV.2 Analisis Data......................................................................................34 BAB V KESIMPULAN DAN SARAN..................................................................35 V.1 Kesimpulan..........................................................................................35 V.2 Saran....................................................................................................35 DAFTAR PUSTAKA............................................................................................36 LAMPIRAN...........................................................................................................37 Universitas Kristen Maranatha iv DAFTAR GAMBAR Gambar 2.1 Proses Enkripsi Menggunakan Kunci...................................................6 Gambar 2.2 Contoh Kriptografi Visual.....................................................................9 Gambar 2.3 Resolusi Citra......................................................................................11 Gambar 2.4 Visualisasi RGB..................................................................................13 Gambar 2.5 CMYK................................................................................................13 Gambar 2.6 Proses Pembangkitan Kunci................................................................15 Gambar 2.7 Skema Enkripsi Kriptografi Visual dengan Algoritma ElGamal yang Telah Dimodifikasi.................................................................................................17 Gambar 2.8 Skema Dekripsi Kriptografi Visual dengan Algoritma ElGamal yang Telah Dimodifikasi.................................................................................................18 Gambar 3.1 Diagram Blok Kriptografi Visual dengan Algoritma Elgamal dengan 3 Citra Hasil Enkripsi................................................................................................19 Gambar 3.2 Diagram Alir Proses Pembangkitan Kunci..........................................21 Gambar 3.3 Diagram Alir Proses Enkripsi..............................................................23 Gambar 3.4 Diagram Alir Subprocess Menghitung Rumus Enkripsi Algoritma ElGamal.................................................................................................................24 Gambar 3.5 Diagram Alir Proses Enkripsi..............................................................27 Gambar 3.6 Diagram Alir Subprocess Menghitung Rumus Dekripsi Algoritma ElGamal.................................................................................................................28 Universitas Kristen Maranatha v DAFTAR TABEL Tabel 2.1 Hubungan Antara Kedalaman Warna Dan Resolusi Warna....................12 Tabel 4.1 Citra Hasil Percobaan.............................................................................31 Tabel 4.2 Perbandingan Waktu Proses Program Terhadap Nilai p yang Digunakan..............................................................................................................33 Tabel 4.3 Nilai MSE pada Setiap Percobaan...........................................................34 Universitas Kristen Maranatha vi