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: docs/protocol/index.md
+66-1Lines changed: 66 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,4 +5,69 @@ nav_order: 2
5
5
6
6
# Protocol
7
7
8
-
Information about the Parley protocol.
8
+
Information about the Parley protocol.
9
+
10
+
## Accounts
11
+
12
+
Accounts have 3 values: public/private keypair (Supported: `RSA-OAEP`, label: `parley`) and a passkey\
13
+
The server must only store the public and an encrypted version of the passkey, never receiving the private key.\
14
+
Public/Private key pair must be generated by the client and passkey by the server.\
15
+
The server should verify the client with both the passkey and by decrypting a value encrypted with the public key.
16
+
17
+
Flow:
18
+
```
19
+
Client Server
20
+
| |
21
+
| Keypait creation |
22
+
| /signup -------------> |
23
+
| | Challenge value encrypted
24
+
| <----------- Challenge |
25
+
| Decryption |
26
+
| /challenge ----------> |
27
+
| | Verify & Paskey creation
28
+
| <--- Passkey & Session |
29
+
| |
30
+
```
31
+
32
+
## Messages
33
+
34
+
The users keypairs are used for asymmetric key encryption to pass an ephemeral shared key (Supported: `AES-GCM`) to allow symmetric key encryption of messages.\
35
+
Shared keys should expire after an hour for foward secrecy, this prevents compromised keys from leaking the entire chat.\
36
+
If expired: The next person to send a message must generate a new shared key and encrypt it with each member's public key.\
37
+
Messages additionally are signed with the user's private key as `RSA-PSS` with a salt length of `222` (Signature format: `${message_content}:${channel_id}:${unix_s}`).\
38
+
To send the message it requires the shared key which needs the user's public key to encrypt, and to sign it, the private key.\
39
+
This prevents MitM attacks since changing the public key of a member to be able to read messages would either invalidate the signature or decryption.
0 commit comments