Skip to content

Commit 6b00871

Browse files
authored
Update PROTOCOL.md
1 parent 3f196be commit 6b00871

File tree

1 file changed

+25
-3
lines changed

1 file changed

+25
-3
lines changed

PROTOCOL.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,32 @@ if len(message) + OTP_PADDING_LENGTH + message_otp_padding_length > len(alice_pa
333333
`OTP_PADDING_LENGTH` is `2 bytes`, which can hold up to `65535 bytes` of `padding`.
334334
If `message` length is greater than `OTP_PADDING_LIMIT`, the message is not padded.
335335

336-
Unlike in `5. Perfect Forward Secrecy`, our `hash_chain` here provides both replay protection *and* tampering protection
336+
Unlike in `5. Perfect Forward Secrecy`, our `hash_chain` here provides both replay protection *and* tampering protection. The reason we don't utilize the `per-contact` keys for signing the message, is to provide plausible deniability.
337337

338+
Messages could been forged by `Bob`.
338339

340+
### 6.3. OTP Pad Generation
341+
If in `6.2. Message Prepartions`, `Alice` did not have enough pads, she would need to generate and sends pads to `Bob`.
342+
343+
`Alice` uses `Bob` ephemeral `Kyber1024` public-key to generate `OTP_PAD_SIZE bytes` of `shared secrets`. `OTP_PAD_SIZE` is default to `11264 bytes` (around 11 Kilobytes)
344+
345+
Those `shared secrets` are now `Alice`'s OTP pads.
346+
347+
The ciphertext result of `Kyber1024` is signed using `per-contact` keys and is sent to `Bob`:
348+
```json
349+
[POST] /messages/send_pads
350+
{
351+
"otp_hashchain_ciphertext": "Base64 encoded Kyber1024 ciphertext",
352+
"otp_hashchain_signature": "Base64 encoded signature of ciphertext",
353+
"recipient": "Bob's user ID"
354+
}
355+
```
356+
357+
`Bob` receives, and decapsulates the `shared secret`s, and treats the first `64 bytes` of the `shared secret`s as the `hash chain` initial seed.
358+
359+
`Bob` then saves both the pad and the `hash chain` seed locally as `Alice`'s.
360+
361+
`Bob` will use that pad to decrypt future messages sent by `Alice`.
362+
`Bob` will also use that `hash chain` to verify messages were not tampered with, nor replayed.
339363

340364

341-
## WORK-IN-PROGRESS
342-
We are working on writing more protocol sections

0 commit comments

Comments
 (0)