Hiding information in an executable

Often times it is impractical to avoid creating a program that has embedded authentication information. Since it requires no technical expertise beyond simply opening the binary in notepad and scrolling around looking for interesting strings, it is quite risky to distribute such programs (for example, the code below, as compiled by Visual C++ 7 in Release mode, can be found here). However, by encrypting this information in the source code, when it gets compiled into the binary random searches will not reveal the plaintext and without knowing the decryption algorithm having the encrypted string is pointless. However, this does NOT provide any meaningful security against a determined attacker as it is rather trivial to open up the executable in a debugger and simply look at the decrypted information as the program runs. This is only meant to raise the bar enough to eliminate bored and unsophisticated attempts at cracking your code. This implementation uses the simple rand() function that is part of the standard library (and uses the length of the data as the seed). It is quite insecure in a cryptographic sense, but since an educated cracker will not have the slightest problem with a secure algorithm (the attack is exactly the same, just step over the decryption code to get the plaintext) it is perfectly adequate for bamboozling curious amateurs.

The source code (with examples) is here: hideinfo.cpp.

This software comes with no warrantee of any sort, use at your own risk!