Guest User

Untitled

a guest
Mar 13th, 2017
1,112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ///<reference path="./typings/index.d.ts"/>
  2.  
  3. declare function require(name:string);
  4.  
  5. import crypto = require('crypto');
  6.  
  7. class Main {
  8.  
  9.     cracks: Crack[];
  10.  
  11.     constructor() {
  12.         this.cracks = [new Crack("Z29vLmdsL3lBdGhsTiAgIA=="),
  13.         new Crack("fD60XVFRFjodKBUqzfKs0Q=="),
  14.         new Crack("Pi2/l7B0wXhwfRSOTeABJg=="),
  15.         new Crack("Q3I16m1uQqvV3DhmpQYHGA=="),
  16.         new Crack("WEtrJHI1SCg1h6Ad25q6aw=="),
  17.         new Crack("AAAgA8DTpkPHYO7REDPI5w=="),
  18.         new Crack("ybv71eNGc3+shy1ZHYsPlg==")];
  19.  
  20.         this.cracks.forEach(element => {
  21.             console.log("Secret Code" + element.result);
  22.         });
  23.     }
  24.  
  25. }
  26.  
  27. class Crack {
  28.     hashfound: boolean;
  29.  
  30.     hash: string;
  31.     chars: string = "abcdefghijklmnopqrstuvwxyz1234567890";
  32.     curdone: number;
  33.     combos: number = this.chars.length* this.chars.length* this.chars.length* this.chars.length* this.chars.length* this.chars.length;
  34.     result: string;
  35.  
  36.     constructor(hash: string) {
  37.         this.curdone = 0;
  38.         this.loop(hash, "", 1, 6);
  39.         this.hashfound = false;
  40.     }
  41.  
  42.     loop(hash: string, curstr:string, curpos:number, maxpos:number) {
  43.         this.chars.split("").forEach(char => {
  44.             if (this.hashfound) {
  45.                 return;
  46.             }
  47.             let tmpstr = curstr + char;
  48.             if (curpos < maxpos) {
  49.                 this.loop(hash, tmpstr, curpos+1, maxpos);
  50.             }
  51.             let hash1 = crypto.createHash('md5').update(tmpstr).digest("base64");
  52.             let hash2 = crypto.createHash('md5').update(hash1).digest("base64");
  53.             let hash3 = crypto.createHash('md5').update(hash2).digest("base64");
  54.  
  55.             if (hash3 == hash) {
  56.                 console.log("Found it: " + tmpstr);
  57.                 this.hashfound = true;
  58.                 this.result = tmpstr;
  59.                 return;
  60.             }
  61.             this.curdone = this.curdone+1;
  62.  
  63.             if (this.curdone % 1000000 == 0) {
  64.                 console.log("Hashes Done: "+ ((this.curdone/this.combos)*100).toString().match(/.*\..{0,2}|.*/)[0]+"%");
  65.             }
  66.  
  67.         });
  68.     }
  69.  
  70. }
  71.  
  72. var main = new Main();
Advertisement
Add Comment
Please, Sign In to add comment