Advertisement
2_2002-2004 Complete Applications #125414

[Aurora Borealis] Simple Encrypt/Decrypt

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

AI

Shrnutí AI: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Zdrojový kód
original-source
<pre><font color="#008000">' Place 2 textboxes (txtCoded and txtRea ' l) and 2 command buttons (btndecrypt and ' btnencrypt) on a form</font>
<font color="#000080">Private Sub</font> btndecrypt_Click()
<font color="#000080">Dim</font> MyValue <font color="#000080">As String</font>
MyValue = 3
txtReal.Text = ""
<font color="#000080">If </font>Len(txtCoded) < 1 <font color="#000080">Then Exit Sub</font>
<font color="#000080">For</font> i = 1 To Len(txtCoded) / 3
<font color="#000080">If</font> MyValue = 3 <font color="#000080">Then</font>
txtReal = txtReal & Chr(Left(txtCoded, MyValue))
<font color="#000080">Else</font>
txtReal = txtReal & Chr(Right(Left(txtCoded, MyValue), 3))
<font color="#000080">End If</font>
MyValue = MyValue + 3
<font color="#000080">Next</font> i
<font color="#000080">End Sub</font>
<font color="#000080">Private Sub</font> btnEncrypt_Click()
<font color="#000080">Dim</font> MyValue <font color="#000080">As String</font>
<font color="#000080">Dim</font> MyValue2 <font color="#000080">As String</font>
MyValue = 0
MyValue2 = 1
txtCoded = ""
<font color="#000080">If Len</font>(txtReal) < 1 <font color="#000080">Then Exit Sub</font>
<font color="#000080">For</font> i = 1 To Len(txtReal)
txtCoded = txtCoded & Asc(Mid(txtReal, i, 1))
MyValue = MyValue + 1
<font color="#000080">If</font> Len(txtCoded.Text) < 3 * MyValue <font color="#000080">Then</font>
 MyValue2 = Right(txtCoded.Text, 2)
 txtCoded.Text = Left(txtCoded.Text, Len(txtCoded.Text) - 2)
 txtCoded.Text = txtCoded.Text & "0" & MyValue2
<font color="#000080">End If</font>
<font color="#000080">Next</font> i
<font color="#000080">End Sub</font>
</pre>
Původní komentáře (3)
Obnoveno z Wayback Machine