Code: Select all
Public Function SimpleCrypt(ByVal Text As String) As String
Dim strTempChar As String = Nothing, i As Integer
For i = 1 To Len(Text)
If Asc(Mid$(Text, i, 1)) < 128 Then
strTempChar = _
CType(Asc(Mid$(Text, i, 1)) + 128, String)
ElseIf Asc(Mid$(Text, i, 1)) > 128 Then
strTempChar = _
CType(Asc(Mid$(Text, i, 1)) - 128, String)
End If
Mid$(Text, i, 1) = _
Chr(CType(strTempChar, Integer))
Next i
Return Text
End Function
text in the registry etc
Code: Select all
Dim boo As String
boo = SimpleCrypt("booboo")
MsgBox(boo)
boo = SimpleCrypt(boo)
MsgBox(boo)