Rabu, 26 Juni 2013

KRIPTOGRAFI



PENGGUNAAN   KRIPTOGRAFI   DALAM   VISUAL   STUDIO  2008
DESIGN NYA
Program nya
Public Class Form1

    Private Sub btnEnk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnk.Click
        Dim jumlah As Double = Len(PTeks.Text)
        Dim x As String
        Dim xkalimat As String
        Dim bil As Integer

        For i = 1 To jumlah
            x = Mid(PTeks.Text, i, 1)
            bil = Asc(x) + 3
            x = Chr(bil)
            xkalimat = xkalimat + 1
        Next i
        CTeks.Text = xkalimat

    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        PTeks.Text = ""
        CTeks.Text = ""
    End Sub

    Private Sub btnDesk_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnDesk.Click
        Dim jumlah As Double = Len(CTeks.Text)
        Dim x As String
        Dim xkalimat As String = ""
        Dim bil As Integer
        For i = 1 To jumlah
            x = Mid(CTeks.Text, i, 1)
            bil = Asc(x) + 3
            x = Chr(bil)
            xkalimat = xkalimat + 1
        Next i
        PTeks.Text = xkalimat
    End Sub
End Class

Hasil
Ketika  kita ketik sesuatu di Plainteks dan pilih Enkripsi maka muncul di chiperteks seperti  gambar diatas
Ketika kita pilih Deskripsi maka  plainteks  nya berubah seperti  gambar di atas
Ket:
Enkripsi=Merubah Plainteks ke  Chiperteks
Deskripsi=Mengubah Data Asli dari Chiperteks ke  Plainteks



Tidak ada komentar:

Posting Komentar