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!

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top