Implementing new algorithm questions
#2
Still having trouble figuring this out. If my results say the digest is 100% recovered but status is "Exhausted" instead of "Cracked" when testing with hardcoded compare values to match the ones stored in the digest in the parse_hash function, what change is missing to cause this difference? The hash is listed but with no key matched to it, I was thinking that the first attempted key would have been paired but perhaps this is matching with the compare before the first key(hello) is checked.

Could anyone spare some time to show a very basic .cl file for a simple hash algo like FNV-1a 32-bit? Here is the Rust equivalent that you could run in Rust REPL in the browser:


Code:
fn fnv1a32(data: &[u8]) -> u32 {
   let mut hash: u32 = 2166136261;
   for byte in data {
       hash ^= *byte as u32;
       hash *= 16777619;
   }

   hash
}

fn main() {
   println!("hash is: {:x}", fnv1a32("hello".as_bytes()));
}


That outputs a hash of "4f9f2cab" for "hello".


Messages In This Thread
RE: Implementing new algorithm questions - by polarathene - 10-06-2016, 04:18 PM