Invalid padding error when using decryptBinary
-
19-10-2022 - |
Pregunta
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!
No hay solución correcta
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow