| require 'digest/md5' |
| $TARGET = "2c4972c770836eaf3b237a561b06daaa" |
| |
| def brute_force(target) |
| tries = 0 |
| ('A'..'AAAAAAAAA').each do |candidate| |
| tries+=1 |
| puts "Testing: " + candidate if tries%10000==0 |
| hashed = Digest::MD5.hexdigest candidate |
| hashed =Digest::MD5.hexdigest hashed |
| return candidate if (hashed == target) |
| end |
| #f |
| end |
| |
| puts brute_force($TARGET) |