fractus 0.1.0

Cryptographic attack library for rust and python
Documentation

Fractus

Fractus is a cryptographic attack library written in rust. It is also available through python

Run

Rust

cargo add fractus

use fractus::sha2_256;

let m = b"abc";
let h = sha2_256::compute(&m);
let e = b"cde";
let mut c = m.to_vec();
c.extend(sha2_256::padding(m.len()))
    .extend(e);
let e = sha2_256::extend(&h, m.len(), e);
assert_eq!(ext, sha2_256::compute(c));

Python

from fractus import sha2_256

m = b'secret'+b'abc'
h = sha2_256.compute(m)
e = b'test'
assert sha2_256.extend(h, len(m), e) == sha2_256.compute(m + sha2_256.padding(len(m)) + e)

Develop

Rust

cargo test

Python

in a python virtual environment: maturin build --features python

Features

Length Extension Attack

  • MD4
  • MD5
  • SHA0
  • SHA1
  • SHA2_256
  • SHA2_512
  • Ripemd128
  • Ripemd160
  • Ripemd256
  • Ripemd320
  • Whirlpool