Skip to content

Instantly share code, notes, and snippets.

@patch-werk
Created March 10, 2014 22:41
Show Gist options
  • Select an option

  • Save patch-werk/9475992 to your computer and use it in GitHub Desktop.

Select an option

Save patch-werk/9475992 to your computer and use it in GitHub Desktop.
A laughably slow CPU based approach to www.crackthewallet.com contests. Requires this library https://github.com/deseret-tech/litecoin-python. It alternates between generating passwords with an equal distribution of numbers and letters and passwords with the distribution of numbers and letters dependent on the size of their char sets (10 digitch…
import string
import random
import time
import litecoinrpc
import sys
from litecoinrpc.exceptions import WalletPassphraseIncorrect
def stringgen(size=16,chars=string.ascii_lowercase+string.ascii_uppercase, digs=string.digits):
return random.choice([''.join(random.choice([random.choice(chars),random.choice(digs)]) for x in range(size)),
''.join(random.choice(chars+digs) for x in range(size))])
conn = litecoinrpc.connect_to_local()
run = True
maxtps = 0
while(run):
start = time.time()
ps = stringgen()
try:
conn.walletpassphrase(ps,10)
run = False
print "\npassword is " + ps
conn.sendtoaddress("youraddress", conn.getbalance())
except WalletPassphraseIncorrect,e:
pass
tps = repr(round(1/(time.time() - start),2))
if tps > maxtps:
maxtps = tps
sys.stdout.write("\rtrying: " + ps + " tries per second: " + tps + " max: " + maxtps)
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment