I found a post on the java.sun forums regarding this issue. A solution, which I have tried and it worked for me unlike many of the suggestions that others made that were "supposed" to have worked for them, is using javax.commerce.util.BASE64Encoder and Decoder. These classes can be found in the Java Wallet API at java.sun.com. Put the jecf.jar file in your classpath and you're ready to go. Start by BASE64Encoding the unecrypted String first then encrypting it. Now you may store it or whatever. Whenever you need it decrypt it then BASE64Decode it. Did the trick for me. Good luck.
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop