- ecipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
- dcipher = Cipher.getInstance("AES/ECB/PKCS5Padding");
- ecipher.init(Cipher.ENCRYPT_MODE, key);
- dcipher.init(Cipher.DECRYPT_MODE, key);
+ byte[] iv = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
+ IvParameterSpec ivspec = new IvParameterSpec(iv);
+ Cipher cipher = Cipher.getInstance(AES_NAME);
+ cipher.init(mode, key, ivspec);
+ return cipher;