Program kriptografi dengan visual basis

Design Form Program Kriptografi Vigenere Dengan Visual Basic dot NET 2008 berikut :
w
Ketik listing program berikut :
Public Class Form1
Private Sub btnProses_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnProses.Click
Chipertext.Text = Enkripsi(Plaintext.Text, Kunci.Text)
End Sub
Function Enkripsi(ByVal Teks As String, ByVal Kunci As String) As String
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(Teks)
sPlain = “”
sKey = Kunci
sKata = Teks
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
Enkripsi = sPlain
End Function
End Class
Demikianlah artikel Program Kriptografi Vigenere Dengan Visual Basic dot NET 2008 , semoga bermanfaat saat belajar bahasa pemrograman.
Share this article :

0 komentar:

Posting Komentar

 
Support : Your Link | Your Link | Your Link
Copyright © 2013. Pengen Tahu - Pengen Pintar - All Rights Reserved
Template Created by Creating Website Edited by Kompi Ajaib
Published by Mas Template Proudly powered by Blogger