VB.NET
VB.NET
Obfuscate String
Demonstrates how to obfuscate and unobfuscate a string.Chilkat VB.NET Downloads
Dim success As Boolean = False
Dim sb As New Chilkat.StringBuilder
Dim s As String = "Hello World!"
sb.Append(s)
Debug.WriteLine(sb.GetAsString())
' Output is "Hello World!";
' Obfuscate the string.
' This is NOT encryption. It's just a simple obfuscation.
sb.Obfuscate()
Debug.WriteLine(sb.GetAsString())
' Output is 2GsgGhbSQVyG8Vb9
' -------------------------
' Unobfuscate.
Dim sb2 As New Chilkat.StringBuilder
Dim s2 As String = "2GsgGhbSQVyG8Vb9"
sb2.Append(s2)
sb2.Unobfuscate()
Debug.WriteLine(sb2.GetAsString())
' Output is "Hello World!";