Sample code for 30+ languages & platforms
Visual Basic 6.0

Obfuscate String

Demonstrates how to obfuscate and unobfuscate a string.

Chilkat Visual Basic 6.0 Downloads

Visual Basic 6.0
Dim success As Long
success = 0

Dim sb As New ChilkatStringBuilder

Dim s As String
s = "Hello World!"

success = sb.Append(s)
Debug.Print sb.GetAsString()

' Output is "Hello World!";

' Obfuscate the string.
' This is NOT encryption.  It's just a simple obfuscation.
sb.Obfuscate 
Debug.Print sb.GetAsString()

' Output is 2GsgGhbSQVyG8Vb9

' -------------------------
' Unobfuscate.
Dim sb2 As New ChilkatStringBuilder
Dim s2 As String
s2 = "2GsgGhbSQVyG8Vb9"
success = sb2.Append(s2)
sb2.Unobfuscate 

Debug.Print sb2.GetAsString()

' Output is "Hello World!";