小编Dey*_*yaa的帖子

InvalidKeyException java.security.InvalidKeyException: 没有安装的提供程序支持这个键: (null)

I have two classes, one is main class and another is the implementation of AES.

However, in my AES class i have a method to decrypt a string, but whenever i run it, it gives an exception

My encryption method works just fine but my decryption method doesn't work as expected.

The code

private Cipher aesCipherForDecryption;
String strDecryptedText = new String();

public String decryptAES(final String ciphertext) {

    try {

        aesCipherForDecryption = Cipher.getInstance("AES/CBC/PKCS5PADDING");
        aesCipherForDecryption.init(Cipher.DECRYPT_MODE, secretKey, new IvParameterSpec(iV));
        byte[] byteDecryptedText = aesCipherForDecryption.doFinal(byteCipherText); …
Run Code Online (Sandbox Code Playgroud)

java encryption aes

5
推荐指数
1
解决办法
2万
查看次数

标签 统计

aes ×1

encryption ×1

java ×1