I am trying to run a jar file and I get this error. Error encrypting/decrypting file net.codejava.crypto.CryptoException: Error encrypting/decrypting file Caused by: java.security.InvalidKeyException: Invalid AES key length: 17 bytes at net.codejava.crypto.CryptoUtils.doCrypto(CryptoUtils.java:57) at net.codejava.crypto.CryptoUtils.encrypt(CryptoUtils.java:27) at net.codejava.crypto.CryptoUtilsTest.main(CryptoUtilsTest.java:18) Caused by: java.security.InvalidKeyException: Invalid AES key length: 17 bytes at java.base/com.sun.crypto.provider.AESCrypt.makeSessionKey(AESCrypt.java:1329) at java.base/com.sun.crypto.provider.AESCrypt.init(AESCrypt.java:1053) at java.base/com.sun.crypto.provider.ElectronicCodeBook.init(ElectronicCodeBook.java:97) at java.base/com.sun.crypto.provider.CipherCore.init(CipherCore.java:481) at java.base/com.sun.crypto.provider.CipherCore.init(CipherCore.java:399) at java.base/com.sun.crypto.provider.AESCipher.engineInit(AESCipher.java:311) at java.base/javax.crypto.Cipher.implInit(Cipher.java:872) at java.base/javax.crypto.Cipher.chooseProvider(Cipher.java:934) at java.base/javax.crypto.Cipher.init(Cipher.java:1313) at java.base/javax.crypto.Cipher.init(Cipher.java:1246) at net.codejava.crypto.CryptoUtils.doCrypto(CryptoUtils.java:40) ... 2 more what do i do? It is working perfectly fine in my workspace but showing errors when I run the actual jar file.
I am trying to run a jar file and I get this error. Error encrypting/decrypting file net.codejava.crypto.CryptoException: Error encrypting/decrypting file Caused by: java.security.InvalidKeyException: Invalid AES key length: 17 bytes at net.codejava.crypto.CryptoUtils.doCrypto(CryptoUtils.java:57) at net.codejava.crypto.CryptoUtils.encrypt(CryptoUtils.java:27) at net.codejava.crypto.CryptoUtilsTest.main(CryptoUtilsTest.java:18) Caused by: java.security.InvalidKeyException: Invalid AES key length: 17 bytes at java.base/com.sun.crypto.provider.AESCrypt.makeSessionKey(AESCrypt.java:1329) at java.base/com.sun.crypto.provider.AESCrypt.init(AESCrypt.java:1053) at java.base/com.sun.crypto.provider.ElectronicCodeBook.init(ElectronicCodeBook.java:97) at java.base/com.sun.crypto.provider.CipherCore.init(CipherCore.java:481) at java.base/com.sun.crypto.provider.CipherCore.init(CipherCore.java:399) at java.base/com.sun.crypto.provider.AESCipher.engineInit(AESCipher.java:311) at java.base/javax.crypto.Cipher.implInit(Cipher.java:872) at java.base/javax.crypto.Cipher.chooseProvider(Cipher.java:934) at java.base/javax.crypto.Cipher.init(Cipher.java:1313) at java.base/javax.crypto.Cipher.init(Cipher.java:1246) at net.codejava.crypto.CryptoUtils.doCrypto(CryptoUtils.java:40) ... 2 more what do i do? It is working perfectly fine in my workspace but showing errors when I run the actual jar file.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps