Cara Membuat Program Kriptografi
Oke
kali ini saya akan memberi tahu bagaimana cara membuat kriptografi dengan
visual basic 2008
Oke
langsung aja yaaa…
Yang
pertama anda perlu menyiapkan 5 from
Dan
anda bisa contoh from punya saya…..di bawah ini…..
Oke… pada from yang pertama anda perlu mengubah
isMdContainernya menjadi true pada propertisnya dan memngubah windows Satatenya
menjadi Maximaize
Setelah
itu anda bisa copy paste codingnya di bawah ini …
Yang
ini untuk coding from yang pertama
PublicClass
Form1
PrivateSub
PEMOGRAMANKRIPTOGRAFIToolStripMenuItem_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
PEMOGRAMANKRIPTOGRAFIToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
EndSub
PrivateSub
PEMOGRAMANKRIPTOGRAFIToolStripMenuItem1_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
PEMOGRAMANKRIPTOGRAFIToolStripMenuItem1.Click
Form3.MdiParent = Me
Form3.Show()
EndSub
PrivateSub
KRIPTOGRAFIToolStripMenuItem_Click(ByVal sender
As System.Object, ByVal
e As System.EventArgs) Handles
KRIPTOGRAFIToolStripMenuItem.Click
Form4.MdiParent = Me
Form4.Show()
EndSub
PrivateSub
KRIPTOGRAFIVEGENERIToolStripMenuItem_Click(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
KRIPTOGRAFIVEGENERIToolStripMenuItem.Click
Form5.MdiParent = Me
Form5.Show()
EndSub
PrivateSub
MenuStrip1_ItemClicked(ByVal sender As System.Object, ByVal
e As
System.Windows.Forms.ToolStripItemClickedEventArgs) Handles
MenuStrip1.ItemClicked
EndSub
EndClass
Setalah
itu coding from2
PublicClass
Form2
PrivateSub
enkripsi_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
enkripsi.Click
Dim
x AsString = ""
Dim
xkalimat AsString = ""
For
i = 1 To Len(plaintext.Text)
x = Mid(plaintext.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
chipertext.Text = xkalimat
EndSub
PrivateSub
deskripsi_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
deskripsi.Click
Dim
x AsString = ""
Dim
xkalimat AsString = ""
For
i = 1 To Len(plaintext.Text)
x = Mid(plaintext.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
plaintext.Text = xkalimat
EndSub
PrivateSub
keluar_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
keluar.Click
Dim
lia AsInteger
lia = MsgBox("anda
mau keluar ?", MsgBoxStyle.YesNo)
If
lia = MsgBoxResult.Yes Then
Me.Close()
EndIf
EndSub
PrivateSub
hapus_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
hapus.Click
plaintext.Text = ""
chipertext.Text = ""
EndSub
PrivateSub
kkkriptogrfi_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
kkkriptogrfi.Click
Me.Hide()
kkkriptogrfi.Show()
EndSub
EndClass
Setalah
itu coding from3
PublicClass
Form3
PrivateSub
Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
Plaintext.Text = ""
kunci.Text = ""
chipertext.Text = "'"
EndSub
PrivateSub
enkripsi_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
enkripsi.Click
Dim
j AsInteger
Dim
jum AsInteger
Dim
skey AsString
Dim
nkata AsInteger
Dim
nkunci AsInteger
Dim
skata AsString
Dim
splain AsString = ""
Dim
nEnc AsInteger
j = 0
skata = Plaintext.Text
jum = Len(skata)
skey = kunci.Text
For
i = 1 To jum
If
j = Len(skey) Then
j = 1
Else
j = j + 1
EndIf
nkata = Asc(Mid(skata, i, 1)) - 65
nkunci = Asc(Mid(skey, j, 1)) - 65
nEnc = ((nkata + nkunci) Mod 26)
splain = splain & Chr((nEnc))
Next
i
chipertext.Text = splain
EndSub
PrivateSub
kunci_KeyPress(ByVal sender AsObject, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles kunci.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim
tombol AsInteger = Asc(e.KeyChar)
IfNot
(((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
e.Handled = True
EndIf
EndSub
PrivateSub
Plaintext_KeyPress(ByVal sender AsObject, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plaintext.KeyPress
e.KeyChar = UCase(e.KeyChar)
Dim
tombol AsInteger = Asc(e.KeyChar)
IfNot
(((tombol >= 65) And (tombol <= 90)) Or (tombol = 8)) Then
e.Handled = True
EndIf
EndSub
EndClass
Setalah
itu coding from4
PublicClass
Form4
PrivateSub
Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
plaintext.Text = ""
chipertext.Text = ""
EndSub
PrivateSub
enkripsi_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
enkripsi.Click
Dim
j AsInteger
Dim
jum AsInteger
Dim
skey AsString
Dim
nkata AsInteger
Dim
nkunci AsInteger
Dim
skata AsString
Dim
splain AsString
Dim
nEnc AsInteger
j = 0
jum = Len(Text)
splain = ""
skey = kunci.Text
skata = Text
For
i = 1 To jum
If
j = Len(skey) Then
j = 1
Else
j = j + 1
EndIf
nkata = Asc(Mid(skata, i, 1)) - 65
nkunci = Asc(Mid(skey, j, 1))
nEnc = (nkata + nkunci) Mod 26
splain = splain & Chr((nEnc) +
65)
Next
i
chipertext.Text = splain
EndSub
EndClass
Setalah
itu coding from5
PublicClass
Form5
PrivateSub
Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesMyBase.Load
plaintext.Text = ""
kunci.Text = ""
chipertext.Text = ""
EndSub
PrivateSub
enkripsi_Click(ByVal sender As System.Object, ByVal
e As System.EventArgs) Handles
enkripsi.Click
Dim
j AsInteger
Dim
jum AsInteger
Dim
skey AsString
Dim
nkata AsInteger
Dim
nkunci AsInteger
Dim
skata AsString
Dim
splain AsString
Dim
nEnc AsInteger
j = 0
jum = Len(Text)
splain = ""
skey = kunci.Text
skata = Text
For
i = 1 To jum
If
j = Len(skey) Then
j = 1
Else
j = j + 1
EndIf
nkata = Asc(Mid(skata, i, 1))
nkunci = Asc(Mid(skey, j, 1))
nEnc = ((nkata + nkunci) Mod 256)
splain = splain & Chr((nEnc))
Next
i
chipertext.Text = splain
EndSub
EndClass
End lihat Hasilnya...............
cara bikin form'y gimana ya?
ReplyDeletewell Anda harus instal dulu Softeware Visual Studionya....
ReplyDelete