开发过程中用到3DES对敏感信息进行加密,秘钥用的是32位的,报出如下异常
Exception in thread "main" java.security.InvalidKeyException: Invalid key length: 32 bytes
at com.sun.crypto.provider.DESedeCipher.engineGetKeySize(DESedeCipher.java:370)
at javax.crypto.Cipher.passCryptoPermCheck(Cipher.java:1067)
at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1025)
at javax.crypto.Cipher.implInit(Cipher.java:801)
at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
at javax.crypto.Cipher.init(Cipher.java:1249)
at javax.crypto.Cipher.init(Cipher.java:1186)
at com.adtec.des.des_temp.encryptThreeDESECB(des_temp.java:33)
at com.adtec.