so I\'m trying to convert a Key into a string so I can display it with System.out, and then I want to convert it back to a Key. I am able to convert it to a string with BASE
You never use your BASE64Decoder to un-base-64 your string.
BASE64Decoder
Replace this:
Key key = new SecretKeySpec(keyString.getBytes(),0,keyString.getBytes().length, "DES");
with
byte[] encodedKey = decoder.decodeBuffer(keyString); Key key = new SecretKeySpec(encodedKey,0,encodedKey.length, "DES");