Mesran Dot Net
Sebelumnya salam buat semuanya.
kali ini saya akan mengajak teman-teman sekalian untuk belajar banyak tentang bahasa program,
dan saya juga akan memperkenalkan kepada semua sebuah website yang bisa
membantu dan mempermudah kita untuk belajar banyak tentang bahasa
pemrograman
yaitu di website mesran.net.
Mesran.net adalah salah satu website tempat belajar
bahasa pemrograman. Di mesran.net teman-teman dapat
menemukan berbagai macam artikel tentang bahasa
pemrograman mulai dari VB.NET, vcsharp, Visual Basic, Prog.Pascal
Di mesran.net teman-teman juga
dapat langsung bertanya dengan berkomentar,
pasti setiap pertanyaan sobat akan di jawab.
Mesran.net merupakan salah satu dari sekian
banyak website tempat belajar bahasa pemrograman yang
menurut saya cukup lengkap. Di mesran.net teman-teman
juga dapat menemukan berbagai macam informasi yang tentunya
berguna buat sobat, dan mesran.net
merupakan tempat mahasiswa/I Budidarma belajar bahasa pemrograman.
Apalagi di Akhir semester mesran.net akan menjadi tempat
yang ramai di kunjungi mahasiswa/I Budidarma, untuk melihat
Nilai atau IP.
Jumat, 17 Januari 2014
KRIPTOGRAFI
Tugas Kriptografi....
Public Class Form3
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Plaintext.Text = ""
kunci.Text = ""
chipertext.Text = "'"
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 = Plaintext.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))
Next i
chipertext.Text = splain
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
Private Sub Plaintext_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plaintext.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
Hasilnya:
Berikut ini adalah design dan cara-cara penyelesaiannya
1. Tampilan Dari Menu Utama
Desaignnya :
Berikut programnya:
ublic Class Form1
Private Sub PEMOGRAMANKRIPTOGRAFIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PEMOGRAMANKRIPTOGRAFIToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub PEMOGRAMANKRIPTOGRAFIToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PEMOGRAMANKRIPTOGRAFIToolStripMenuItem1.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub KRIPTOGRAFIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KRIPTOGRAFIToolStripMenuItem.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub KRIPTOGRAFIVEGENERIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KRIPTOGRAFIVEGENERIToolStripMenuItem.Click
Form5.MdiParent = Me
Form5.Show()
End Sub
End Class
Private Sub PEMOGRAMANKRIPTOGRAFIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PEMOGRAMANKRIPTOGRAFIToolStripMenuItem.Click
Form2.MdiParent = Me
Form2.Show()
End Sub
Private Sub PEMOGRAMANKRIPTOGRAFIToolStripMenuItem1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles PEMOGRAMANKRIPTOGRAFIToolStripMenuItem1.Click
Form3.MdiParent = Me
Form3.Show()
End Sub
Private Sub KRIPTOGRAFIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KRIPTOGRAFIToolStripMenuItem.Click
Form4.MdiParent = Me
Form4.Show()
End Sub
Private Sub KRIPTOGRAFIVEGENERIToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles KRIPTOGRAFIVEGENERIToolStripMenuItem.Click
Form5.MdiParent = Me
Form5.Show()
End Sub
End Class
Hasilnya:
Public Class Form2
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(plaintext.Text)
x = Mid(plaintext.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
chipertext.Text = xkalimat
End Sub
Private Sub deskripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles deskripsi.Click
Dim x As String = ""
Dim xkalimat As String = ""
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
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
Dim lia As Integer
lia = MsgBox("anda mau keluar ?", MsgBoxStyle.YesNo)
If lia = MsgBoxResult.Yes Then
Me.Close()
End If
End Sub
Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
plaintext.Text = ""
chipertext.Text = ""
End Sub
Private Sub kkkriptogrfi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kkkriptogrfi.Click
Me.Hide()
kkkriptogrfi.Show()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
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(plaintext.Text)
x = Mid(plaintext.Text, i, i)
x = Chr(Asc(x) + 3)
xkalimat = xkalimat + x
Next
chipertext.Text = xkalimat
End Sub
Private Sub deskripsi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles deskripsi.Click
Dim x As String = ""
Dim xkalimat As String = ""
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
End Sub
Private Sub keluar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles keluar.Click
Dim lia As Integer
lia = MsgBox("anda mau keluar ?", MsgBoxStyle.YesNo)
If lia = MsgBoxResult.Yes Then
Me.Close()
End If
End Sub
Private Sub hapus_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hapus.Click
plaintext.Text = ""
chipertext.Text = ""
End Sub
Private Sub kkkriptogrfi_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles kkkriptogrfi.Click
Me.Hide()
kkkriptogrfi.Show()
End Sub
Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
End Class
Berikut hasilnya:
3. Cara penyelesaian Pemograman Kriptografi Vernam Chiper
Designya :
Listing programnya:Public Class Form3
Private Sub Form3_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Plaintext.Text = ""
kunci.Text = ""
chipertext.Text = "'"
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 = Plaintext.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))
Next i
chipertext.Text = splain
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
Private Sub Plaintext_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Plaintext.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
Hasilnya:
Public Class Form4
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plaintext.Text = ""
chipertext.Text = ""
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
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
End If
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
End Sub
End Class
Private Sub Form4_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plaintext.Text = ""
chipertext.Text = ""
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
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
End If
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
End Sub
End Class
Hasilnya:
5 . Cara penyelesaian Kriptografi Vigenere
Designya :
Berikut listing programnya:
Public Class Form5
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plaintext.Text = ""
kunci.Text = ""
chipertext.Text = ""
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
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
End If
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
End Sub
End Class
Private Sub Form5_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
plaintext.Text = ""
kunci.Text = ""
chipertext.Text = ""
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
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
End If
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
End Sub
End Class
Berikut hasilnya:
Demikianlah Bagian-bagian Kriptografi Dan cara-cara penyelesaiannya .
Langganan:
Postingan (Atom)