# "bad decrypt" when there are multiple encrypted files

**URL:** <https://travis-ci.community/t/bad-decrypt-when-there-are-multiple-encrypted-files/7362>\
**Category:** Linux\
**Created:** [February 25, 2020, 5:11pm UTC](https://travis-ci.community/t/bad-decrypt-when-there-are-multiple-encrypted-files/7362 "2020-02-25T17:11:05Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![native-api](https://sea1.discourse-cdn.com/flex015/user_avatar/travis-ci.community/native-api/32/430_2.png) [@native-api](https://travis-ci.community/u/native-api)\
**Post date:** [March 9, 2021, 5:19pm UTC](https://travis-ci.community/t/bad-decrypt-when-there-are-multiple-encrypted-files/7362/13 "2021-03-09T17:19:29Z")

</div>

As per [Custom deployment - Problem with SFTP key and cURL: "curl failed to verify the legitimacy of the server" - #13 by aleks-rodriguez](https://travis-ci.community/t/custom-deployment-problem-with-sftp-key-and-curl-curl-failed-to-verify-the-legitimacy-of-the-server/11248/13), it looks like this problem resurfaces if one is using the same decryption key variables multiple times:

> ```auto
> $ openssl aes-zss-cbc -K Sencrypted_9886as3a028f_key -1v Sencrypted_9806a53a028f_1v -in ssh-pair.enc -out ssh-pair -d
> <...>
> $ openssl aes-zss-cbc -K Sencrypted_9886asaad28f_key -iv Sencrypted_9806a533d28f_iv -in id_rsa.enc -out id_rsa -d
> bad decrypt
> 
> ```

In this case, **make sure to use the exact command, including variable names, that `travis encrypt-file` gave you.**  
(And if `travis encrypt-file` actually gave you identical variable names, this means you’re using a very outdated version of the `travis` gem – which you should have received a warning about.)

---

_[View the full topic](https://travis-ci.community/t/bad-decrypt-when-there-are-multiple-encrypted-files/7362)._
