Pages

Showing posts with label cryptography. Show all posts
Showing posts with label cryptography. Show all posts

Wednesday, October 5, 2011

Fixing up the AESEncryptor

A follow on to my previous posts about using the Java Cryptography stuff to perform simple encryption. It turns out I was using a proprietary class from Sun for the Base64 encoding/decoding.

I got rid of the imports for the proprietary classes:
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;

And used the Base64 class from org.apache.commons.codec.

This only required a few minor changes to the decode/encode calls.

Wednesday, September 21, 2011

A little excursion into JCE

I had an occasion to explore a bit of Java that I've never dealt with before: the Java Cryptography Extensions (as of Java 1.4 these are part of the Java distribution). The problem at hand required being able to encrypt a string using the Rijndael algorithm (AES).