Highlights
All Snippets
Top 100 Snippets
Librarians
gbCodeLib

By Language
VB6
JavaScript
Perl
HTML
SQL
Java
DOS

GBIC >> Source Code >> Visual Basic >> Snippet

Encrypt a string (no password)


Function EncryptString(Plain As String ) As String
Dim i As Long
For i = 1 To Len(Plain)
    If Asc ( Mid $(Plain, i, 1)) < 128 Then
       EncryptString = EncryptString & Chr ( Asc ( Mid $(Plain, i, 1)) + 128)
    Else
       EncryptString = EncryptString & Chr ( Asc ( Mid $(Plain, i, 1)) - 128)
    End If
Next i
End Function