PROBLEM Wrong IV length: must be 16 bytes long CAUSE IV Length less then 16 My Code public static String initVector = "12345678...
Total Pageviews
This tutorial covers the basics of the science of cryptography. It explains how programmers and network professionals can use cryptography to maintain the privacy of computer data. Starting with the origins of cryptography, it moves on to explain cryptosystems, various traditional and modern ciphers, public key encryption, data integration, message authentication, and digital signatures.
Dec 31, 2015 11:57:52 AM aes256.AES256 main SEVERE: null org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$1: Key length not 128/192/256 bits. at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineInit(Unknown Source) at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher.engineInit(Unknown Source) at javax.crypto.Cipher.init(Cipher.java:1246) at javax.crypto.Cipher.init(Cipher.java:1186) at aes256.AES256.main(AES256.java:36) Caused by: java.lang.IllegalArgumentException: Key length not 128/192/256 bits. at org.bouncycastle.crypto.engines.AESFastEngine.generateWorkingKey(Unknown Source) at org.bouncycastle.crypto.engines.AESFastEngine.init(Unknown Source) at org.bouncycastle.crypto.paddings.PaddedBufferedBlockCipher.init(Unknown Source) at org.bouncycastle.jcajce.provider.symmetric.util.BaseBlockCipher$BufferedGenericBlockCipher.init(Unknown Source) ... 5 more BUILD SUCCESSFUL (total time: 1 second)
SOLUTION
Key Leng AES must 128 / 192 / 256 bit or 16 / 24 / 32 Character