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

后端 未结 1 707
再見小時候
再見小時候 2021-02-10 06:30

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:24

    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)
提交回复
热议问题