I’ve seen a bit of talk about hiding sensitive data in an executable… I wrote an obfuscator that I think should be almost impossible to reverse aside from modifying the binary to capture the string from ram… I wanted to get feedback from some of the people around here more familiar with this sort of security thing. I was thinking it would be best to not use strings (even encoded or encrypted since you’d still need the key)
[code] dim chars() as integer=Array(115,32,99,105,101,107,105,104,116,121,101,101,103,32,39,111,105,98,120,97,116,46,32,116,101,32,104,102,110,115,105,101,116,110,101,116,32,101,105,108,97,33,105,46,108,116,32,32,101,101,116,32,110,32,107,111,115,115,115,116,108,97,32,46,117,32,32,104,32,115,76,105)
dim indexes() as integer=Array(84,37,279,9,69,185,20,208,132,194,94,261,217,30,82,151,229,288,272,36,1,311,138,74,96,125,5,116,233,92,114,277,42,210,187,246,191,297,183,290,286,58,209,307,143,57,242,86,43,271,284,12,193,63,161,159,164,22,10,201,176,192,105,303,283,268,172,253,225,52,64,129)
indexes.sortwith(chars)
dim s() as string
for each c as integer in chars
s.append chr©
next
msgbox join(s,"")[/code]
I’m essentially creating two arrays, sorted in a random order together to be sorted at runtime and then converted back to a string. I’m unsure if these arrays exist in a form in the binary that could be easily found and decoded I was thinking about adding more levels of obfuscation, but I’m unsure of how the compiled binary holds predefined integer arrays… I could pad the array and set an offset in code.
Please comment and let me know if there are improvements to be made. I’ll post the generation code soon… the goal is to provide reasonable security, even while everyone knows how it works…