Skip to content

Commit 96462fb

Browse files
authored
Update STRANDLOCK_PROTOCOL.md
1 parent 2d1a1e8 commit 96462fb

File tree

1 file changed

+32
-7
lines changed

1 file changed

+32
-7
lines changed

STRANDLOCK_PROTOCOL.md

Lines changed: 32 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -383,34 +383,59 @@ However, implementations **MUST** still use cryptographically secure `CSPRNG` fo
383383

384384

385385
### 7. Design choices (Questions & Answers)
386-
**Question**:
386+
**Question**:
387+
387388
Why did you opt for `xChaCha20Poly1305` over `ChaCha20Poly1305` if you're encrypting the nonce ?
388389

389390
**Answer**:
391+
390392
Even though we do encrypt the nonce, encrypting the nonce does not prevent nonce-reuse attacks, it only hides the fact they occured.
391393
`xChaCha20Poly1305` nonces are a lot larger than `ChaCha20Poly1305` nonces, which means the probablity of a collision is tiny.
392394

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+
393405
**Question**
406+
394407
Why did you opt for `OTP` encryption, if you're already using `xChaCha20Poly1305`, why not just use `xChaCha` alone ?
395408

396409
**Answer**
410+
397411
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.
398412

399413
Additionally, if the `OTP Batch` exchange was not intercepted nor logged, OTPs become unbreakable.
400414

415+
401416
**Question**
417+
402418
Why do you generate random bytes of X size, then hash them with `SHA3_512` and truncate them back to X size ?
403419

404420
**Answer**
405421

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.
407423

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+
-
409429

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`.
411435

412-
xChaCha20-Poly1305 vs AES-GCM: Larger nonce, no hardware dependencies, reduces potential backdoors.
413436

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` ?
415439

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

Comments
 (0)