I have a Java application where I need to protect the contents in a text file before exporting it to a jar file. Therefore, I encode the file using the BlowFish algorithm provided by "javax.crypto.Cipher". And I decipher it on the fly.
Everything works fine when I run the application from my workstation. But as soon as I export the application to a jar file and run it. It causes an error in the part of the code that tries to decrypt the contents of the protected text file. Error:
javax.crypto.BadPaddingException: this final block is not inserted correctly
Does the export-jar process file modify the contents of the included text file anyway, for example, is this encoding?
source share