Skip to content

Commit f3eadda

Browse files
authored
Update PROTOCOL.md
1 parent 9970530 commit f3eadda

File tree

1 file changed

+21
-16
lines changed

1 file changed

+21
-16
lines changed

PROTOCOL.md

Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Version: Draft 1.0 (Work in Progress)
55
Author: ChadSec (Freedom Club)
66

77
## 1. INTRODUCTION
8-
### 1.1. prologue
8+
### 1.1. Prologue
99

1010
Coldwire is a post-quantum secure communication protocol focused on:
1111
- Minimal metadata leakage
@@ -24,7 +24,7 @@ There are no persistent contact lists or user directories on the server, no conc
2424

2525
Server only relays encrypted data between clients, deleting data after delivery. Data is only kept in an in-memory database (official implementation uses Redis).
2626

27-
### 1.2. Terminology & wording
27+
### 1.2. Terminology & Wording
2828

2929
`Alice`: User initiating verification (User 1)
3030

@@ -35,17 +35,19 @@ Server only relays encrypted data between clients, deleting data after delivery.
3535
`User`: The human end-user (not the software)
3636
`SMP`: Socialist Millionaire Problem
3737

38-
## 2. CRYPTOGRAPHIC PRIMITIVES
38+
All requests payloads and responses are sent & received in `JSON` format, unless expliclity stated otherwise.
3939

40-
### Authentication:
40+
## 2. Cryptographic Primitives
41+
42+
### 2.1. Authentication:
4143

4244
Long-term Identity Key: `ML-DSA-87` (`Dilithium5`) signature key pair
4345

4446
Per-contact Verification Keys: ML-DSA-87 key pair generated for each contact
4547

4648
Identity Verification: Socialist Millionaire Problem (SMP) variant
4749

48-
### Key Derivation & Proofs:
50+
### 2.2. Key Derivation & Proofs:
4951

5052
Hash: `SHA3-512` (Note: we use `SHA3`, because `SHA3`'s Keccak sponge remains indifferentitable from a random oracle even under quantum attacks)
5153

@@ -54,27 +56,27 @@ MAC: `HMAC-SHA3-512`
5456
Password-based KDF: `Argon2id` with `Memory_cost` set to `256MB`, `iterations` set to 3 and `salt_length` set to `32`.
5557

5658

57-
## 3. AUTHENTICATION FLOW
59+
## 3. Authentication Flow
5860

59-
### Identity Key Generation
61+
### 3.1. Identity Key Generation
6062

6163
`Client` generates a `ML-DSA-87` keypair locally (if he doesn't already have a keypair.)
6264

6365
`Public key` and `user ID` used for authentication; private key stored securely on disk.
6466

65-
### Registration / Login
67+
### Registration / Login (Authentication)
6668

6769
Client sends
6870
```
6971
POST /authentication/init
7072
```
71-
with JSON payload that consists of public key (and user_id if re-authenticating).
73+
with payload that consists of public key (and user_id if re-authenticating).
7274

7375
Server responds with a base64-encoded random challenge.
7476

7577
`Client` decodes challenge, signs it with his Dilithium private key.
7678

77-
`Client` sends signature to POST /authentication/verify.
79+
`Client` sends signature to ```POST /authentication/verify```.
7880

7981
Server verifies signature:
8082

@@ -145,31 +147,34 @@ POST /smp/step_2
145147

146148
### 4.4. SMP STEP 3 (Alice → Bob)
147149

148-
Alice computes expected proof_1 from Bob and verifies.
150+
`Alice` computes expected `proof_1` from Bob and verifies.
149151

150152
If valid, computes proof for Bob's key:
151-
153+
```python
152154
fpB = sha3_512(PK_B)
153155
message = rB + rA + fpB
154156
proof_2 = HMAC(secret, message, sha3_512)
155-
157+
```
156158
Alice sends:
157-
159+
```
158160
POST /smp/step_3
161+
```
162+
```json
159163
{
160164
"proof" : hex(proof_2),
161165
"recipient_id": Bob's user_id
162166
}
167+
```
163168

164-
5.4 SMP COMPLETION (Bob verifies Alice)
169+
### 4.5 SMP Completion (Bob verifies Alice)
165170

166171
Bob computes expected proof_2 and verifies.
167172

168173
If valid: mutual key verification established.
169174

170175
Both clients mark contact as verified locally.
171176

172-
SECURITY NOTES
177+
### SMP Security notes
173178

174179
Per-contact keypairs ensure compartmentalization of trust.
175180

0 commit comments

Comments
 (0)