CARA MENG ENKRIPSI DENGAN VISUAL BASIC  

Posted by Apik Budiono





Buat form dengan visual basic dengan 3 textbox dan 2 tombol

Ketikkan perintah dibawah ini

Private Sub Form_Activate()
Text1 = "": Text2 = "": Text3 = ""
Text4 = "": Text5 = ""
For I = 65 To 90
Text1.SelText = Chr(I)
Next
For I = 65 + 3 To 90 + 3
If I > 90 Then
Text2.SelText = Chr(64 + (I - 90))
Else
Text2.SelText = Chr(I)
End If
Next
End Sub

tempatkan sekrip dibawah ini di form general crypt

Public Function Crypt(Text As String, CodeBin As Integer) As String
On Error Resume Next
Dim strTempChar As String

For I = 1 To Len(Text)
If Asc(Mid$(Text, I, 1)) < CodeBin Then
strTempChar = Asc(Mid$(Text, I, 1)) + (CodeBin)
End If
Mid$(Text, I, 1) = Chr(strTempChar)
Next I
Crypt = Text


tombol enkrip

Private Sub cmdEncrypt_Click()
Text4 = ""
N = Len(Trim(Text3))
For I = 1 To N
PLAIN = Mid(Text3, I, 1)
CIPHER = Chr(Asc(PLAIN) + 3)
If Asc(CIPHER) > 90 Then
Text4.SelText = Chr(64 + (Asc(CIPHER) - 90))
Me.Text2.Text = Crypt(Me.Text1.Text, 128)
Else
Text4.SelText = CIPHER
End If
Next
End Sub


Private Sub Form_Activate()
Text1 = "": Text2 = "": Text3 = ""
Text4 = "": Text5 = ""
For I = 65 To 90
Text1.SelText = Chr(I)
Next
For I = 65 + 3 To 90 + 3
If I > 90 Then
Text2.SelText = Chr(64 + (I - 90))
Else
Text2.SelText = Chr(I)
End If
Next
End Sub



NAH KALIAN BUAT DESKRIPSINYA SENDIRI YAHC
SELAMAT MENCOBA SOMOGA ADA KESALAHAN SEHINGGA ANDA DAPAT BELAJAR

This entry was posted on Kamis, 10 April 2008 at 17.58 . You can follow any responses to this entry through the comments feed .

0 komentar

Posting Komentar