I have a jar file with a resources folder, and I have converted it to EXE using
How can I protect my resources from being extracted using
Reverse Engineering Stack Exchange is a question and answer site for researchers and developers who explore the principles of a system through analysis of its structure, function, and operation. It only takes a minute to sign up.Sign up to join this community
The only real protection is to not deliver the resources!
As long as you give the resources out of your hand they can be extracted. It may be difficult but it is possible to extract them.
The most secure way would be to store the resources on a server and access them in a remote way. But also then if the resource is on the client computer it is possible to extract them from memory.
The only real option you have here is to store the resources as encrypted data and decrypt them prior to loading in java. You could store the encrypted data as a byte array, and use some kind of xor encryption.
This is NOT secure, and you should NOT store any important keys, passwords, or credentials in any resource files.
I know few ways to prevent resources extraction/reading:
Encrypt your resources and dynamically decrypt them in runtime without writing temp files.
Load the resources from the internet (require Internet connection).
Corrupt the CRC32 of the resources files, this will make WinZip or WinRAR unable to extract your resources.
Set \u0000 (\x0) as a file name prefix. The NUL terminator will make WinZip or WinRAR unable to extract files (and also read file names).
However, none of these increases security. Resources will be able to get decrypted or extracted, these are only "simple tricks" to prevent standard reading / extraction.