yinjihuan / monkey-api-encrypt

monkey-api-encrypt是对基于Servlet的Web框架API请求进行统一加解密操作
Apache License 2.0
793 stars 346 forks source link

monkey-api-encrypt-springboot-example例子报错 #56

Closed hollykunge closed 4 years ago

hollykunge commented 4 years ago

发送数据之后,后台异常:

Caused by: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
    at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:975) ~[sunjce_provider.jar:1.8.0_231]
    at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056) ~[sunjce_provider.jar:1.8.0_231]
    at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853) ~[sunjce_provider.jar:1.8.0_231]
    at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446) ~[sunjce_provider.jar:1.8.0_231]
    at javax.crypto.Cipher.doFinal(Cipher.java:2164) ~[na:1.8.0_191]
    at com.cxytiandi.encrypt.util.AesEncryptUtils.aesDecryptByBytes(AesEncryptUtils.java:37) ~[monkey-api-encrypt-core-1.2.RELEASE.jar:na]
    at com.cxytiandi.encrypt.util.AesEncryptUtils.aesDecrypt(AesEncryptUtils.java:42) ~[monkey-api-encrypt-core-1.2.RELEASE.jar:na]
    at com.cxytiandi.encrypt.algorithm.AesEncryptAlgorithm.decrypt(AesEncryptAlgorithm.java:20) ~[monkey-api-encrypt-core-1.2.RELEASE.jar:na]
    at com.cxytiandi.encrypt.core.EncryptionFilter.processDecryption(EncryptionFilter.java:154) ~[monkey-api-encrypt-core-1.2.RELEASE.jar:na]
    ... 35 common frames omitted
yinjihuan commented 4 years ago

我这没问题,请检查下application里的spring.encrypt.key配置是否跟页面中的key一致