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.
![](/static/compass_v2/shared-icons/check-mark.png)
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
![Microsoft Visual C#](https://www.bartleby.com/isbn_cover_images/9781337102100/9781337102100_smallCoverImage.gif)
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781305480537/9781305480537_smallCoverImage.jpg)