Click here to Skip to main content
15,886,578 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
How would I go about encrypting a file, but keeping its integrity. e.g. Encrypt exe and keeping its icon? All in vb.net
Posted

To add to the other replies, do bear in mind that it probably won't do you any good.

In order to execute your application, it will need to decrypt it using the decryption key - which can't be encrypted or you would need an unencrypted key for that. So whatever you do to encrypt your application will also release all the information anyone would need in order to decrypt it with the exe...so it doesn't really protect it, just makes it slightly harder (and more obvious that you really want to protect it, which can make some people even more determined to get round it).
 
Share this answer
 
You can do that by using the following approach. To keep the integrity of an executable, there are parts that must remain unencrypted. These will be a small "loader" which will have the ability to decrypt the encrypted part on the fly. Then, when the icon is double clicked, the loader will read the encrypted data into memory, decrypt it and execute it.
 
Share this answer
 
Comments
iProgramIt 8-Mar-15 10:20am    
So maybe make a shortcut to my program, which will have that program in memory and essentially decrypt & start it?
You cannot encrypt a whole executable file containing an icon resource and expect this resource is not affected by the process.

What you may need could be obfuscation[^].
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900