This content has been marked as final. Show 1 reply
Just copying some third party encryption code without understanding it is a recipe for disaster.
1) There is no need to use the BouncyCastle library - everything you need is available from the build-in SunJCE provider.
2) You need to use a Hex decoder to turn your input into a byte array suitable for encryption. You need to use a Hex encoder to turn your cipherText to a Hex representation. BouncyCastle the encoder and decoder but this will mean you are importing a very large library when all you need is something very small. Google for Jakarta commons codec.
3) I suggest you purchase David Hook's "Beginning Cryptography with Java" and study it.