Assalamu'alaikum wr. wb
Kali ini saya berbagi postingan tentang cara Membuat Menu Program Aplikasi Kriftografi pada VB.Net, dimana kriftografi tersebut terbagi atas:
Kali ini saya berbagi postingan tentang cara Membuat Menu Program Aplikasi Kriftografi pada VB.Net, dimana kriftografi tersebut terbagi atas:
- kriptografi caesar chiper
- enkripsi kriptografi vernam
- kriptografi gronfeld
Sebelum kita membuka ketiga aplikasi tersebut pertama kita membuat aplikasi Menu dahulu agar nanti aplikasi tersebut dibuka dalam satu aplikasi menu..
1. Aplikasi Menu
Dibawah ini merupakan tampilan aplikasi Menu
1. Aplikasi Menu
Dibawah ini merupakan tampilan aplikasi Menu
Dan berikut ini adalah alikasi manu yang telah dijalankan.
Adapun listing program nya adalah sebagai berikut ini:
Public Class Menu
Private Sub CaesarChiperToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CaesarChiperToolStripMenuItem.Click
Form1.MdiParent = Me
Form1.Show()
End Sub
Private Sub EnkripsiKriftografiVernamvbToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnkripsiKriftografiVernamvbToolStripMenuItem.Click
Enkripsi_Kriftografi_Vernam.MdiParent = Me
Enkripsi_Kriftografi_Vernam.Show()
End Sub
Private Sub KeluarToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KeluarToolStripMenuItem.Click
Dim a As String
a = MsgBox("Apakah Anda Yakin Ingin Keluar..... !!!", MsgBoxStyle.YesNo)
If a = vbYes Then
Me.Close()
End If
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
CaesarChiperToolStripMenuItem.PerformClick()
End Sub
Private Sub CaesarChiperToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CaesarChiperToolStripMenuItem1.Click
Form1.MdiParent = Me
Form1.Show()
End Sub
Private Sub EnkripsiKriftografiVernamToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles EnkripsiKriftografiVernamToolStripMenuItem.Click
Enkripsi_Kriftografi_Vernam.MdiParent = Me
Enkripsi_Kriftografi_Vernam.Show()
End Sub
Private Sub KriftografiGronfeld_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KriftografiGronfeld.Click
Kriptografi_Gronsfeld.MdiParent = Me
Kriptografi_Gronsfeld.Show()
End Sub
End Class
2. Kriptografi Caesar Chiper
Berikut ini adalah tampilan Kriptorafi Caesar Chiper :
Dan Berikut ini adalah listing programnya :
Public Class Form1
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(plain.Text)
x = Mid(plain.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
chiper.Text = xkalimat
End Sub
Private Sub Dekripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dekripsi.Click
Dim X As String = ""
Dim XKALIMAT As String = ""
For i = 1 To Len(chiper.Text)
X = Mid(chiper.Text, i, i)
X = Chr(Asc(X) - 3)
XKALIMAT = XKALIMAT + X
Next
plain.Text = XKALIMAT
End Sub
End Class
3. Kriptografi Enkripsi Vernam
Berikut ini adalah Tampilan Kriptografi Enkripsi Vernam :
Listing Program Kriptografi Enkripsi Vernam:
Public Class Enkripsi_Kriftografi_Vernam
Private Sub Enkripsi_Kriftografi_Vernam_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plainteks.Text = ""
kunci.Text = ""
chiperteks.Text = ""
End Sub
Private Sub bntenkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bntenkripsi.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)) - 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
e.Handled = True
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
e.Handled = True
End If
End Sub
End Class
4. Kriptografi Gronfeld
Berikut ini adalah tampilan Kriptografi Gronfeld:
Listing Program Kriptografi Gronfeld:
Public Class Kriptografi_Gronsfeld
Private Sub Kriptografi_Gronsfeld_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plainteks.Text = ""
kunci.Text = ""
chiperteks.Text = ""
End Sub
Private Sub btnenkripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnenkripsi.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)) - 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
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
End Class
NB: Sebelum kita memasukan koding pemanggilan pada menu kita harus membuat program Kriptografinya terlebih dahulu, agar nanti Program Aplikasi Menu dapat dijalankan.
Demikianlah Artikel tentang cara Membuat Menu Program Aplikasi Kriftografi pada VB.Net , semoga bermanfaat bagi anda para pembaca .
Wassalamu'alaikum wr. wb..
Post a Comment