Coder Social home page Coder Social logo

cryptosuite's Introduction

Cryptosuite is a cryptographic library for Arduino (including SHA and HMAC-SHA)

It currently supports secure hashing and hashed message authentication using SHA-1, SHA-256, HMAC-SHA-1 and HMAC-SHA-256.

Installation:
  Make a 'libraries' directory with your Arduino sketches folder if you do not already have one.
  Copy the 'Sha' directory into that directory.
  Restart Arduino to rescan for new libraries.

Using SHA-1:
  #include "sha1.h"
  ...
  uint8_t *hash;
  Sha1.init();
  Sha1.print("This is a message to hash");
  hash = Sha1.result();

  The hash result is then stored in hash[0], hash[1] .. hash[19].

Using HMAC-SHA-1:
  #include "sha1.h"
  ...
  uint8_t *hash;
  Sha1.initHmac("hash key",8); // key, and length of key in bytes
  Sha1.print("This is a message to hash");
  hash = Sha1.resultHmac();

  The hash result is then stored in hash[0], hash[1] .. hash[19].

Using SHA-256:
  #include "sha256.h"
  ...
  uint8_t *hash;
  Sha256.init();
  Sha256.print("This is a message to hash");
  hash = Sha256.result();

  The hash result is then stored in hash[0], hash[1] .. hash[31].

Using HMAC-SHA-256:
  #include "sha256.h"
  ...
  uint8_t *hash;
  Sha256.initHmac("hash key",8); // key, and length of key in bytes
  Sha256.print("This is a message to hash");
  hash = Sha256.resultHmac();

  The hash result is then stored in hash[0], hash[1] .. hash[31].


Verification:
  The provided example code tests against published test vectors.
  SHA-1: FIPS 180-2, RFC3174 compliant
  HMAC-SHA-1: FIPS 198a compliant
  SHA-256: FIPS 180-2, RFC4231 compliant
  HMAC-SHA-256:  RFC4231 compliant

cryptosuite's People

Contributors

cathedrow 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.