Crates.io | fractus |
lib.rs | fractus |
version | 0.1.11 |
source | src |
created_at | 2024-02-24 12:48:31.272014 |
updated_at | 2024-09-18 19:04:15.977395 |
description | Cryptographic attack library for Rust and Python |
homepage | |
repository | https://github.com/GlacierSG/fractus |
max_upload_size | |
id | 1151611 |
size | 168,979 |
Fractus is a cryptographic attack library written in rust. It is also available through python
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));
pip install fractus
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)