Skip to content

Instantly share code, notes, and snippets.

@Sheile
Created February 12, 2014 03:28
Show Gist options
  • Save Sheile/8949613 to your computer and use it in GitHub Desktop.
Save Sheile/8949613 to your computer and use it in GitHub Desktop.
require 'digest/md5'
hash = "4b364677946ccf79f841114e73ccaf4f"
salt = "hoge$"
0.upto(999999) { |num|
pass = num.to_s
# pass = "0" * (6 - pass.size) + pass
pass = ("00000" + pass).slice(-6, 6)
md5 = Digest::MD5.hexdigest(salt + pass)
if hash == md5
puts "Solved: #{pass}"
end
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment