-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suppress warnings for OpenSSL 1.1.1 #55
Comments
I'll create a pull request to fix it. |
in transcrypt 1.1.0, I still get this warning,it recommend 'Using -iter or -pbkdf2 would be better.' |
This will be a bit tricky to address, as OpenSSL 1.1.1 was released in Sep 2018 and I want to make sure that older versions also work properly. The situation is further complicated by macOS using LibreSSL 2.6.5 these days, which does not support the I don't think suppressing the warning is the best way forward in this case since it did bubble up a legit deprecation that will bite us eventually. |
Perhaps it is possible to do a version check and then actually use -pbkdf2 and -iter when calling openssl, as long as you have at least 1.1.1? EDIT: After looking into this I realize why its tricky. You couldn't do a checkout on an older machine if you encrypted on a newer machine. It might be reasonable to add a flag the enables |
I'm wondering if anyone has a clear path going forward. Both If someone decides, I can file a PR to test out the decision, no problem. |
Added in order to avoid this warning message: *** WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. Relevant: elasticdog#55 https://askubuntu.com/questions/1093591/how-should-i-change-encryption-according-to-warning-deprecated-key-derivat
Replace Travis CI configuration and run trigger file with an equivalent GitHub Actions workflow to run bats-core units tests on pushes to pull requests targeting master, or pushes to master itself. Currently limited to running on Ubuntu 16.04 to avoid OpenSSL warning mesages from later versions (see #55) from breaking the (too fragile) tests.
I think the best approach for handling this situation would be for transcrypt to switch to using the more secure Here are some rough ideas on how to do this, and a longwinded (sorry) brain-dump about how it could all work. Additional features
UsageWith the above, on init transcrypt could:
ScenariosIf a user chooses to use a newer method for some or all of their secret files:
If a user chooses to use an older encryption method for maximum compatibility this should be handled transparently for other users in all cases:
|
I think most of that sounds sane, but I'm not sure if setting an explicit path to the binary (versus just relying on the user's |
That is a good point that we should expect users to simply add a newer version of OpenSSL to their path once they have gone to the trouble of installing it. I myself don't do this on macOS despite installing later versions with Homebrew, mainly because I'm scared of breaking things in subtle ways which is surprisingly easy to do with macOS + OpenSSL + Homebrew. The fact I don't see the ugly OpenSSL warnings is a nice side-benefit. But that whole idea of making transcrypt learn the OpenSSL path is probably just me projecting my own poor practices. Regarding my suggestions about adding cipher definition attributes to .gitattributes I'm still undecided about whether it really makes sense to do that, or whether it would be better to add explicit transcrypt version headers to the actual encrypted files instead as discussed briefly here, or some combination of the two. I might need to do some rough prototyping in code to try out different things and learn what tends to work best. |
Adjust a couple of output checks to look for expected text anywhere in the output, instead of at specific lines, so tests will pass despite warning output like this: *** WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. See also #55
Adjust GitHub tests to run on older and newer versions of OpenSSL by using older and newer versions of Ubuntu. Fix tests by changing a few output checks to look for expected text anywhere in the output, instead of at specific lines, so tests will pass despite warning output like this: *** WARNING : deprecated key derivation used. Using -iter or -pbkdf2 would be better. See also #55 Also print OpenSSL version on test runs to aid debugging.
andreineculau already gave "as far as I know" version numbers, but to confirm them I went digging for the relevant info. From this commit it looks like From this commit it seems that |
No, I agree with you. I have also previously had unexpected things break when adding Homebrew's keg-only OpenSSL to I'd note that yadm added the config option |
Could it just live in |
That's a very good point. A single repo-wide cipher setting in the Git config's Thinking through the repercussions, the possible downsides are:
I think all these downsides are reasonable trade-offs for the much simpler approach of having a single repo-wide cipher version setting. For 2. the main challenge will be keeping the user experience clear and understandable, but that is a challenge regardless of how exactly cipher changes are implemented. So overall 👍 to having a single repo-wide Get config setting like Adding in a |
Have you thought any more about a way forward for this issue? |
Since we haven't any progress on this issue in months or years, maybe it's time to consider a simple but brutal solution instead of anything that's more elegant but complicated and therefore keeps getting deferred? The best way to unblock this could be to start a branch & PR working towards an update which would explicitly break compatibility with older OpenSSL versions (including the default that comes on Macs) for repos configured to use the recommended and default pbkdf2 command. This might need to be version 3, depending on how backwards-compatible it ends up being. We already have the This leaves at least the following missing pieces:
|
I've been using my fork which blindly enables Using MD5 and no
This could be the case for something like CUDA, not sure if it would be the case for openssl, but with the dodgy software practices used by some, I imaging it might be the case. |
To put gas on fire - openssl 1.1.1 was released november 2018, libressl 2.9.1 in april 2019. If we go ahead requiring these versions, that's how new software we require. |
Just a concern related to this: |
@andersjel the salt is determined via: The end-to-end process works like this: encrypted_filename=encrypted_secret.txt
filename=plaintext_secret.txt
echo "super duper secret" > $filename
password=12345
cipher=aes-256-cbc
# Encrypt with salt
salt=$(openssl dgst -hmac "${filename}:${password}" -sha512 "$filename" | tr -d '\r\n' | tail -c 16)
ENC_PASS=$password openssl enc -$cipher -md SHA512 -pass env:ENC_PASS -pbkdf2 -e -a -S "$salt" -in "$filename" > "$encrypted_filename"
cat "$encrypted_filename"
# Decrypt
ENC_PASS=$password openssl enc -$cipher -md SHA512 -pass env:ENC_PASS -pbkdf2 -d -a -in "$encrypted_filename" If you can figure out a way to munge the value of For reference, if you do know the salt you can run pbkdf2 standalone via:
I think it is secure, but I won't make any strong claims. |
@Erotemic The issue is that the salt is prepended to the encrypted file:
So to brute-force the password, the attacker only has to do SHA512 HMAC operations until the attacker finds the correct salt, and not the much more expensive pbkdf2. |
Hi, this is an interesting discussion especially given the (slow) work in #126 to adopt PBKDF2 for a future update to Transcrypt. I'm not a cryptographer so am out of my depth, but from @andersjel's code examples the use of the known filename + unknown password as inputs to generate the salt does seem like a potential problem. What would be a better approach? Should/could the salt be generated from random data instead of I found this discussion helpful: https://crypto.stackexchange.com/questions/3484/pbkdf2-and-salt |
Ah, random data won't work: Lines 115 to 120 in fdf81c5
|
I think the salt generation process is secure (enough) because the salt isn't derived from just To brute-force the password an attacker would only need to do SHA512 HMAC operations, but they would need to guess both the password and the plaintext file contents. If the attacker can guess the plaintext, then they don't really need the password. However, this does still leave the password vulnerable to brute-force attacks if the repository includes encrypted files with easily-guessable contents. The attacker would use the easily guessed file to reverse engineer the password, then use the password to access other unguessable encrypted files. |
any news on this one ? |
Hi, we don't yet have a solution to support PBKDF2. The most progress is in this PR, which is in turn based on other PRs and discussions: #136 But there are unresolved issues with incompatibility between different systems and/or versions of OpenSSL. I do plan to take another go at it but can't make any guarantees about when I will be able to get to it. |
I'm coming back to see if there is any news for suppressing this warning in Windows env. |
we have this issue and #134 , and then 3 PRs #126 #132 #136 around openssl@3 and PBKDF2. I most probably miss context, but while I understand that we want to maintain backwards compatibility, we (I mean you! 🙏 ) are maintaining transcrypt for systems with 4-5 years old software, while providing a suboptimal experience for the rest that are running newer (that have had access to PBKDF2 for 4-5 years now). At the same time, best practice states that you commit the transcrypt script in each transcrypted repo, in order to ensure encryption compatibility. That is to say: those that want their repos to be decrypted on systems running old software, can't depend on system-wide newer transcrypt versions. It would be great to provide a timeline when enough is enough, and transcrypt v3 is released with breaking changes no matter what. For the time being, [reading] a 4 year old (#55 (comment))
in a situation where the simplest changeset is adding one argument to 4 openssl calls (and yes, breaking backwards compatibility), sounds like parallel universes. transcrypt is one of those "best thing since bread and butter", but onboarding experience is even critical to actually using it. |
Hi @andreineculau, @dawidmachon, @LuisBL, @andersjel and anyone else who might be interested in being a guinea pig, I'd appreciate help testing and proving the new PR #162 which adds support for PBKDF2. It's early and rough, but I think there's a good chance this PR will move us towards a much-improved transcrypt version 3 before too much longer. |
Is there any workaround to ack and suppress the warnings, short of all this complexity to fix the fundamental security smell openssl is warning about? IIUC I could choose to just ignore the warning and everything would work fine, but it's constantly printing this junk warning output to the screen from most git commands, often more than once:
|
Hi @dbarnett if you want to just suppress the warning messages the tweak in this branch should do the job. I don't want to suppress these warnings in the official release however, on the theory that they will (eventually) guilt me into releasing full PBKDF2 support, and also annoy other users enough that they will help me test the support in PR #162. [Edit: Updated commit link to point to branch instead, with a follow-on fix] |
Thanks! I wasn't suggesting to categorically silence it, but I'd hoped transcrypt or openssl would have a way to ACK the warnings case-by-case. It might still be worth pushing a modified version of that in the meantime that instead of outright swallowing the warning wraps it and points new users to context, like "warning is expected, configure xyz option to suppress, see issue #nn for details". And there wouldn't at least be a way to roll together duplicates of the same warning from a single git command invocation, would there? |
@jmurty It would be nice if we could come up with a concrete list of action items / requirements for #162 I love transcrypt, but I also feel uncomfortable recommending it due to its weaker KDF defaults. I'm not even sure pbkdf2 is enough, but argon2 support in openssl is not widespread, and I'm not sure when it will be. |
Using OpenSSL 1.1.1 (in my case, in Git for Windows, which uses
OpenSSL 1.1.1a 20 Nov 2018
), theclean
script constantly leads togit
commands printing out the following warning:The text was updated successfully, but these errors were encountered: