Cryptographic attack library for rust and python
Project description
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()));
c.extend(e);
let e = sha2_256::extend(&h, m.len(), e);
assert_eq!(e, 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 develop --features python
Features
Length Extension Attack
- MD4
- MD5
- SHA0
- SHA1
- SHA2_256
- SHA2_512
- Ripemd128
- Ripemd160
- Ripemd256
- Ripemd320
- Whirlpool
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
fractus-0.1.2.tar.gz
(31.4 kB
view hashes)
Built Distribution
Close
Hashes for fractus-0.1.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fea7c9c9f7b832bd541e4c9f2a6ad134c5e4079d7ec9a9f2756f61633f642ce |
|
MD5 | 712780fee9a524c1aca89e3a561944f6 |
|
BLAKE2b-256 | 361c0c4ac07994de3dcf59e549f010d58f1fe4310abcd455c72f318651a34a5a |