There was a similar problem. But it is important to understand the root cause, and it may vary for different use cases.
Scenario 1
You are trying to decrypt a value that was not correctly encoded in the first place.
byte[] encryptedBytes = Base64.decodeBase64(encryptedBase64String);
If for some reason the string is incorrectly configured or incorrectly encoded, you will see the error "The input length must be a multiple of 16 when decrypting with additional encryption"
Scenario 2
Now, if you accidentally use this encoded string in the url (trying to pass the value in url to base64Encoded, this will fail. You must do URLEncoding and then pass to the token, it will work.
Scenario 3
When integrating with one of the providers, we found that we needed to do Base64 encryption using URLEncoder, but then we did not need to decode it, because it was made internally by the provider
source share