To send a message to the cloud, do the following:
- Send a GET request to
http://vast-lake-95491.herokuapp.com/nonce
- Save the
cookie
found in the response headers. - The response body is the
nonce_hex
. - Hex-decode the
nonce_hex
to getnonce_bytes
. - Hex-decode the contents of
security/keys/public/server
to getserver_public_bytes
. - Hex-decode the contents of
security/keys/private/node
to getnode_secret_bytes
. - Hex-decode the contents of
security/keys/sign/node
to getnode_sign_bytes
. - Encrypt your
plaintext
message usingnonce_bytes
,node_secret_bytes
, andserver_public_bytes
to getciphertext
. - Sign the
ciphertext
usingnode_sign_bytes
to getsignedtext
. - Hex-encode
signedtext
to getsignedtext_hex
. - Prepend
node_
tosignedtext_hex
to gettransmittext_hex
. - Put
transmittext_hex
as the raw body of the HTTP POST. - Add a header key
Cookie
, with valuecookie
from 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 theprivate
andsign
keys with filenamenode03
. - If you are
node03
, prependnode03_
tosignedtext_hex
before sending.