Git Product home page Git Product logo

geec-makina's Introduction

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.

geec-makina's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.