UX: Make age take a passphrase from a non-terminal source #275
Replies: 6 comments 3 replies
-
I created a pull request to add this feature. Let me know what you think. |
Beta Was this translation helpful? Give feedback.
-
I have previously resisted this not just to reduce CLI options, but also to generally disincentivize passphrases. Humans are bad at selecting them, and we want to steer people towards X25519 keys. See #256 (comment) and #257. However, I have to admit it's a half-assed position, because we do let people select passphrases. Maybe that should only be a feature of the API, and the CLI should always generate a custom passphrase... I'll think about this. Thank you for the PR, and sorry if we don't end up merging it. |
Beta Was this translation helpful? Give feedback.
-
Can you tell me about the use case you needed this for? |
Beta Was this translation helpful? Give feedback.
-
First of all, thank you so much for getting back to me so quickly. I really appreciate the work you do because if I'm honest I'm not good when it comes to cryptography. It's really awesome to have such a simple tool without much options to shoot yourself into the foot. Now for my use case (I won't talk about I'm intending to use The private packages are available through a public URL, that's why I want them to be encrypted. My first implementation used a long passphrase generated by Something like Since I don't want to remember this long passphrase I encrypted the longer passphrase with a shorter passphrase (kind of like a password) that will be used to decrypt the long passphrase for decrypting a private package. Illustration:
And that's the reason why I wanted a way to provide However, after thinking for a while I decided to change my implementation to use a key pair generated by Now I'm not sure if I'd really need the option I'd be very happy if you could give me a short feedback on the "publicly available encrypted private key" approach. PS: And if you won't merge my PR, that's totally fine! :) |
Beta Was this translation helpful? Give feedback.
-
Hi @sz-coder, thank you for your patience! We spent a few hours discussing this with @str4d and we decided that we want to keep passphrases interactive in the main binary. There are a few reasons, including wanting to encourage However, we reworked the upcoming plugin design so that it will be possible to write a plugin that encrypts and decrypts regular passphrase-encrypted age files, taking the passphrase from wherever it likes. This is similar to how you can't script SSH password authentication, but there is a
We liked this approach a lot, and we want to encourage it for "encrypt from a script to a passphrase", also because this way the encryption side doesn't need to have the secret at all. This tipped the scale in favor of implementing encrypted identity files, so as of the upcoming v1.0.0-rc.3, you can use such a file directly with Thank you for sharing your use case, age is better for it! |
Beta Was this translation helpful? Give feedback.
-
Whats the approach to provide the passphrase from lets say the gnome-keyring to The |
Beta Was this translation helpful? Give feedback.
-
GnuPG has this implemented with a
--passphrase-fd
argument that takes an integer.Should be pretty easy to implement from looking at the source code.
I know you want to keep the options limited, but it'd be pretty nice to specify a passphrase from another source than a TTY.
(I know, one can fake a TTY to provide
age
with a passphrase).Beta Was this translation helpful? Give feedback.
All reactions