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
+101-2Lines changed: 101 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,6 @@ The *`Strandlock`* Protocol is a composite encryption protocol designed to inter
17
17
18
18
The protocol retains high-availability asynchronous behaviour, without reducing security and or privacy like similar protocols.
19
19
20
-
21
20
If `ML-KEM-1024` and `Classic McEliece-8192128` are broken, messages remain secure, provided that the initial `SMP` verification request is not intercepted. If the initial SMP request is intercepted, security is maintained as long as the SMP answer retains sufficient entropy.
22
21
23
22
If `xChaCha20poly1305` is broken, messages remain safe as long as (at least) one `KEM` is uncompromised.
@@ -28,6 +27,9 @@ If Both `KEMs`, and `xChaCha20Poly1305` are compromised in future, as long as `O
28
27
29
28
All cryptographic primitives are not just stacked on top of each other, but interwined. Each primitive both aids each other, and acts as a fallback if one or more are broken.
30
29
30
+
Strandlock protects confidentiality and anti-MITM in the active and passive-recording model (no endpoint compromise) by combining independent KEMs, per-message key rotation, and an OTP batch fallback.
31
+
See the full Threat Model section (7. Threat Model) for exact attacker capabilities and limits.
32
+
31
33
32
34
*`Strandlock`* is transport-agnostic. It can operate over any underlying protocol, including federated chat systems like *`Coldwire`* or raw `TCP` sockets.
33
35
@@ -97,6 +99,12 @@ When you longpoll for new data, each data is appended with a `32 byte` id, once
97
99
98
100
This applies to all requests.
99
101
102
+
103
+
#### Server:
104
+
A server implementing the strandlock protocol, generaly only sees ciphertext in, ciphertext out. And perhaps an identifier like a mailbox id.
105
+
106
+
The server must store the ciphertext in the order they were sent in, and when fetched, the server must return the ciphertext in the same order.
107
+
100
108
### 3. Socialist Millionaire Protocol (`SMP`)
101
109
#### 3.1 Initialization (`Alice` -> `Bob`)
102
110
@@ -426,8 +434,98 @@ Obviously, this does not mean a nonce reuse wouldn't occur, it just means an adv
426
434
However, implementations **MUST** still use cryptographically secure `CSPRNG` for nonce generation nonetheless. This protection property only protects against the off chance a `CSPRNG` generated nonce gets duplicated.
427
435
428
436
437
+
### 7. Threat Model
438
+
439
+
This section defines what Strandlock defends and what it explicitly does not. Readers and auditors should treat the capabilities below as explicit boundaries: guarantees only hold within these constraints.
440
+
441
+
#### 7.1. Adversary Capabilities
442
+
##### Passive network observer:
443
+
- Can record all traffic indefinitely.
444
+
- Has significant storage and compute resources.
445
+
- May attempt to decrypt recorded messages later if primitives are broken.
446
+
447
+
##### Active network adversary:
448
+
-Can intercept, modify, inject, replay, and delay messages in real time.
449
+
- Can attempt man-in-the-middle (MITM) during initial `SMP` initiation.
450
+
451
+
##### Cryptanalytic attacker:
452
+
- May eventually break one or more cryptographic primitives (e.g. a single KEM, symmetric cipher, or hash function).
453
+
- Breaking multiple primitives simultaneously is assumed to be infeasible.
454
+
455
+
##### Compromised server/relay:
456
+
- May attempt to manipulate metadata, delay or replay traffic, or observe message flow patterns.
457
+
- Cannot read, tamper, nor replay data without breaking the protocol.
458
+
459
+
#### 7.2. Adversary profiles
460
+
The following profiles illustrate typical adversaries considered under this threat model. They are not exhaustive but cover a wide range of realistic threats.
461
+
462
+
##### Opportunistic attacker
463
+
Individual or small group with limited resources.
464
+
- May control a single server, home network
465
+
- May have access to a single GPU farm, or a small botnet.
466
+
- Relies primarily on weak SMP answers, poor user choices, to conduct TOFU-style attacks.
467
+
- Cannot break cryptographic primitives.
468
+
- Could cause denial-of-service attacks against clients and or server.
469
+
470
+
Safety Requirements:
471
+
- SMP anwer that's equal or greater than 6 bytes of entropy, and that is not a public knowledge.
472
+
473
+
##### Organized criminal group
474
+
Medium-scale adversary with access to large GPU/CPU clusters, and or a large botnet (~100000 average-desktop devices).
475
+
- Capable of monitoring large network segments and recording high-volume traffic.
476
+
- Can attempt real-time active attacks (MITM, replay) against targets of interest.
477
+
- Relies primarily on weak SMP answers, poor user choices, to conduct TOFU-style attacks.
478
+
- Cannot cryptographic primitives through pure brute force, but may target implementation mistakes (low probability).
479
+
- Could cause denial-of-service attacks against clients and or server.
480
+
481
+
Safety Requirements:
482
+
- SMP anwer that's equal or greater than 10 bytes of entropy, and that is not a public knowledge.
483
+
484
+
##### Nation-state adversary
485
+
Large-scale surveillance capability (backbone-level passive collection), access to powerful computing power through dedicated GPU and CPU clusters, and has access to quantum computers.
486
+
- Access to exascale computing resources, custom ASICs, and cryptanalytic expertise, and quantum computers.
487
+
- Can sustain long-term traffic analysis.
488
+
- Assumed capable of breaking one or two primitives eventually, but unlikely all cryptographic primitives (we use multiple algorithms, all based on different mathematical).
489
+
- Still relies primarily on weak SMP answers, or poor user choices, to conduct TOFU-style attacks.
490
+
- May exploit memory corruption vulnerabilities in the underlying cryptographic primitives implementations, and or in the application implementing the Strandlock protocol.
491
+
- Low probability for the Strandlock-implementing application to have protocol-related memory-corruption bugs as the protocol only support raw text messages.
492
+
- Could cause denial-of-service attacks against clients and or server.
493
+
494
+
Safety Requirements:
495
+
- SMP anwer that's equal or greater than 32 bytes of entropy, and that is not a public knowledge.
496
+
- Correct implementations of all cryptographic primitives
497
+
- Safely handling over-the wire ciphertext, and truncating it to safe length before decapsulating, or verifying signatures, to prevent buffer-overflows.
498
+
- The use of memory-safe languages for the implementations, such as Rust.
499
+
500
+
501
+
#### 7.3. Explicit Exclusions
502
+
503
+
The protocol does not protect against:
504
+
- Endpoint compromise: malware implants, malicious firmware, physical access, or key extraction from a participant’s device.
505
+
- Weak human secrets: extremely low-entropy & predictable SMP answers (e.g. “1234”) chosen by users.
506
+
- Side-channel attacks: timing, power analysis, cache leaks, or memory dumps.
507
+
- Social engineering: phishing, coercion, or tricking a user into revealing message(s) content, or the SMP answer.
508
+
509
+
#### 7.4. Security Guarantees
510
+
Under the stated model and assuming correct implementation:
511
+
512
+
- Confidentiality: Messages remain confidential against a passive adversary even if one or two cryptographic primitive is broken.
513
+
- Forward secrecy: Compromise of KEM keys does not reveal past session data, nor future sessions.
514
+
- Post-compromise safety: New keys are derived for every data; compromise of one message key does not expose previous data.
515
+
- Resistance to passive logging: SMP answers exchanged in encrypted form cannot be recovered later; an adversary must perform active MiTM and break them during the live exchange.
516
+
- Metadata hiding: Nonces, key rotation counters, and similar protocol metadata are encrypted, preventing adversaries from learning them.
517
+
- Replay protection: Adversaries cannot replay old data, nor force old KEM reuses, even if valid signatures unless the hashing primitives have been broken.
518
+
- Tamper protection: Adversaries cannot tamper with data, unless they break every crytographic primitive.
519
+
520
+
#### 7.5. Conditional Security Guarantees
521
+
522
+
- If both KEMs and the symmetric cipher are simultaneously broken, security falls back to the one-time pad batch (assuming OTP exchange was not intercepted).
523
+
524
+
- If the OTP exchange is intercepted, confidentiality relies on the layered KEM + symmetric encryption.
525
+
526
+
- If the initial SMP secret has sufficient entropy, active MITM during first contact is prevented. If it is weak, MITM may succeed to pull TOFU-style MITM attack during setup to spoof the per-contact signing key.
429
527
430
-
### 7. Design choices (Questions & Answers)
528
+
### 8. Design Choices (Questions & Answers)
431
529
**Question**:
432
530
433
531
Why did you opt for `xChaCha20Poly1305` over `ChaCha20Poly1305` if you're encrypting the nonce ?
@@ -436,6 +534,7 @@ Why did you opt for `xChaCha20Poly1305` over `ChaCha20Poly1305` if you're encryp
436
534
437
535
Even though we do encrypt the nonce, encrypting the nonce does not prevent nonce-reuse attacks, it only hides the fact they occured.
438
536
`xChaCha20Poly1305` nonces are a lot larger than `ChaCha20Poly1305` nonces, which means the probablity of a collision is tiny.
537
+
The reason we hide the nonce, is not to hide nonce-reuse attacks primarily, as we already rotate the strand key everytime it is used. Hiding the nonce in the ratchet helps against metadata, and provides a built-in replay-protection for the xchacha wrapping, requiring no need to do i.e. hash chains.
0 commit comments