How to fix Invalid AES key length?

后端 未结 4 744
我在风中等你
我在风中等你 2020-12-12 22:39

I am working on a text encryption and decryption project (following Struts 2)

Whenever I enter the password and the plain text I get a Invalid AES K

4条回答
  •  孤街浪徒
    2020-12-12 22:58

    You can verify the key length limit:

    int maxKeyLen = Cipher.getMaxAllowedKeyLength("AES");
    System.out.println("MaxAllowedKeyLength=[" + maxKeyLen + "].");
    

提交回复
热议问题