Commit 9248b8fb authored by Chris Müller's avatar Chris Müller
Browse files

Start implementing MD5 BruteForce script

add examples/md5brute.cherry
parent b86d0e5e
(let alphabet (string->tuple "abcdefghijklmnopqrstuvwxyz"))
(let alphabet-size (length alphabet))
(define (plain indices)
(list->string (map (lambda (index) (nth alphabet index)) indices)))
(define (update indices)
(loop (increment (past indices))
(if (null? past)
(raise "End of indices update range reached"))
(if (< (head past) (- alphabet-size 1))
(cons (+ (head past) 1) (tail past))
(cons 0 (increment (tail past))))))
(define (crack digest n)
(loop (generator (indices (make-list n 0)))
(println (plain indices))
(generator (update indices))))
(define (main arg_min arg_max arg_digest)
(let min (string->fixnum arg_min))
(let max (string->fixnum arg_max))
(loop (words (n min))
(if (=< n max)
(crack arg_digest n)
(catch (e) (println "No MD5-Hash of length " n " found (" e ")")))
(words (+ n 1)))
(println "No MD5 hash found"))))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment