Sender Authentication #640
Replies: 5 comments 1 reply
-
I like this for the following reasons:
|
Beta Was this translation helpful? Give feedback.
-
This is a proposed change to the native X25519 recipient type, not to the overall age format. As such, its effects are completely negated if there is any other kind of recipient present in the same header. So this proposal would still require the same changes that were proposed in the referenced Cryptography Dispatches. While that could be special-cased inside every client implementation (as was originally done for the
I recommend that this proposal be initially trialled as a standalone age plugin, that uses a random label to tell the age client that it must be the only recipient in the header. The sender-auth UX could be achieved in a standalone plugin with the existing UX in a few different ways:
I recommend this approach because there is a bunch of UX work that needs to be done before any kind of CLI flag could be proposed for addition to the core client interface shared by e.g. |
Beta Was this translation helpful? Give feedback.
-
I'm not sure I understand the proposal correctly so feel free to correct me in any way possible, but doesn't this process give the public keys a "private" character, in the sense that they at least shouldn't be advertised if not kept secret entirely? |
Beta Was this translation helpful? Give feedback.
-
Based on outside discussions, I'm going to make an opinionated decision that we shouldn't support multiple recipients with this feature, as it could degrade KCI security further than anticipated.
No. You specifically need the recipient's secret key in order to recover the first 256 bits of the shared secret. (You can use either party's to recover the latter 256 bits of the shared secret, but that's not helpful.) Authentication is tied into whether the ciphertext decrypts successfully. |
Beta Was this translation helpful? Give feedback.
-
The cryptography looks correct. I want to call out two important subtle pieces of the design which need to be preserved:
I agree with requiring a single recipient as cross-recipient impersonation is a problem that cannot be reasonably solved without much more invasive changes to how age works. Long-term, I believe that taking in the sender's public key as a command-line argument would be a very good thing. Otherwise people will need to pass it in via STDOUT. There is definitely a lot of work that needs to get there first. Finally, you specify that determining the sender via trial decryption is not acceptable. Why not? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
This is a rough draft proposal for implementing Sender Authentication in age without introducing any new cryptographic primitives.
This has previously been discussed on Cryptography Dispatches and in prior discussions.
Use Case
As an age user, I may want to allow my friends to send me encrypted messages while also being reasonably sure about which friend sent it to me.
It's not enough to sign-then-encrypt with another utility (e.g., minisign) because signatures intended for someone else could be re-bound to new ciphertext and I might be fooled.
I would also like to prevent strangers from being able to prove who sent which file without needing to be able to decrypt it.
(It's okay if I cannot decrypt files for which I do not know the sender's public key, should sender authentication be enabled for the message.)
Before I can think about such a thing in practice, however, I need to grapple with the complexity of key management. (For the sake of discussion, I'm going to assume this is already a solved problem, but any discussion must either address it or explicitly punt on it to be solved at another layer.)
Threat Model
Proposed Solution
Cryptography
The current age protocol (v1) specifies an X25519 Recipient Type, which uses ephemeral-static Diffie-Hellman.
When sender authentication is enabled for the message, we will implement a design pattern inspired by Signal's X3DH. This may warrant a different recipient-type (for domain separation and simplicity).
(This diff is meant to be pseudocode, to illustrate the point.)
And then the HDKF usage when sender auth is enabled would look like:
What about multiple recipients?
Same thing: Just add an additional ECDH(senderSecret, recipientPublic) to the HKDF IKM, and use a domain-separated label.EDIT: After feedback on the Fediverse, I'm of the opinion that multiple recipients should not be supported by this feature.
API
When encrypting a message, adding an additional optional flag (e.g.
-A [key-id]
) that enables this mode.When decrypting a message sent with this mode, the recipient must pass a congruent flag (e.g.,
-A [key-id]
) to tell age which public key to use to unwrap the key from the header.Security Considerations
An attacker is assumed to be able to distinguish between messages sent with and without sender-auth enabled.
If the recipient doesn't know the public key of the sender, decryption will fail. This information is not communicated in-band.
Therefore, anyone that opts to use sender-auth is responsible for ensuring that the public keys are vended appropriately, and that the recipient knows which public key is expected to successfully decrypt the ciphertext before they attempt to do so with age. Users SHOULD NOT be opportunistic (i.e., loop through their address book and try everyone's public key until one succeeds).
If the recipient specifies a sender's public key for a ciphertext that didn't use sender-auth, it MUST fail to decrypt.
Beta Was this translation helpful? Give feedback.
All reactions