Skip to content

kitmonisit/geec-makina

Repository files navigation

Instructions for nodeMCU on encryption

To send a message to the cloud, do the following:

  1. Send a GET request to http://vast-lake-95491.herokuapp.com/nonce
  2. Save the cookie found in the response headers.
  3. The response body is the nonce_hex.
  4. Hex-decode the nonce_hex to get nonce_bytes.
  5. Hex-decode the contents of security/keys/public/server to get server_public_bytes.
  6. Hex-decode the contents of security/keys/private/node to get node_secret_bytes.
  7. Hex-decode the contents of security/keys/sign/node to get node_sign_bytes.
  8. Encrypt your plaintext message using nonce_bytes, node_secret_bytes, and server_public_bytes to get ciphertext.
  9. Sign the ciphertext using node_sign_bytes to get signedtext.
  10. Hex-encode signedtext to get signedtext_hex.
  11. Prepend node_ to signedtext_hex to get transmittext_hex.
  12. Put transmittext_hex as the raw body of the HTTP POST.
  13. Add a header key Cookie, with value cookie from step 2.
  14. Send the HTTP POST to http://vast-lake-95491.herokuapp.com/send_message.
  15. 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 the private and sign keys with filename node03.
  • If you are node03, prepend node03_ to signedtext_hex before sending.

About

Cloud side services for geec-esp8266

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published