Ark Crypto Arduino Step 1
ESP8266 Crypto | https://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() {}