Task

Find, through brute force, the five-letter passwords corresponding with the following SHA-256 hashes:

1. 1115dd800feaacefdf481f1f9070374a2a81e27880f187396db67958b207cbad
2. 3a7bd3e2360a3d29eea436fcfb7e44c735d117c42d1c1835420b6b9942dd4f1b
3. 74e1bb62f8dabb8125a58852b63bdf6eaef667cb56ac7f7cdba6d7305c50a22f

Your program should naively iterate through all possible passwords consisting only of five lower-case ASCII English letters. It should use concurrent or parallel processing, if your language supports that feature. You may calculate SHA-256 hashes by calling a library or through a custom implementation. Print each matching password, along with its SHA-256 hash.

Related task: SHA-256

var [const] MsgHash=Import.lib("zklMsgHash");
var [const] gotEm=Atomic.Int();	// global signal for all threads
 
const THREADS=9,   // how we will split task, THREADS<=26
      CHR_a="a".toAsc();
 
fcn crack(c,n,hashes){	// thread
   sha256:=MsgHash.SHA256; // the SHA-256 hash method, byte bucket
   bytes,hash := Data(),Data().howza(0); // byte buckets to reduce garbage production
   firstLtrs:=(c+CHR_a).walker(n);
   ltrs:=CHR_a.walker;	// iterator starting at 97/"a"
   foreach a,b,c,d,e in (firstLtrs,ltrs(26),ltrs(26),ltrs(26),ltrs(26)){ 
      if(not hashes2go) return(); // all cracked, stop, not really needed
      bytes.clear(a,b,c,d,e);     // recycle Data, faster than creating Strings
      sha256(bytes,1,hash);	  // put hash in hash
      if(hashes.holds(hash)){
         println(bytes.text," --> ",hash.pump(String,"%02x".fmt));
	 hashes2go.dec();	// I cracked one, let mom thread know
      }
   }
}