Key key,
AlgorithmParameterSpec params,
SecureRandom random)
throws InvalidKeyException, InvalidAlgorithmParameterException
{
CipherParameters param;
//
// a note on iv's - if ivLength is zero the IV gets ignored (we don't use it).
//
if (key instanceof JCEPBEKey)