`travis encrypt` returns a different secret value every time

I wonder exactly how this encryption/decription works under the hood as running the same travis encrypt command with the same key returns different results each time.

The sensitive data are encrypted with the private key and a different salt every time, so the resulting encrypted data are different.

1 Like

Thank you @BanzaiMan makes sense. Still as they key I am encrypting is correct and works fine when not encrypted via travis cli, I was wondering if you could confirm the algorithm that is used in the encryption and if you are able to verify is there could be some problem with encoding or similar. It seems evident that what is sent to Heroku is not the correct value. Thanks

You can follow the code from here:

Basically, it queries the API to fetch the public key, and use it to encrypt the user-supplied data.

One common mistake is using a different endpoint to encrypt data; using the .com API for a repository on .org, or vice versa.

Thanks @BanzaiMan so what’s interesting is even when passing the --com flag, exactly to ensure the .com account was being used and not the .org, the error could be reproduced.