Support multi-bot secure key exchange
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user