Skip to content

Commit

Permalink
update docs to reflect changes in AES key handling
Browse files Browse the repository at this point in the history
  • Loading branch information
shanet committed Aug 13, 2013
1 parent 0d3bc04 commit ef0580c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions docs/protocol.rst
Expand Up @@ -20,7 +20,9 @@ Basic Properties
* ``destNick``: The nickname of the receiver
* ``payload``: The content of the message. If an encrypted message, it is base64 encoded
* ``hmac``: The HMAC as calculated by the sender to be verified against by the receiver
* ``key``: If the payload is encrypted, the AES key used for this message (base64 encoded and encrypted with RSA)
* ``iv``: If the payload is encrypted, the AES IV used for this message (base64 encoded and encrypted with RSA)
* ``salt``: If the payload is encrypted, the AES salt used for this message (base64 encoded and encrypted with RSA)
* ``error``: The error code, if applicable

* All commands *are* case sensitive
Expand Down Expand Up @@ -66,8 +68,8 @@ Encryption Details
* Each client generates a unique RSA keypair and AES key for each connection. The exception being if the user
saved an RSA keypair. Then each connection uses the same keypair, but an AES key is randomly generated for
each connection.
* The AES IV is randomly generated for each message and sent along with the message encrypted with the RSA keys
that are exchanged in the handshake.
* The AES key, IV, and salt are randomly generated for each message and sent along with the message encrypted
with the RSA keys that are exchanged in the handshake.

-----------------
Handshake Details
Expand All @@ -86,15 +88,11 @@ The commands in the handshake must be performed in the following order:
+--------+---------+--------+
|PUB_KEY | -> | |
+--------+---------+--------+
|(switch to RSA encryption) |
+--------+---------+--------+
|AES_KEY | -> | |
+--------+---------+--------+
|AES_SALT| -> | |
+--------+---------+--------+
|(switch to AES encryption) |
+--------+---------+--------+

The client may reject a connection with the ``REJ`` command instead of sending the ``REDY`` command.

--------------------
Message Loop Details
--------------------
Expand Down

0 comments on commit ef0580c

Please sign in to comment.