Last active
August 29, 2015 13:56
-
-
Save tenten0213/8910211 to your computer and use it in GitHub Desktop.
数字6桁パスワードのハッシュ値の総当たり
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'digest/md5' | |
hash = "4b364677946ccf79f841114e73ccaf4f" | |
salt = "hoge$" | |
0.upto(999999) { |num| | |
pass = "%06d"%num | |
digest = Digest::MD5.new.update(salt + pass).to_s | |
if digest == hash | |
puts "Solved: #{pass}" | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
formatとmd5の取り方を変えたら半分程度まで早くなった模様。
勉強になります。
https://gist.github.com/Sheile/8949613