Support multi-bot secure key exchange

This commit is contained in:
2019-09-11 04:31:44 +00:00
parent b95c6593c8
commit 377e561764
3 changed files with 78 additions and 21 deletions
+23 -7
View File
@@ -16,21 +16,37 @@ from bwb.molly import bwb
### Handshaking
On boot up, send `000000handshake [secret]` to BWB chat:
Boot up:
```text
secret = bwb.init()
await client.send_message(BWB, '000000handshake ' + secret)
client.send_message(BOT_WITH_BOT, '000000init ' + bwb.init())
```
When you see a `000000handshake [secret data]`:
On `000000init [data]`:
```text
bwb.init(secret_data)
await client.send_message(BWB, bwb.wrap('🤝'))
client.send_message(BOT_WITH_BOT, '000000handshake ' + bwb.handshake(data))
```
When you see and authed '🤝', reply with *unauthed* '🤝'.
On `000000handshake [data]`:
```text
client.send_message(BOT_WITH_BOT, bwb.wrap('secret ' + bwb.secret(data)))
bwb.set_otp(bwb.init_secret)
```
On _OTP authed_ `123456secret [data]`:
```text
bwb.set_secret(data)
client.send_message(BOT_WITH_BOT, bwb.wrap('🤝'))
```
On _OTP authed_ `123456🤝`:
```text
client.send_message(BOT_WITH_BOT, '🤝')
```
### Interaction