Sample code for 30+ languages & platforms
Visual FoxPro

Obfuscate String

Demonstrates how to obfuscate and unobfuscate a string.

Chilkat Visual FoxPro Downloads

Visual FoxPro
LOCAL lnSuccess
LOCAL loSb
LOCAL s
LOCAL loSb2
LOCAL lcS2

lnSuccess = 0

loSb = CreateObject('Chilkat.StringBuilder')

s = "Hello World!"

loSb.Append(s)
? loSb.GetAsString()

* Output is "Hello World!";

* Obfuscate the string.
* This is NOT encryption.  It's just a simple obfuscation.
loSb.Obfuscate()
? loSb.GetAsString()

* Output is 2GsgGhbSQVyG8Vb9

* -------------------------
* Unobfuscate.
loSb2 = CreateObject('Chilkat.StringBuilder')
lcS2 = "2GsgGhbSQVyG8Vb9"
loSb2.Append(lcS2)
loSb2.Unobfuscate()

? loSb2.GetAsString()

* Output is "Hello World!";

RELEASE loSb
RELEASE loSb2