Chilkat • HOME • Android™ • AutoIt • C • C# • C++ • Chilkat2-Python • CkPython • Classic ASP • DataFlex • Delphi DLL • Go • Java • Node.js • Objective-C • PHP Extension • Perl • PowerBuilder • PowerShell • PureBasic • Ruby • SQL Server • Swift • Tcl • Unicode C • Unicode C++ • VB.NET • VBScript • Visual Basic 6.0 • Visual FoxPro • Xojo Plugin
(DataFlex) Obfuscate StringDemonstrates how to obfuscate and unobfuscate a string.
Use ChilkatAx-win32.pkg Procedure Test Handle hoSb Boolean iSuccess String s 2 Handle hoSb2 String sS2 String sTemp1 Get Create (RefClass(cComChilkatStringBuilder)) To hoSb If (Not(IsComObjectCreated(hoSb))) Begin Send CreateComObject of hoSb End Move "Hello World!" To s Get ComAppend Of hoSb s To iSuccess Get ComGetAsString Of hoSb To sTemp1 Showln sTemp1 // Output is "Hello World!"; // Obfuscate the string. // This is NOT encryption. It's just a simple obfuscation. Send ComObfuscate To hoSb Get ComGetAsString Of hoSb To sTemp1 Showln sTemp1 // Output is 2GsgGhbSQVyG8Vb9 // ------------------------- // Unobfuscate. Get Create (RefClass(cComChilkatStringBuilder)) To hoSb2 If (Not(IsComObjectCreated(hoSb2))) Begin Send CreateComObject of hoSb2 End Move "2GsgGhbSQVyG8Vb9" To sS2 Get ComAppend Of hoSb2 sS2 To iSuccess Send ComUnobfuscate To hoSb2 Get ComGetAsString Of hoSb2 To sTemp1 Showln sTemp1 // Output is "Hello World!"; End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.