Click here to Skip to main content
Licence CPOL
First Posted 23 Dec 2004
Views 48,818
Bookmarked 23 times

VB.NET String Obfuscation Utility

By | 23 Dec 2004 | Article
A fast and dirty way of obfuscating strings in VB.NET applications.

Sample Image

Introduction

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.

License

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

Member

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.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 2 PinmvpDave Kreskowiak2:14 16 Mar '10  
GeneralGood piece of work Pinmembertiote11:17 23 Dec '08  
GeneralVery good Pinmemberpadilhath0:29 18 Jun '07  
Generalthanks! Pinmembercdnhype19:06 13 May '07  
GeneralNot to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmembercechode22:15 23 Dec '04  
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless PinmemberThe Beard1:18 24 Dec '04  
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmemberattackweasel3:22 27 Dec '04  
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless PinmemberTLWallace6:27 27 Jun '05  
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless PinmemberJohn Cardinal12:19 18 Jan '06  
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmemberyesildal13:30 17 May '06  
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pinmemberokoji Cyril21:00 2 Aug '07  

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.

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