Posts Tagged md5

Md5 bruteforce in Ruby

Here is the code for bruteforce md5 hash. It check only small letters.

require 'digest/md5'
def crack(hash, max_length)
  for i in 1..max_length
    for word in ('a'*i..'z'*i)
      if Digest::MD5.new(word) == hash
        return word
      end
    end
  end
end
puts crack(ARGV[0], 5)

, ,

Leave a comment

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: