AES/CBC/PKCS5Padding encryption not working properly

I have implemented AES/CBC/PKCS5Padding for 16 bit key. Now i want to make to work for 32 bit key 9vYJNrqiHifDWGw6X9UHU5h7kBtb8TNB. I tried replacing iv and secret key but it is not working. What may be the problem. And also what is the iv in it. Should it be same as primary key or can we give any other random number for it?

--Java code--

//String encrypted = MCrypt.bytesToHex( mcrypt.encrypt("Text to Encrypt") );

//String decrypted = new String( mcrypt.decrypt( encrypted ) );

public class AESCrypt {

private String iv = "fedcba9876543210";//Dummy iv (CHANGE IT!)

private IvParameterSpec ivspec;


Read More »

By: StackOverFlow - Wednesday, 14 March

Related Posts