#sha-256 #fuzzy #bits #term #input #byte #operations

nightly mostinefficientsha

SHA256 implementation in rust using fuzzy bits

1 unstable release

Uses old Rust 2015

0.1.0 Sep 6, 2016

#75 in #term

CC-BY-SA-4.0

65KB
1K SLoC

Rust 1K SLoC // 0.0% comments C 137 SLoC // 0.1% comments

Most Inefficient Sha

Documentation

This crate tries to break SHA256. (But fails unfortunately^^).

It implements SHA-256 in the most inefficient fashion ever. Usually, SHA-256 operates on integers with 32 bits (u32). This implementation uses one double (f64) for each bit of each integer, thereby allowing to use 8 fuzzy input bits for each input byte.

Benchmarks

Processor: Intel(R) Core(TM)2 Duo CPU P8400 @ 2.26GHz, 3072KB Cache

  • Calculating SHA256 with one byte of input data takes 10 ms.
  • Calculating SHA256 with one hundred bytes of input data takes 78 ms.

Why

For fun. It seemed unlikely to work out but I wanted to do some rust.


lib.rs:

This crate tries to break SHA256. (But fails unfortunately).

It implements SHA-256 in the most inefficient fashion ever. Usually, SHA-256 operates on integers with 32 bits (u32). This implementation uses one double (f64) for each bit of each integer, thereby allowing to use 8 fuzzy input bits for each input byte.

Term represents a fuzzy bit either as a settable bit (constant or symbolic) or as a bitwise combination of other Terms, thereby creating a treelike graph of Terms. These terms are evaluated lazily.

U combines 32 Terms and represents a fuzzy integer. U also implements high level operations like shifting, rotating, adding. These operations will be transformed into fuzzy lazily evaluated bit operations.

Sha256 uses these Us to calculate the SHA-256 algorithm.

Linopt uses the fuzzy Sha256 to try to break it. No chance.

Dependencies

~440KB