-
Notifications
You must be signed in to change notification settings - Fork 18
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
Make all 192 bits of nonces random #155
Comments
I'm fine with adding this. However, counters are recommended by libsodium for all constructions. It might merit some discussion as to why all-random is preferred over Wyng's existing multi-factor counter scheme, which uses a number of techniques to protect the counter and nonce uniqueness. The intent I'm reading into the libsodium docs is, 'Now with 192-bit nonces, random also becomes a safe option'. Yet that is not a guarantee of uniqueness. |
The last time I checked the libsodium docs, my understanding was that recommendation was to use a random nonce for the first message, and to increment it for subsequent messages.
The problem with the existing scheme is that it isn’t guaranteed to actually work. Time in Qubes OS is controlled by
An even safer option would be to go back to plain ChaCha20, but to hash 256 bits of random data, the other counters, and the actual secret to make a secret and unique session key. |
I don't recall "random nonce" defined as a random-initialized counter. I've only seen it used this way, which is a straightforward rnd with no increment. On rollbacks: Wyng detects differences between local cached metadata and remote, so a remote rollback would affect the internal timestamp and counter on the remote, but not the local copy.
Wiping the local cache or rolling back both remote and local in tandem are required to make a clock-based attack feasible—assuming the 80 random bits are not enough of an obstacle, and the clock can be perfectly synced with the time corresponding to the rolled-back counter.
Noting first that Wyng will refuse to run for an encrypted archive having an internal timestamp >= now, I was also going to suggest using a monotonic timer to shore up this process. |
This is not true, BTW. The hardware part can be dropped, as that would be required for synchronizing two trusted parties with a protocol; Wyng is not doing that. Barring the revelation of some astonishingly obvious bug on their part, I'll trust that anything Linux or Xen provides under the guise of "monotonic" can satisfy at least its one core requirement: don't go backwards. That's all we need from it. |
I can see how that would be confusing. A random-initialized counter should work, though. |
@DemiMarie @marmarek Oh, OK. I just provided you the definition from NIST, that's all. |
The two basic problems here are:
|
This was my mistake. I was going off of what I remembered being the libsodium documentation, but I believe it was actually an old version of the documentation and possibly for
That was not my intent, sorry. |
Closing in favor of #157, which takes advantage of Wyng being content-addressed. |
This is the libsodium recommendation.
The text was updated successfully, but these errors were encountered: