Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Haiku Crypto Kit

Haiku Crypto Kit

A quick talk on the work in progress Haiku Crypto kit

Alexander von Gluck IV

January 21, 2016
Tweet

Other Decks in Programming

Transcript

  1. Haiku Crypto Kit The goal of the crypto kit is

    to provide a built-in consistent and optimized API to service basic cryptographic hashing and symmetric-key functions. What it is... Adds a flexible cryptographic API that performs one-way hashing and two-way encryption with the existing Haiku API objects developers love (BString, BFile, raw data, etc) … what it is NOT The crypto kit is NOT designed to replace advanced industry standard hybrid cryptosystems like SSL and OpenGPG
  2. BCryptoHash Basic Workflow ◉ Accepts an API defined algorithm. (B_HASH_SHA256)

    ◉ User calls AddData(...) functions that accept a wide variety of input types. ◉ User calls Result(BString*) producing a BString hash result of the combined data which was input. ◉ User can call Flush() to clear the data provided thus far to BCryptoHash or deconstruct + construct.
  3. BCryptoHash Algorithms ◉ B_HASH_BLAKE2 (sha-3 finalist) ◉ B_HASH_MD4* ◉ B_HASH_MD5

    ◉ B_HASH_SHA256 ◉ B_HASH_SHA512 * Do we want to support legacy algorithms to provide “as many as possible” or do we want to limit algorithms based on best practices? We need to balance providing legacy algorithms while limiting API churn.
  4. BCryptoHash String Example #include <String.h> #include <CryptoHash.h> #include <stdio.h> int

    main(int argc, char** arv) { BCryptoHash hashAPI(B_HASH_SHA256); BString sample("The quick brown fox jumped over the lazy dog"); BString result; hashAPI.AddData(&sample); hashAPI.Result(&result); printf("Result: %s\n", result.String()); return 0; } Result: 7d38b5cd25a2baf85ad3bb5b9311383e671a8a142eb302b324d4a5fba8748c69