You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: STRANDLOCK_PROTOCOL.md
+32-7Lines changed: 32 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -383,34 +383,59 @@ However, implementations **MUST** still use cryptographically secure `CSPRNG` fo
383
383
384
384
385
385
### 7. Design choices (Questions & Answers)
386
-
**Question**:
386
+
**Question**:
387
+
387
388
Why did you opt for `xChaCha20Poly1305` over `ChaCha20Poly1305` if you're encrypting the nonce ?
388
389
389
390
**Answer**:
391
+
390
392
Even though we do encrypt the nonce, encrypting the nonce does not prevent nonce-reuse attacks, it only hides the fact they occured.
391
393
`xChaCha20Poly1305` nonces are a lot larger than `ChaCha20Poly1305` nonces, which means the probablity of a collision is tiny.
392
394
395
+
396
+
**Question**:
397
+
398
+
Why did you opt for `xChaCha20Poly1305` over `AES-GCM-SIV` ?
399
+
400
+
**Answer**:
401
+
402
+
We chose `xChaCha20Poly1305` over `AES-GCM-SIV` (or just `AES` as an algorithm in general) because the former is easier to implement in software, less vulnerable to side-channels, and does not depend on any black-box hardware "accelerators".
403
+
404
+
393
405
**Question**
406
+
394
407
Why did you opt for `OTP` encryption, if you're already using `xChaCha20Poly1305`, why not just use `xChaCha` alone ?
395
408
396
409
**Answer**
410
+
397
411
OTP encryption provides unique properties, and when combined with a classical symmetric algorithm, both algorithms benefit each other. On one hand, `xChaCha20Poly1305` encryption of `OTP`-encrypted messages, provides protection against `OTP` implementation errors, on the other hand, using `OTP`-encrypted messages as plaintext to `xChaCha20Poly1305` destroys one of cryptographors favorite oracles `known plaintext oracle`, which removes a whole class of attacks.
398
412
399
413
Additionally, if the `OTP Batch` exchange was not intercepted nor logged, OTPs become unbreakable.
400
414
415
+
401
416
**Question**
417
+
402
418
Why do you generate random bytes of X size, then hash them with `SHA3_512` and truncate them back to X size ?
403
419
404
420
**Answer**
405
421
406
-
Nonce hiding: Prevents metadata leakage and hides rare nonce collisions.
422
+
Using raw entropy does not guarantee it is uniform. As `CSPRNG` entropy is usually collected from device's sensors, and whatnot, a poorly made `CSPRNG` can have small biases, or even leak metadata. Hashing them with SHA3_512 helps "whiten" any potentinal issue.
407
423
408
-
OTP usage: Provides additional protection even if XChaCha is broken. Makes known-plaintext attacks ineffective.
424
+
The reason we use SHA3_512 specifically, and truncate to size we need, is actually 3 separate reasons:
425
+
- Less code is called: Depending on one hashing algorithm, means we have to call less code with potentinally untrusted input.
426
+
-`SHA3_512` internal state can store more entropy than for instance `SHA3_256`.
427
+
-`SHA3` in general, is proven to be better resistant to `Shor's` algorithm, which makes it better long-term than (for instance) `SHA2`.
428
+
-
409
429
410
-
Composite security: Messages remain secure if an attacker breaks a single primitive; at least 3 primitives need to be broken for full compromise (ML-KEM, McEliece, XChaCha or SMP).
430
+
**Question**
431
+
Why do you use `Argon2id` instead of `Argon2i` or `Argon2d` ?
432
+
433
+
**Answer**
434
+
Because `Argon2id` combines both `Argon2i` and `Argon2d` providing more general protection, and is recommended variant as per `RFC 9106`.
411
435
412
-
xChaCha20-Poly1305 vs AES-GCM: Larger nonce, no hardware dependencies, reduces potential backdoors.
413
436
414
-
SHA3-512 whitening: Reduces CSPRNG bias and protects against metadata leakage.
437
+
**Question**
438
+
Why don't you use a NIST-approved algorithm instead of `Argon2id` ?
415
439
416
-
Argon2id for SMP: Protects against brute force attacks and Trust-On-First-Use style attacks.
440
+
**Answer**
441
+
Because just because an algorithm is not NIST-approved, does not mean it's insecure. NIST tend to take their time standardizing and recommending algorithms, and `Argon2id` is relatively new. Even though `Argon2id` is on the newer side of things, it has won `Passowrd Hashing Competition` and has undergone many audits, and has been proven to be among the slowest, GPU-resistant hashing algorithms.
0 commit comments