VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Aurora Borealis Simple Encrypt/Decrypt

by Arcanix (3 Submissions)
Category: Complete Applications
Compatability: Visual Basic 5.0
Difficulty: Intermediate
Date Added: Wed 3rd February 2021
Rating: (8 Votes)

A simple encryper/decrypter I made for a friend...
It converts each char into the asc value for that char and reverses it later...

Rate Aurora Borealis Simple Encrypt/Decrypt

' Place 2 textboxes (txtCoded and txtRea ' l) and 2 command buttons (btndecrypt and ' btnencrypt) on a form
Private Sub btndecrypt_Click()
Dim MyValue As String
MyValue = 3
txtReal.Text = ""
If Len(txtCoded) < 1 Then Exit Sub
For i = 1 To Len(txtCoded) / 3
If MyValue = 3 Then
txtReal = txtReal & Chr(Left(txtCoded, MyValue))
Else
txtReal = txtReal & Chr(Right(Left(txtCoded, MyValue), 3))
End If
MyValue = MyValue + 3
Next i
End Sub
Private Sub btnEncrypt_Click()
Dim MyValue As String
Dim MyValue2 As String
MyValue = 0
MyValue2 = 1
txtCoded = ""
If Len(txtReal) < 1 Then Exit Sub
For i = 1 To Len(txtReal)
txtCoded = txtCoded & Asc(Mid(txtReal, i, 1))
MyValue = MyValue + 1
If Len(txtCoded.Text) < 3 * MyValue Then
 MyValue2 = Right(txtCoded.Text, 2)
 txtCoded.Text = Left(txtCoded.Text, Len(txtCoded.Text) - 2)
 txtCoded.Text = txtCoded.Text & "0" & MyValue2
End If
Next i
End Sub

Download this snippet    Add to My Saved Code

Aurora Borealis Simple Encrypt/Decrypt Comments

No comments have been posted about Aurora Borealis Simple Encrypt/Decrypt. Why not be the first to post a comment about Aurora Borealis Simple Encrypt/Decrypt.

Post your comment

Subject:
Message:
0/1000 characters