-
Notifications
You must be signed in to change notification settings - Fork 7
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
Use better key stretching #9
Comments
You're welcome. Glad you find this useful. I see you're writing a significant shell script that also includes security; you may find some useful ideas in the team's shell style guide: http://github.com/sixarm/sixarm_shell_style_guide |
Thanks, that looks like a great resource 🍻 |
@joelparkerhenderson Just out of interest, are you aware of a way I can bypass the password cache for a single command? The users should be prompted for the password every time the try to decrypt, it should never be cached and automatically decrypt. I currently have a configurable This is obviously not ideal because it completely reloads the gpg agent.
|
To the best of my knowledge, a gpg program cannot bypass the agent in the way you want. I looked for quite a while a year ago, and it seemed to me that the gpg command was deliberately aiming more toward being akin to an account-wide keyring and less toward a single-use key. For example the GPG command line option My personal opinion is that for some of my purposes, i.e. for simple symmetric encryption of files that we send to our customers, the gpg agent cache effect makes the UI/UIX problematic and too confusing for some novices. Like you, I looked at restarting the agent each time, but found that the approach didn't sit well with some experts, and sometimes interfered with other legitimate uses of gpg that ran on the same accounts, such as secure email programs and git signing. The cache issue is what made me look for alternatives, and I chose openssl. The openssl code has had some significant security bugs yet seems solid enough to me for the symmetric encryption areas. The exact code we use now is https://github.com/sixarm/openssl-encrypt |
I knew it might be annoying for people who have other keys they want cached but hadn't even considered breaking software that depended on it :/
I looked at OpenSSL originally but from what I read the KDF was considerably weaker which was why I went with GPG. Is that still the case? |
I haven't looked at the KDF specifically. What I found last year was a general opinion that the OpenSSL code could benefit from some more people helping, including developers and also reviewers. I never found a good solution to few of my needs: 1) always doing a password prompt on the console, 2) running reliably in a macOS terminal after I |
As far as I was aware it just does a SHA-256 hash of the input to use as the encryption key. It expects input to be sufficiently secure, passing a user supplied password in directly would not be very strong to use directly as an encryption key and would be highly susceptible to brute force force attacks. There may be options to change that though, I'm not sure. This is all off the top of my head from some reading I did over a year ago so take it with a grain of salt. Oh well, thanks for taking the time to answer my questions, appreciate it. I will probably just stick with |
You're welcome. If you happen to find a better solution, whenever in the future, can you do me a favor and post it here? I would like to try it. Thank you! |
Default key stretching is ok but this is stronger.
Source: https://github.com/SixArm/gpg-encrypt
Thanks @joelparkerhenderson!
The text was updated successfully, but these errors were encountered: