Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import ecdsa
- import binascii
- import hashlib
- BlockChain = []
- BlockchainFile = 'TXaddress.txt'
- PasswordList = 'passwords.txt'
- secp256k1curve=ecdsa.ellipticcurve.CurveFp(115792089237316195423570985008687907853269984665640564039457584007908834671663,0,7)
- secp256k1point=ecdsa.ellipticcurve.Point(secp256k1curve,0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798,0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8,0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141)
- secp256k1=ecdsa.curves.Curve('secp256k1',secp256k1curve,secp256k1point,(1,3,132,0,10))
- def addy(pk):
- pko=ecdsa.SigningKey.from_secret_exponent(pk,secp256k1)
- pubkey=binascii.hexlify(pko.get_verifying_key().to_string())
- pubkey2=hashlib.sha256(binascii.unhexlify('04'+pubkey)).hexdigest()
- pubkey3=hashlib.new('ripemd160',binascii.unhexlify(pubkey2)).hexdigest()
- pubkey4=hashlib.sha256(binascii.unhexlify('00'+pubkey3)).hexdigest()
- pubkey5=hashlib.sha256(binascii.unhexlify(pubkey4)).hexdigest()
- pubkey6=pubkey3+pubkey5[:8]
- pubnum=int(pubkey6,16)
- pubnumlist=[]
- while pubnum!=0: pubnumlist.append(pubnum%58); pubnum/=58
- address=''
- for l in ['123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'[x] for x in pubnumlist]:
- address=l+address
- return '1'+address
- def Crack(word):
- privatekey = (int(hashlib.sha256(word).hexdigest(),16))
- privatekeysha = (hashlib.sha256(word)).hexdigest()
- bcaddy = addy(privatekey)
- return bcaddy
- def LoadTXaddresses(BlockchainFile):
- # Load 4 bytes of each wallet address from the blockchain into RAM
- BlockChain = [line.rstrip('\n') for line in open(BlockchainFile)]
- return BlockChain
- def Check(WalletAddress):
- CompressedAddress = WalletAddress[1] + WalletAddress[4] + WalletAddress[10] + WalletAddress[20] + WalletAddress[len(WalletAddress) -1]
- for x in range (len(BlockChain) -1):
- if(BlockChain[x] == CompressedAddress):
- return True
- def CompressBlockchain(blockchainFile):
- # Read all the TX or RX addresses from a flat text file line by line
- # Store only 4-5 bytes
- with open(blockchainFile) as f:
- for line in f:
- print line[1] + line[4] + line[10] + line[20] + line[len(line) -2]
- #CompressBlockchain('SampleTX-List.txt')
- BlockChain = LoadTXaddresses(BlockchainFile)
- def Scan(PasswordList):
- with open(PasswordList) as f:
- for line in f:
- thisAddress = Crack(line.strip())
- if(Check(thisAddress) == True):
- print line
- Scan(PasswordList)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement