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
{{ message }}
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Copy file name to clipboardExpand all lines: PROTOCOL.md
+53-3Lines changed: 53 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -236,6 +236,7 @@ Perfect Forward Secrecy (PFS) ensure that if a ML-KEM-1024 keypair was compromis
236
236
### 5.1. Assumptions
237
237
`Alice` wants to generate / rotate ephemeral `ML-KEM-1024` (`Kyber1024`) keys with `Bob`.
238
238
`Alice` and `Bob` have verified each other's `per-contact` keys using `SMP`
239
+
`Alice` is the initiator
239
240
240
241
### 5.2. PFS Exchange
241
242
`Alice` generates new ephemeral `ML-KEM-1024` keypair and signs them with her `per-contact` keys for `Bob`
@@ -280,12 +281,61 @@ Then `Bob` does the same as `Alice` did, generating his own `hash chain` seed if
280
281
281
282
Now `Alice` and `Bob` both have each other ephemeral public keys, Have successfully rotated their ephemeral keys.
282
283
283
-
### 5.3. Security notes
284
-
We use `hash chain`s for replay protection.
285
-
We also use `per-contact` keys for tampering and spoofing protection.
284
+
### 5.3. PFS rotation counters
285
+
`Alice` stores a `rotate_at` and `rotation_counter` variables alongside her ephemeral keys, locally.
286
+
287
+
Those counters will be used in `6. Messages` to determine when it is time to rotate ephemeral keys.
288
+
289
+
### 5.4. Security notes
290
+
We use `hash chain`s for replay protection.
291
+
292
+
The reason we opted for a `hash chain` instead of a simple `replay_counter`, is to hide the crucial metadata of how many key rotations happened and in which order. This help us later on build plausible deniability
293
+
294
+
We also use `per-contact` keys (`ML-DSA-87`) for tampering and spoofing detection & protection.
286
295
287
296
288
297
## 6. Messages
298
+
Coldwire uses One-Time-Pads (OTP) for encrypting message content.
299
+
Pads are shared using `PFS` ephemeral `Kyber1024` keys
300
+
301
+
### 6.1. Assumptions
302
+
`Alice` wants to send a
303
+
```python
304
+
"Hello, World!"
305
+
```
306
+
message to `Bob`
307
+
308
+
`Alice` and `Bob` are already `SMP` verified, and have exchanged their ephemeral keys
309
+
310
+
### 6.2. Message prepartions
311
+
Before `Alice` sends her message to `Bob`, she checks if `rotate_at` equals the `rotation_counter`, if positive, she first rotates her ephemeral keys with `Bob` (see `5. Perfect Forward Secrecy` for more details).
312
+
313
+
If negative, she calculates if she has enough pads for the `message`, the `64 byte``hash-chain`, `padding`, and `padding_length` headers, this is calculated like:
0 commit comments