here's one that is probably very easy to figure out. i know the first 7 characters of the passphrase, and have some combination of 4-8 numbers on the end, no spaces anywhere.
Start myraidcoind like this:
myriadcoind -rpcpass=some-password
Then run this script:
#!/usr/bin/ruby -w
require 'net/http'
require 'json'
start = "passphrase"
min_digits = 4
max_digits = 8
$rpc_user = ""
$rpc_pass = "some-password"
$rpc_port = 10889
def test(passphrase)
puts passphrase.inspect
request = Net::HTTP::Post.new("/")
request.basic_auth $rpc_user, $rpc_pass
request.body = { method:"walletpassphrase", params:[passphrase, 1] }.to_json
response = Net::HTTP.new("localhost", $rpc_port).request(request)
if response.code == "401" ; puts "Incorrect RPC user/pass" ; exit 1 ; end
ret = JSON.parse response.body
if ret["error"].nil? ; puts "\nFound it! #{passphrase.inspect}" ; exit ; end
return if ret["error"]["code"] == -14 # wrong passphrase
raise "WTF? #{ret.inspect}"
end
(min_digits..max_digits).each do |digits|
(10**digits).times do |i|
test("%s%0#{digits}d" % [start, i])
end
end
puts "No luck."
exit 1
It'll take about 1 day for 6 digits, 2 weeks for 7, 3 months for 8.