-1

Possible Duplicate:
How to hide strings in a exe or a dll?

I am looking for a win32api call, that will always return the same value, preferably a value viewable as a string, but other types are ok also. It must return the same value whether executed from Windows XP SP2 in Spanish or Windows 7 in English. I couldn't find any, and was hoping to get some help.

I'm trying to hide strings in a C++ application by finding a constant variable from the API that will be equal across XP/7 & different languages, to serve as the base of the encryption.

Community
  • 1
  • 1
  • `CloseHandle(NULL);` returns `0`. – Mooing Duck Oct 16 '12 at 00:19
  • 1
    Why do you need this? [What is your actual problem?](http://meta.stackexchange.com/a/66378/149668) If you so desperately need it, why does it have to come from the Windows API? Why not just write `const char* TestFoo() { return "Hello World!"; }` or something like that yourself? – In silico Oct 16 '12 at 00:19
  • I'm trying to hide strings in a C++ application by finding a constant variable from the API that will be equal across XP/7 & different languages, to serve as the base of the encryption. – Joao Mendesino Oct 16 '12 at 00:21
  • 2
    The suspense is killing me, and I know I'll regret asking this, but if it is so predictable, might that not tell you something about how well it will provide an encryption base? – WhozCraig Oct 16 '12 at 00:27
  • I think he doesn't want to hard code a key in. A Windows call will look innocuous. Maybe he could do a strlen on a phrase. – Steve Wellens Oct 16 '12 at 00:53
  • The systemwide of per-user cryptographics keystore. It is a standard windows feature. – sehe Oct 16 '12 at 06:33

2 Answers2

0

It's hard to imagine someone taking the time to add such a function, which by definition is unnecessary, to an API.

My first guess would be reserved fields or obsolescent functions, but the former are always 0 and the latter are hard to depend upon.

That said...

aib
  • 45,516
  • 10
  • 73
  • 79
0

For my AES-based encryption code, I based my keys on a custom-written random number generator that generates the same value every time it is called. Makes it harder to analyse the code statically to figure out the logic, but creates a consistent value dynamically at runtime so it is not stored in the app statically at compile-time.

Remy Lebeau
  • 555,201
  • 31
  • 458
  • 770