-
Notifications
You must be signed in to change notification settings - Fork 1
Should XSTREAM bind identities? (Yes) #15
Comments
One option would be to eliminate the user-supplied salt and use the static D-H public key as the HKDF salt. There aren't particularly compelling use cases for the salt otherwise: a random user-supplied salt would most likely come from the same RNG as the ephemeral key and therefore would not help in the event of an RNG failure. Alternatively, rather than completely eliminating the salt parameter, we could do something like this for the HKDF salt:
Personally I'm in favor of eliminating the salt parameter from the user-facing API. XSTREAM is intended to provide a simple, high-level API which is hard to misuse, and as such eliminating parameters that provide dubious value while being one more thing to learn seems good to me. |
I'm going to draw a distinction here - HKDF exposes I definitely agree that At that point, it's worth asking whether |
There are three relevant parameters:
They are presently:
I'm open to changing any of them. I'm somewhat leaning toward:
Though I could see the value in a user-supplied One thing to keep in mind here is I am trying to keep the end-user API as high level as possible and would like to minimize unnecessary knobs. That said I'm not sure there's value in exposing the |
Why not just an aggregate impl, with methods to change anything that doesn't justify being in the "constructor"? (e.g. the salt) |
@xorxornop: Because that's a colossal footgun that undermines the entire point of this library. The point of the miscreant project as a whole is an extension of the NaCl intent to provide a carefully-curated selection of sensible tools that, as much as is possible, avoid exposing footguns to the user. One of the few places NaCl fell down in that goal is nonces; this is pretty much exactly what this library aims to fix. While the decision of what to pass here has multiple options with tradeoffs, it also has nontrivial security implications, and that is exactly why it'd be a failure in the goals of this library to abdicate responsibility and shove the burden of that choice (and of correctly implementing that choice) onto the user. |
The key derivation used by XSTREAM is inspired by the NaCl
crypto_box()
function, which does the following (for "curve25519xsalsa20poly1305"):sk
: private scalarpk
: X25519 public key (i.e. Montgomery-u coordinate)Notable about both this construction and XSTREAM is that they do not bind the identity of the static D-H key when performing key derivation. Considering the use case (offline/data-at-rest encryption) I am not particularly concerned, but perhaps it's worth re-evaluating and e.g. including the static D-H key as an input to HKDF.
The text was updated successfully, but these errors were encountered: