Click here to Skip to main content
12,294,775 members (58,760 online)
Click here to Skip to main content
Add your own
alternative version

Stats

62.5K views
1.7K downloads
24 bookmarked
Posted

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

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)

Share

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.

You may also be interested in...

Comments and Discussions

 
GeneralMy vote of 4 Pin
Manuel Arce8-Jul-14 5:49
memberManuel Arce8-Jul-14 5:49 
GeneralMy vote of 1 Pin
Edo Tzumer27-May-13 4:17
professionalEdo Tzumer27-May-13 4:17 
GeneralMy vote of 2 Pin
Dave Kreskowiak16-Mar-10 2:14
mvpDave Kreskowiak16-Mar-10 2:14 
GeneralGood piece of work Pin
tiote23-Dec-08 11:17
membertiote23-Dec-08 11:17 
GeneralVery good Pin
padilhath18-Jun-07 0:29
memberpadilhath18-Jun-07 0:29 
Generalthanks! Pin
cdnhype13-May-07 19:06
membercdnhype13-May-07 19:06 
GeneralNot to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
cechode23-Dec-04 22:15
membercechode23-Dec-04 22:15 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
The Beard24-Dec-04 1:18
memberThe Beard24-Dec-04 1:18 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
attackweasel27-Dec-04 3:22
memberattackweasel27-Dec-04 3:22 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
TLWallace27-Jun-05 6:27
memberTLWallace27-Jun-05 6:27 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
John Cardinal18-Jan-06 12:19
memberJohn Cardinal18-Jan-06 12:19 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
yesildal17-May-06 13:30
memberyesildal17-May-06 13:30 
GeneralRe: Not to be harsh, obnoxious or simply a ‘smuck’ but, useless Pin
okoji Cyril2-Aug-07 21:00
memberokoji Cyril2-Aug-07 21:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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
Web02 | 2.8.160525.2 | Last Updated 24 Dec 2004
Article Copyright 2004 by The Beard
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid