byte[] iv = new byte[8];
Utils.getRND().nextBytes(iv);
Cipher cipher = Cipher.getInstance(
"DESede/CBC/PKCS5Padding");
KeySpec keyspec = new DESedeKeySpec(keydata);
Key key = SecretKeyFactory.getInstance("DESede")
.generateSecret(keyspec);
cipher.init(Cipher.ENCRYPT_MODE, key,
new IvParameterSpec(iv, 0, cipher.getBlockSize()));