Quote Originally Posted by reacen View Post
...
But... This is so amazingly slow, knowing that my game have to load like a thousand files, and with this it takes 3 times longer.
Anyone have a better (fast) idea, to stop the user from seeing my "program files"?
Maybe your encryption/decryption routines are too slow or do too much.

When you decrypt a PNG, it appears you are rewriting the decrypted PNG to a file. A waste of time: read the encrypted PNG into memory, decrypt it, load the PNG from memory. Should improve loading time I would think.

Rewriting the decrypted data back to file, whether WAV or PNG or whatever, does allow the user to grab that information while your game is in play; because now it is not encrypted, correct?

For most of your file formats: PNG, BMP, WAV, etc, you should only need to scramble a few key bytes to make the file unreadable. If you are encrypting 100s of bytes, again, maybe a waste of time.

Last but not least, your game shouldn't need to load a 1000 files at once, load them when needed.