tag:help.appveyor.com,2012-11-13:/discussions/problems/29239-secure-file-cryptographic-error-en-decryptAppVeyor: Discussion 2021-06-03T21:04:02Ztag:help.appveyor.com,2012-11-13:Comment/491232612021-04-03T17:19:21Z2021-04-03T17:19:24Zsecure-file cryptographic error en decrypt<div><p>Hi,<br>
I have a file I want to decrypt at build time. It used to work fine until today.<br>
Since I had the warning about re-encrypting my file to benefit from the new "salt" option I decided to do so.<br>
I followed the steps in <a href="https://www.appveyor.com/docs/how-to/secure-files/">https://www.appveyor.com/docs/how-to/secure-files/</a>.<br>
Then I encrypted my secret and the salt output and added them as "secure" env variables in my appveyor.yml</p>
<p>But now I get >><br>
appveyor-tools\secure-file -decrypt "%APPVEYOR_BUILD_FOLDER%\xxxxxxx\yyyyyyy.enc" -secret %DECODE_KEY% -salt %DECODE_SALT%<br>
Encountered a cryptographic error while processing the file.<br>
Command exited with code 2<br>
<<<br>
If I add an echo of the environment variables %DECODE_KEY% and %DECODE_SALT% before the secure-file command I can see they both exist and match my original secret and salt. It's not a PR build by the way.<br>
If I RDP into the VM, I see there is a decrypted file that contains garbage.<br>
If I issue the secure-file command manually, it works fine.</p>
<p>So I'm stuck here and don't know what else to check.<br>
Thanks for your help.</p>
<p>Manuel</p></div>Manuel Ornatotag:help.appveyor.com,2012-11-13:Comment/491232612021-04-03T20:23:44Z2021-04-03T20:23:44Zsecure-file cryptographic error en decrypt<div><p>Are you downloading the same <code>secure-file</code> executable that was using to encode the file? Have you re-encoded file with key/salt? Try doing the procedure again?</p></div>Feodor Fitsner