To send a message to the cloud, do the following:
- Send a GET request to
http://vast-lake-95491.herokuapp.com/nonce - Save the
cookiefound in the response headers. - The response body is the
nonce_hex. - Hex-decode the
nonce_hexto getnonce_bytes. - Hex-decode the contents of
security/keys/public/serverto getserver_public_bytes. - Hex-decode the contents of
security/keys/private/nodeto getnode_secret_bytes. - Hex-decode the contents of
security/keys/sign/nodeto getnode_sign_bytes. - Encrypt your
plaintextmessage usingnonce_bytes,node_secret_bytes, andserver_public_bytesto getciphertext. - Sign the
ciphertextusingnode_sign_bytesto getsignedtext. - Hex-encode
signedtextto getsignedtext_hex. - Prepend
node_tosignedtext_hexto gettransmittext_hex. - Put
transmittext_hexas the raw body of the HTTP POST. - Add a header key
Cookie, with valuecookiefrom step 2. - Send the HTTP POST to
http://vast-lake-95491.herokuapp.com/send_message. - The response you should get is the
plaintext. Your message was accepted. Hooray!
There is a Python example for the above actions in client.py.
A note on keys and sender name to prepend:
- If you are
node03, use theprivateandsignkeys with filenamenode03. - If you are
node03, prependnode03_tosignedtext_hexbefore sending.