// Due to the fact that in most cases the data that we are going to
// encrypt will not fit perfectly into the block length of a cipher,
// we want to use a padding algorithm to pad out the last block
// (if necessary). We are going to use PKCS5 to do the padding
// for us.
final PKCS5FormatterEngine formatterEngine =
new PKCS5FormatterEngine(encryptionEngine);
// Use the byte array output stream to catch the
// encrypted information.
final ByteArrayOutputStream outputStream =
new ByteArrayOutputStream();