Click to See Complete Forum and Search --> : Hiding Text in .EXE?


jawed
June 8th, 1999, 12:26 AM
I'm writing a program that includes sensitive information (for example a password for that program) in the executable. If I do something like
char *szString = "secret string"; then I can easily find and edit that string using a Hex Editor. How can I reliably encrypt or somehow hide this string from showing up in the executable? I want to re-assemble the real string during runtime.

---
Jawed Karim

June 8th, 1999, 07:40 AM
Do you want the good news or the bad???

It is easy to hide strings by just XORing each character with a known character or rotation of characters. The bad news is that anybody with a debugger will be able to get your string values at runtime with no problem.

What are you trying to do, store passwords? If so try storing the results of a unidirectional hash of the password. These one way functions can not be used to reproduce the original password and can be stored safely.