-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstowaway protocols.txt
92 lines (79 loc) · 2.31 KB
/
stowaway protocols.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
All messages use "#### STOWAWAY #### (maybe some meme about the version or linking the github)" now.
All messages attach stowaway.json
NOTE: encrypted is encrypted. Clearly. But I need to write about what's in there.
ALL HAVE A VERSION KEY & VALUE FOR VERSIONING (to allow for backwards compatibility)
SENDING A MESSAGE:
json:
{
type: 'channel_message',
public: true/false -- if false only sends message to recipients whose key you HAVE signed o.w. everyone in the channel
message: the encrypted message itself
}
then when message recieved:
1. get stowaway.json
2. see if type == message
3. attempt to decrypte encrypted
4. if successful:
a. verify message signature (if not verified add a warning -- protects against token compromise)
b. display message
c. if old key in fingerprint respond with current key provenance protocol from fingerprinted key
HANDSHAKE:
json:
{
type: 'handshake',
respond: true/false,
public_key: armored public key
}
then when message recieved
1. get attached json & check type
2. old handhsake protocol with publicKey value
KEY SIGNATURE:
NOTE: signer doesn't update his own keys, only after receiving KEY UPDATE does anyone (aside from recipient) update their public keys
json:
{
type: 'signed_key',
recipient: snowflake (discord id) of intended recipient,
public_key: signed key
}
KEY REVOCATION:
json:
{
type: 'revocation'
revocation: armored public revocation
public_key: armored public key
}
KEY_UPDATE: caused by KEY SIGNATURE
json: {
type: 'key_update',
public_key: armored public key
}
HISTORY_INQUIRY: cache this -- DO NOT PRINT
json: {
type: 'history_inquiry',
cause: snowflake (discord id) of message that caused history_inquiry
nonce: nonce of hash of cause id
}
PROVENANCE: caused by HISTORY_INQUIRY, cache this, DO NOT PRINT
json: {
type: 'provenance',
recipient: snowflake of (discord id) of intended recipient
public_key: armored public key
revocations : [
armoredRevocation1,
...
armoredRevocationN
]
}
DISCLOSURE: caused by messages that should have been decrypted
json: {
type: 'disclouse',
cause: snowflake (discord id) of message that caused OVERVIEW,
nonce: nonce of hash of cause id,
public_key: armored public key,
revocations : [
armoredRevocation1,
...
armoredRevocationN
]
}
recipient still checks if fingerprints match, and if they do then update