InvalidKeyException java.security.InvalidKeyException: No installed provider supports this key: (null)

后端 未结 1 464
没有蜡笔的小新
没有蜡笔的小新 2021-02-10 06:53

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 g

1条回答
  •  梦如初夏
    2021-02-10 07:11

    secretKey is clearly null.

    Other problems:

    • You aren't using the input parameter cipherText.
    • The input parameter cipherText should be a byte[], not a String: cipher text is binary, and String is not a container for binary data.
    • The result string strDecryptedText should be a local variable, not a member variable.

    0 讨论(0)
提交回复
热议问题