Crate libbruteforce

Source
Expand description

This library helps you to brute force hashes (e.g. passwords). It includes a set of pre-configured hashing functions, like md5 (crate::hash_fncs::md5_hashing), sha1 (crate::hash_fncs::sha1_hashing), or sha256 (crate::hash_fncs::sha256_hashing). You can also provide your own hashing function. PLEASE DO NOT use this software to harm someones privacy in any kind! This project was made for fun and for teaching myself new things about Rust.

The main function of this crate is crack<T: CrackTarget>().

§Minimal example

use libbruteforce::{BasicCrackParameter, CrackParameter, TargetHashInput};
use libbruteforce::hash_fncs::sha256_hashing;
use libbruteforce::symbols;

// sha256("a+c")
let sha256_hash = "3d7edde33628331676b39e19a3f2bdb3c583960ad8d865351a32e2ace7d8e02d";
let max_len = 3;
let min_len = 0;
let alphabet = symbols::Builder::new().with_digits().build();

let res = CrackParameter::new(
        BasicCrackParameter::new(alphabet, max_len, min_len, false),
        sha256_hashing(TargetHashInput::HashAsStr(sha256_hash)),
);

Modules§

hash_fncs
Pre-defined hashing functions that you might use.
symbols
This module contains prebuilt alphabets/symbols that you can use.

Structs§

BasicCrackParameter
Describes the necessary parameters for the crate::crack<T: CrackTarget>()-function without the generic part that is outsourced to crate::TargetHashAndHashFunction.
CrackParameter
Crack parameter for crate::crack<T: CrackTarget>(). It combines the basic struct BasicCrackParameter with the generic TargetHashAndHashFunction. This separation exists so that hash selection functions can be written more convenient.
CrackResult
Describes the result of a finished cracking process.
TargetHashAndHashFunction
Abstraction over a hashing algorithm and the target hash that needs to be cracked. T is of type CrackTarget. This generic struct exists so that hashes of type CrackTarget can be checked independent of the hashing algorithm. This is more efficient than transforming every hash to a string and compare the hash string representations afterwards.

Enums§

TargetHashInput
Helper type to create instances of TargetHashAndHashFunction.

Traits§

CrackTarget
Common trait for crack targets (hashes or plain text to crack). This is the super-type which enables the usage of multiple hashing algorithms. An example that implements this/fulfils the trait requirements is String.

Functions§

crack
This function starts a multi-threaded brute force attack on a given target string. It supports any alphabet you would like to use. You must provide a hashing function. There is a pre-build set of transformation functions available, such as hash_fncs::no_hashing or hash_fncs::sha256_hashing. You can also provide your own hashing strategy.