Invalid padding error when using decryptBinary
-
19-10-2022 - |
Question
I have a page in my application where users can upload files. When the file has been uploaded I use the encryptBinary
function to encrypt the file:
<cffile file="#getTempDirectory()##uploaded.serverFile#"
action="readBinary"
variable="binaryFile">
<cfset encrypted = encryptBinary(binaryFile,application.key,"AES")>
But when I then try to decrypt the file using decryptBinary
I get the following error:
An error occurred while trying to encrypt or decrypt your input string: Invalid padding
The decryption code is (where readFile
contains the result of the encryption):
<cfset decrypted = decryptBinary(readFile,application.key,"AES")>
How might I solve this error? Thanks!
Pas de solution correcte
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow