sleepdefic1t
12/15/2017 - 9:37 PM

Ark_Crypto_Arduino_Step_1.md

Ark Crypto Arduino Step 1

required libs

ESP8266 Cryptohttps://github.com/intrbiz/arduino-crypto
#include <Crypto.h>

/*
 * secret:  "bullet parade snow bacon mutual deposit brass floor staff list concert ask"
 * returns: "950981CE17DF662DBC1D25305F8597A71309FB8F7232203A0944477E2534B021"
 */

void sha256From(const char *secret)
{
  SHA256 hasher;
  hasher.doUpdate(secret);

  byte hash[SHA256_SIZE];
  hasher.doFinal(hash);

  for (byte i = 0; i < SHA256_SIZE; i++) {
    if (hash[i] < 0x10)
      Serial.print('0');
    Serial.print(hash[i], HEX);
  }
}

void setup()
{
  Serial.begin(115200);

  const char *secret = "bullet parade snow bacon mutual deposit brass floor staff list concert ask";
  sha256From(secret);
}

void loop() {}