Kriptografi Metode Sembarang Menggunakan VB Net

Program dibawah ni merupakan kriptogafi tanpa metode atau gampangnya sembarang metode. Gimana tidak memang tidak membahas metode metode seperti Caesar, ROT13, VIGENERE ataupun yang keren seperti AES, RC6 :)

Pada Program VB Net ini hanya membahas yang Enkripsi saja. Setiap karakter di sandikan dengan sembarang karakter, seperti contoh :

A dirubah menjadi !
B dirubah menjadi @

dan berikutya, program ini hanya dari karakter A..Z. tidak untuk simbol yang lain.

Berikut program kriptografi sembarang methode

Public Class Form1

    Function RubahChar(ByVal xchar As String) As String
        Dim xtxt As String = ""
        Select Case xchar
            Case "A" : xtxt = "!"
            Case "B" : xtxt = "@"
            Case "C" : xtxt = "#"
            Case "D" : xtxt = "$"
            Case "E" : xtxt = "%"
            Case "F" : xtxt = "^"
            Case "G" : xtxt = "*"
            Case "H" : xtxt = "("
            Case "I" : xtxt = ")"
            Case "J" : xtxt = "-"
            Case "K" : xtxt = "="
            Case "L" : xtxt = "_"
            Case "M" : xtxt = "+"
            Case "N" : xtxt = "{"
            Case "O" : xtxt = "}"
            Case "P" : xtxt = ":"
            Case "Q" : xtxt = "'"
            Case "R" : xtxt = ","
            Case "S" : xtxt = "."
            Case "T" : xtxt = "<"
            Case "U" : xtxt = ">"
            Case "V" : xtxt = "?"
            Case "W" : xtxt = "/"
            Case "X" : xtxt = "|"
            Case "Y" : xtxt = "\"
            Case "Z" : xtxt = "`"
        End Select
        RubahChar = xtxt
    End Function

    Private Sub btnEnkrip_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnEnkrip.Click
        Dim kalimat As String = ""
        Dim x As String = ""
        For I = 1 To Len(Plain.Text)
            x = Microsoft.VisualBasic.Mid(Plain.Text, I, 1)
            x = RubahChar(x)
            kalimat = kalimat + x
        Next
        Chiper.Text = kalimat
    End Sub
End Class


Sumber : Mesran.net
Back to top