Click here to Skip to main content
Click here to Skip to main content

VB.NET String Obfuscation Utility

, 23 Dec 2004 CPOL
Rate this:
Please Sign up or sign in to vote.
A fast and dirty way of obfuscating strings in VB.NET applications.

Sample Image


I was quite impressed with the 'free' Dotfuscator Community Edition provided with MS Visual Studio 2003, but wanted to have the strings in my software encrypted.

The String Obfuscate utility provided here, is an extremely simple tool for allowing you to make a string obfuscated, and if you forget what it was, de-obfuscate it. It uses a small StringObfuscate class that is intended to be copied and used in a VB.NET application to un-obfuscate text.

The way I use it is to keep the strings used in the app in obfuscated constants, then un-obfuscate the constant at runtime as needed. Crude though it is, it does allow the cheap concealment of strings in an app, which as we all know, is the first thing people look at when decompiling code.

Using the code

Copy the file: StringObfuscate.vb from the source code in the demo project, put it into your application development area, then load the file by choosing 'New/Add An Existing item' by right clicking on the project properties.

The class is loaded in an application globally or locally using a statement such as:

Private SObs As New StringObfuscate

In your application, you may have the strings stored like:

myStringVariable = "This is a string"

Using the utility, enter the text of the string "This is a string" and obfuscate it, to give the string "git ishnrsas iT" as the result. Replace the text in the application with the obfuscated text and put a wrapper round the text to call the UnObfuscateString function from the class.

myStringVariable = SObs.UnObfuscateString("git ishnrsas iT")

Simple, now nobody can easily read the text in your application if they decompile it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

The Beard
Web Developer
United Kingdom United Kingdom
I started programing at Lancaster University in 1972 with Algol 68, coding ever since, too many languages to list, most of which are now so old nobody uses them any more Smile | :)
Mainly using MS .Net products now.
Wrote some of the software used to put out the oil-well fires in the first Gulf War. Wrote some of the Pentagon security software that was blown up on 11th September.
In the last year I have started up my own software company.

Comments and Discussions

GeneralMy vote of 4 PinmemberManuel Arce8-Jul-14 6:49 
GeneralMy vote of 1 PinprofessionalEdo Tzumer27-May-13 5:17 
GeneralMy vote of 2 PinmvpDave Kreskowiak16-Mar-10 3:14 
GeneralGood piece of work Pinmembertiote23-Dec-08 12:17 
GeneralVery good Pinmemberpadilhath18-Jun-07 1:29 
Generalthanks! Pinmembercdnhype13-May-07 20:06 
GeneralNot to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmembercechode23-Dec-04 23:15 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless PinmemberThe Beard24-Dec-04 2:18 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmemberattackweasel27-Dec-04 4:22 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless PinmemberTLWallace27-Jun-05 7:27 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless PinmemberJohn Cardinal18-Jan-06 13:19 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmemberyesildal17-May-06 14:30 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmemberokoji Cyril2-Aug-07 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.141220.1 | Last Updated 24 Dec 2004
Article Copyright 2004 by The Beard
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid