javax.crypto.BadPaddingException: Given final block not properly padded. I am new in java Cryptography. Please tell me how to do it? Error in CMD: Whenever I try to open an executable JAR file, it loads for a while then gives me an error saying: org.springframework.security.util.EncryptionUtils$EncryptionException: Given final block not properly padded; nested exception is javax.crypto.BadPaddingException: Given final block not properly padded


Solutions on the web

Solution icon of stackoverflow
Given final block not properly padded. I am new in java Cryptography. Please tell me how to do it? Error in CMD: Whenever I try to open an executable JAR file, it loads for a while then gives me an error saying

Stack trace

javax.crypto.BadPaddingException: Given final block not properly padded. I am new in java Cryptography. Please tell me how to do it? Error in CMD: Whenever I try to open an executable JAR file, it loads for a while then gives me an error saying: org.springframework.security.util.EncryptionUtils$EncryptionException: Given final block not properly padded; nested exception is javax.crypto.BadPaddingException: Given final block not properly padded
	at org.springframework.security.util.EncryptionUtils.cipher(EncryptionUtils.java:90)[script-1.0.jar:na]
	at org.springframework.security.util.EncryptionUtils.decrypt(EncryptionUtils.java:131)[script-1.0.jar:na]
	at EncryptDecryptUtil.decrypt(EncryptDecryptUtil.java:10)[script-1.0.jar:na]
	at WebDriverBootstrap.fetchAnswer(WebDriverBootstrap.java:56)[script-1.0.jar:na]
	at WebDriverBootstrap.main(WebDriverBootstrap.java:38)[script-1.0.jar:na]
Caused by: javax.crypto.BadPaddingException: Given final block not properly padded
	at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:989)[sunjce_provider.jar:1.8.0_112]
	at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:845)[sunjce_provider.jar:1.8.0_112]
	at com.sun.crypto.provider.DESedeCipher.engineDoFinal(DESedeCipher.java:294)[sunjce_provider.jar:1.8.0_112]
	at javax.crypto.Cipher.doFinal(Cipher.java:2165)[na:1.8.0_121]
	at org.springframework.security.util.EncryptionUtils.cipher(EncryptionUtils.java:88)[script-1.0.jar:na]
	... 4 more

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 4 months ago
Samebug visitor profile picture
Unknown user
Once, 10 months ago
12 more bugmates