SetPixel picDest, i, j + 2 Next j
Next i End If
4.1.6 Algoritma Dekripsi Hill Cipher
Call MatrixINVMatrixKey If MatrixSize = 2 Then
For i = 0 To picSource.ScaleWidth - 1 For j = 0 To picSource.ScaleHeight - 1 Step 2
Set MatrixHill1, 1 = Empty Set MatrixHill1, 2 = Empty
Set MatrixHill1, 3 = Empty Set MatrixHill2, 1 = Empty
Set MatrixHill2, 2 = Empty Set MatrixHill2, 3 = Empty
GetPixel i, j PixelColor = GetPixelpicSource, i, j
R = PixelColor Mod 256 G = PixelColor \ 256 Mod 256
B = PixelColor \ 256 \ 256 MatrixPic1, 1 = R
MatrixPic1, 2 = G MatrixPic1, 3 = B
PixelColor = GetPixelpicSource, i, j + 1 R = PixelColor Mod 256
G = PixelColor \ 256 Mod 256 B = PixelColor \ 256 \ 256
MatrixPic2, 1 = R MatrixPic2, 2 = G
MatrixPic2, 3 = B Call MatrixMULMatrixKey, MatrixPic, MatrixHill
Reset Nilai kembali For k = 1 To 2
Universitas Sumatera Utara
For l = 1 To 3 Dump = MatrixHillk, l
If Dump 0 Then While Dump 0
Dump = Dump + 256 Wend
ElseIf Dump = 0 Then Dump = Dump Mod 256
End If MatrixHillk, l = Dump
Next l Next k
Set Pixel Kembali SetPixel picDest, i, j
SetPixel picDest, i, j + 1 Next j
Next i End If
If MatrixSize = 3 Then For i = 0 To picSource.ScaleWidth - 1
For j = 0 To picSource.ScaleHeight - 1 Step 3 Set MatrixHill21, 1 = Empty
Set MatrixHill21, 2 = Empty Set MatrixHill21, 3 = Empty
Set MatrixHill22, 1 = Empty Set MatrixHill22, 2 = Empty
Set MatrixHill22, 3 = Empty Set MatrixHill23, 1 = Empty
Set MatrixHill23, 2 = Empty Set MatrixHill23, 3 = Empty
GetPixel i, j PixelColor = GetPixelpicSource, i, j
R = PixelColor Mod 256 G = PixelColor \ 256 Mod 256
B = PixelColor \ 256 \ 256 MatrixPic21, 1 = R
Universitas Sumatera Utara
MatrixPic21, 2 = G MatrixPic21, 3 = B
PixelColor = GetPixelpicSource, i, j + 1 R = PixelColor Mod 256
G = PixelColor \ 256 Mod 256 B = PixelColor \ 256 \ 256
MatrixPic22, 1 = R MatrixPic22, 2 = G
MatrixPic22, 3 = B PixelColor = GetPixelpicSource, i, j + 2
R = PixelColor Mod 256 G = PixelColor \ 256 Mod 256
B = PixelColor \ 256 \ 256 MatrixPic23, 1 = R
MatrixPic23, 2 = G MatrixPic23, 3 = B
Call MatrixMULMatrixKey, MatrixPic2, MatrixHill2
Reset Nilai kembali For k = 1 To 3
For l = 1 To 3 Dump = MatrixHill2k, l
If Dump 0 Then While Dump 0
Dump = Dump + 256 Wend
ElseIf Dump = 0 Then Dump = Dump Mod 256
End If MatrixHill2k, l = Dump
Next l Next k
Set Pixel Kembali SetPixel picDest, i, j
SetPixel picDest, i, j + 1 SetPixel picDest, i, j + 2
Universitas Sumatera Utara
Next j Next i
End If
4.2 Implementasi Sistem