I am a beginner Java programmer. I am working on an application that decrypts some data. The decryption key is hardcoded into the software and, therefore, can be seen by analyzing the byte code.
I know that reverse engineering cannot be completely prevented, so I am trying to make this process as difficult as possible.
My idea is not to directly insert the key into my code, but through some kind of conversion. For example, I could write -
private static final byte[] HC256A = Hex .decode("8589075b0df3f6d82fc0c5425179b6a6" + "3465f053f2891f808b24744e18480b72" + "ec2792cdbf4dcfeb7769bf8dfa14aee4" + "7b4c50e8eaf3a9c8f506016c81697e32");
Thus, someone looking at a bytecode cannot read it right away. But you have to follow the logic and apply transformations to it, which will not be much easier at the byte level.
So what do you guys think? This is useful? What could be the best conversion other than hexagonal decoding? Are there any other ways to protect hard-coded decryption keys?
Thanks for all your suggestions.
source share