Flowchart Enkripsi MMB Proses Dekripsi Algoritma MMB

3.1.5.3 Flowchart Enkripsi MMB

Gambar 3.3 merupakan proses enkripsi MMB : Plaintext Dipecah menjadi blok-blok 128 bit For i= 1 to jumlah blok Xor x,0 Fx Xor x,1 Fx Xor x,2 Fx Xor x,3 Fx Xor x,0 Fx Xor x,1 Fx Xor x,2 X , X 1 , X 2 , X 3 digabung kembali ciphertext Selesai Mulai Gambar 3.3 Flowchart Proses Enkripsi MMB Universitas Sumatera Utara Bagan sub proses XORx,k seperti gambar 3.4 For i= 0 to 3 x = x i xor k i Mulai Selesai Gambar 3.4 Sub proses XORx,k Sedangkan fungsi fx diatas dapat digambarkan dalam bentuk bagan seperti gambar 3.5 For i= 0 to 3 X i = γ i X i Mulai LSB X = 1 LSB X 3 = 0 X = X xor δ X 3 = X 3 Xor δ ya tidak ya tidak For i= 0 to 3 X i = X i-1 xor X i xor X i+1 Selesai Gambar 3.5 Fungsi fx pada Proses Enkripsi Algoritma MMB Universitas Sumatera Utara

3.1.5.4 Proses Dekripsi Algoritma MMB

Proses dekripsi tidak jauh berbeda dengan proses enkripsi. Proses dekripsi dilakukan dengan membalik urutan proses enkripsi dan melakukan penyesuaian di beberapa proses. 14. x i = x i XOR k i+2 15. fx , x 1 , x 2 , x 3 16. x i = x i XOR k i+1 17. fx , x 1 , x 2 , x 3 18. x i = x i XOR k i 19. fx , x 1 , x 2 , x 3 20. x i = x i XOR k i+3 21. fx , x 1 , x 2 , x 3 22. x i = x i XOR k i+2 23. fx , x 1 , x 2 , x 3 24. x i = x i XOR k i+1 25. fx , x 1 , x 2 , x 3 26. x i = x i XOR k i Fungsi fx 1 , x 2 , x 3 , x 4 sebagai berikut: d. x i = x i-1 XOR x i XOR x i+1 e. Jika LSB x = 1, maka x = x XOR δ Jika LSB x 3 = 0, maka x 3 = x 3 XOR δ f. x i = γ i -1 x i keterangan : x i : sub blok Plainteks k i : sub blok Kunci key δ : Konstanta tetapan yang digunakan pada proses enkrip dekrip dengan nilai, 2AAAAAAA γ -1 : Invers dari konstanta γ dari proses enkripsi yang digunakan untuk proses dekripsi dengan nilai , 0DAD4694 Universitas Sumatera Utara Sebagai contoh, akan ditunjukkan sebagian proses dekripsi metode MMB dengan menggunakan kunci dan data sebelumnya seperti berikut : Cipher hex = 2e 45 b6 c4 be 2e 8d 2d c8 dd e5 76 ab 63 07 ec 97 f5 b4 18 73 04 ef f8 f5 d6 22 1b c3 d2 49 bf c2 2d 0f dc 96 88 88 a4 ce e8 13 a2 20 4f dc e6 dd 33 42 bd 24 b7 1f 9a 5c 7f 46 c8 63 eb e3 c0 8b b8 3b e4 5d 61 6f 0d 7d 7e 6f c1 d8 ce f1 54 Cipher blok 128- bit = Blok cipher 0 : 00101110010001011011011011000100 10111110001011101000110100101101 11001000110111011110010101110110 10101011011000110000011111101100 Blok cipher 1 : 10010111111101011011010000011000 01110011000001001110111111111000 11110101110101100010001000011011 11000011110100100100100110111111 Blok cipher 2 : 11000010001011010000111111011100 10010110100010001000100010100100 11001110111010000001001110100010 00100000010011111101110011100110 Blok cipher 3 : 11011101001100110100001010111101 00100100101101110001111110011010 01011100011111110100011011001000 01100011111010111110001111000000 Blok cipher 4 : 10001011101110000011101111100100 01011101011000010110111100001101 01111101011111100110111111000001 11011000110011101111000101010100 BLOK CI PHER 0 Langkah 1: x[ i] = x[ i] XOR k[ i+ 2] x[0] = x[0] XOR k[2] = 00101110010001011011011011000100 XOR 01001011010011110100110101010000 = 01100101000010101111101110010100 x[1] = x[1] XOR k[3] = 10111110001011101000110100101101 XOR 01010101010101000100010101010010 = 11101011011110101100100001111111 x[2] = x[2] XOR k[0] = 11001000110111011110010101110110 XOR 01010011001100010010000001001001 = 10011011111011001100010100111111 x[3] = x[3] XOR k[1] = 10101011011000110000011111101100 XOR 01001100010011010101010100100000 = 11100111001011100101001011001100 Langkah 2: x[ i] = fI nverse x[ i] x[ i] = x[ i- 1] XOR x[ i] XOR x[ i+ 1] x[3] = x[2] XOR x[3] XOR x[0] = 10011011111011001100010100111111 XOR 11100111001011100101001011001100 XOR 01100101000010101111101110010100 = 00011001110010000110110001100111 x[2] = x[1] XOR x[2] XOR x[3] = 11101011011110101100100001111111 XOR 10011011111011001100010100111111 XOR 00011001110010000110110001100111 = 01101001010111100110000100100111 x[1] = x[0] XOR x[1] XOR x[2] Universitas Sumatera Utara = 01100101000010101111101110010100 XOR 11101011011110101100100001111111 XOR 01101001010111100110000100100111 = 11100111001011100101001011001100 x[0] = x[3] XOR x[0] XOR x[1] = 00011001110010000110110001100111 XOR 01100101000010101111101110010100 XOR 11100111001011100101001011001100 = 10011011111011001100010100111111 if lsb x[ 0] = = 1, then x[ 0] = x[ 0] XOR delta lsbx[0] = 1, x[0] = x[0] XOR delta = 10011011111011001100010100111111 XOR 00101010101010101010101010101010 = 10110001010001100110111110010101 if lsb x[ 3] = = 0, then x[ 3] = x[ 3] XOR delta lsbx[3] = 1 x[ i] = gammaI nverse[ i] x[ i] x[0] = gammaInverse[0] x[0] = 00001101101011010100011010010100 10110001010001100110111110010101 = 11000001011001001101000101000111 x[1] = gammaInverse[1] x[1] = 11011010110101000110100101000000 11100111001011100101001011001100 = 01010110110100001011110100010111 x[2] = gammaInverse[2] x[2] = 11011010110101000110100101000000 01101001010111100110000100100111 = 11101100001000111001111000101001 x[3] = gammaInverse[3] x[3] = 11011010110101000110100101000000 00011001110010000110110001100111 = 00110100011001101111110011101101 Universitas Sumatera Utara

3.1.5.5 Flowchart Dekripsi MMB