#crypto #sha256 #hmac #pbkdf2 #scrypt

dumb-crypto

Dumb, but easily verifiable implementations of crypto algorithms

10 stable releases

3.1.0 Jan 25, 2019
3.0.1 Jan 5, 2019
2.0.0 Jan 5, 2019
1.0.5 Jan 5, 2019

#375 in Cryptography

Download history 94/week @ 2022-06-02 2/week @ 2022-06-09 8/week @ 2022-06-16 7/week @ 2022-06-23 4/week @ 2022-06-30 25/week @ 2022-07-07 17/week @ 2022-07-14 33/week @ 2022-07-21 6/week @ 2022-07-28 34/week @ 2022-08-04 12/week @ 2022-08-11 5/week @ 2022-08-18 25/week @ 2022-08-25 7/week @ 2022-09-01 40/week @ 2022-09-08 7/week @ 2022-09-15

79 downloads per month

MIT license

105KB
2.5K SLoC

dumb-crypto

Build Status Latest version Documentation License

This library implements following cryptographic routines in the dumbest and the most obvious way:

  • sha256
  • hmac-sha256
  • pbkdf2-sha256
  • salsa20
  • scrypt

Why?

Normally, one would find a highly optimized code implementing those. However, verifying such code is a non-trivial task. All routines (except for scrypt itself) are pre-requisites for scrypt, and a provided just for convenience.

Quick example

extern crate dumb_crypto;

use::dumb_crypto::scrypt::Scrypt;

let scrypt = Scrypt::new(1, 128, 1);

let mut out: [u8; 8] = [0; 8];

scrypt.derive(b"passphrase", b"salt", &mut out);

assert_eq!(out.to_vec(), vec![
    79, 35, 225, 99, 145, 145, 172, 245,
]);

Using dumb-crypto

See documentation for details.

No runtime deps