Buka aplikasi Microsoft Visual Studio 2008
Klik menu File, Pilih New Project
Buat nama project
Maka akan tampil lembar kerjanya.
1. Desain dan atur FORM-nya seperti berikut :

2. tambah formnya (kriptografi Caesar) dan desain seperti dibawah ini
Private Sub Enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enkripsi.Click
Dim x As String = ""
Dim xkalimat As String = ""
For i = 1 To Len(Plainteks.Text)
x = Mid(Plainteks.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
Chiperteks.Text = xkalimat
End Sub
End Class
3. Tambah form3 (Kriptografi Vernam) dan desain seperti dibawah ini
Atur Settingan code nya seperti di bawah ini :
Public Class form3
Private Sub form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Plainteks.Text = ""
Kunci.Text = ""
Chiperteks.Text = ""
End Sub
Private Sub Enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enkripsi.Click
Dim s As Integer
Dim jum As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String = ""
Dim nEnc As Integer
jum = 0
sKata = Plainteks.Text
jum = Len(sKata)
sKey = Kunci.Text
For i = 1 To jum
If s = Len(sKey) Then
s = 1
Else
s = s + 1
End If
nKata = Asc(Mid(sKata, i, 1)) - 65
nKunci = Asc(Mid(sKey, i, 1)) - 65
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc) + 65)
Next i
Chiperteks.Text = sPlain
End Sub
Private Sub Plainteks_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plainteks.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim tombol As Integer = Asc(e.KeyChar)
If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
End If
End Sub
Private Sub Kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Kunci.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim tombol As Integer = Asc(e.KeyChar)
If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
End If
End Sub
End Class
4. Tambah Form4 (Kriptografi Gronsfeld) dan desain seperti dibawah ini
Atur Settingan code nya seperti di bawah ini :
Public Class Form4
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Plainteks.Text = ""
kunci.Text = ""
Chiperteks.Text = ""
End Sub
Private Sub Plainteks_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plainteks.KeyPress
If ((e.KeyChar >= "0" And e.KeyChar <= "9") And e.KeyChar <> vbBack) Then e.Handled = True
End Sub
Private Sub Kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Kunci.KeyPress
If Not ((e.KeyChar >= "0" And e.KeyChar <= "9") Or e.KeyChar = vbBack) Then e.Handled = True
End Sub
Private Sub Enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enkripsi.Click
Dim j As Integer
Dim jum As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String = ""
Dim nEnc As Integer
j = 0
sKata = Plainteks.Text
jum = Len(sKata)
sKey = Kunci.Text
For i = 1 To jum
If j = Len(sKey) Then
j = 1
Else
j = j + 1
End If
nKata = Asc(Mid(sKata, i, 1)) - 65
nKunci = Asc(Mid(sKey, j, 1)) - 48
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc) + 65)
Next i
Chiperteks.Text = sPlain
End Sub
End Class
5. Tambah Form5 (Kripantografi Vigenere) dan atau desainnya seperti dibawah ini
selanjutnya kiptografi Gronsfeld dan isi codenya
Private Sub KriptografiGronsfeldToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriptografiGronsfeldToolStripMenuItem.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
selanjutnya kiptografi Vigenere dan isi codenya
Private Sub KriptografiVigenereToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriptografiNigenereToolStripMenuItem.Click
Form5.MdiParent = Me
Form5.Show()
End Sub
Selesai.......
maka setelah di Debbugkan maka hasilnya seperti dibawah ini
Atur Settingan code nya seperti di bawah ini :
Public Class Form2Private Sub Enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enkripsi.Click
Dim x As String = ""
Dim xkalimat As String = ""
For i = 1 To Len(Plainteks.Text)
x = Mid(Plainteks.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
Chiperteks.Text = xkalimat
End Sub
End Class
3. Tambah form3 (Kriptografi Vernam) dan desain seperti dibawah ini
Atur Settingan code nya seperti di bawah ini :
Public Class form3
Private Sub form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Plainteks.Text = ""
Kunci.Text = ""
Chiperteks.Text = ""
End Sub
Private Sub Enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enkripsi.Click
Dim s As Integer
Dim jum As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String = ""
Dim nEnc As Integer
jum = 0
sKata = Plainteks.Text
jum = Len(sKata)
sKey = Kunci.Text
For i = 1 To jum
If s = Len(sKey) Then
s = 1
Else
s = s + 1
End If
nKata = Asc(Mid(sKata, i, 1)) - 65
nKunci = Asc(Mid(sKey, i, 1)) - 65
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc) + 65)
Next i
Chiperteks.Text = sPlain
End Sub
Private Sub Plainteks_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plainteks.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim tombol As Integer = Asc(e.KeyChar)
If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
End If
End Sub
Private Sub Kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Kunci.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim tombol As Integer = Asc(e.KeyChar)
If Not (((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
End If
End Sub
End Class
4. Tambah Form4 (Kriptografi Gronsfeld) dan desain seperti dibawah ini
Atur Settingan code nya seperti di bawah ini :
Public Class Form4
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Plainteks.Text = ""
kunci.Text = ""
Chiperteks.Text = ""
End Sub
Private Sub Plainteks_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plainteks.KeyPress
If ((e.KeyChar >= "0" And e.KeyChar <= "9") And e.KeyChar <> vbBack) Then e.Handled = True
End Sub
Private Sub Kunci_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Kunci.KeyPress
If Not ((e.KeyChar >= "0" And e.KeyChar <= "9") Or e.KeyChar = vbBack) Then e.Handled = True
End Sub
Private Sub Enkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Enkripsi.Click
Dim j As Integer
Dim jum As Integer
Dim sKey As String
Dim nKata As Integer
Dim nKunci As Integer
Dim sKata As String
Dim sPlain As String = ""
Dim nEnc As Integer
j = 0
sKata = Plainteks.Text
jum = Len(sKata)
sKey = Kunci.Text
For i = 1 To jum
If j = Len(sKey) Then
j = 1
Else
j = j + 1
End If
nKata = Asc(Mid(sKata, i, 1)) - 65
nKunci = Asc(Mid(sKey, j, 1)) - 48
nEnc = ((nKata + nKunci) Mod 26)
sPlain = sPlain & Chr((nEnc) + 65)
Next i
Chiperteks.Text = sPlain
End Sub
End Class
5. Tambah Form5 (Kripantografi Vigenere) dan atau desainnya seperti dibawah ini
6. Setelah semua selasai, klik file yg ada di form1 dan double klik Kriptografi Caesar dan isi codenya sebagai berikut
Private Sub KriptografiCaesarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriptografiCaesarToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Form2.MdiParent = Me
Form2.Show()
End Sub
selanjutnya kiptografi Vernam dan isi codenya
Private Sub KriptografiVernamToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriptografiVernamToolStripMenuItem.Click
form3.MdiParent = Me
form3.Show()
End Sub
form3.MdiParent = Me
form3.Show()
End Sub
Private Sub KriptografiGronsfeldToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriptografiGronsfeldToolStripMenuItem.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
selanjutnya kiptografi Vigenere dan isi codenya
Private Sub KriptografiVigenereToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriptografiNigenereToolStripMenuItem.Click
Form5.MdiParent = Me
Form5.Show()
End Sub
Selesai.......
maka setelah di Debbugkan maka hasilnya seperti dibawah ini
![]() |
Sekian dan Tingkyuu
|








