Author

Topic: PyBTC Bitcoin Address's Generator (offline) and More (Read 963 times)

newbie
Activity: 5
Merit: 6
 Grin Done update it

Code:
def rankey():
r = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~!@#$%^&*()"0123456789'
rand = random.sample(r,64)
k = ''.join(rand)
key = sha256(k).hexdigest()
return key
legendary
Activity: 4298
Merit: 1317
oh  Shocked thanx i'll fix it

If you look at the link Newar sent, I think it has a reasonable PRNG in there - I didn't look to see though.

This is a good way to learn about bitcoin, for sure.  ;-)
newbie
Activity: 5
Merit: 6
oh  Shocked thanx i'll fix it
legendary
Activity: 4298
Merit: 1317
also you can use your private key  Wink so don't worry

You should not rely on this code if the part I am looking it is accurate.
You are picking a number between 0 and 0xfffff (1,048,575)
Code:
rand = random.randint(0x00000,0xfffff)

That is not large enough and could be searched in seconds - meaning your coins will be stolen.

You should fix the code.
newbie
Activity: 5
Merit: 6
also you can use your private key  Wink so don't worry
legendary
Activity: 1358
Merit: 1001
https://gliph.me/hUF
newbie
Activity: 5
Merit: 6
 Cheesy Cheesy

i'm a n00b its jsut random kay and encode it in hex and sha256 to get 32-bit key and use it as a private key Smiley
legendary
Activity: 4298
Merit: 1317
One concern I'd have is with the PRNG that is in use.  

:-)
e.g.
Code:
def rankey():
rand = random.randint(0x00000,0xfffff)
key = sha256(str(rand).encode('hex')).hexdigest()
return key

Hello all this my first Post Here  Cheesy Cheesy

PyBTC it's Simple (script & library)
...

newbie
Activity: 5
Merit: 6
Hello all this my first Post Here  Cheesy Cheesy

PyBTC it's Simple (script & library)

Bitcoin Address's Generator (offline) , Base58Check (WIF) Encode/Decode , WIF to Bitcoin Address

Ex for using as library
Code:
    >>> from PyBTC import Addr
    >>> Addr('0000000000000000000000000000000000000000000000000000000000000002')
    '1LagHJk2FyCV2VzrNHVqg3gYG4TSYwDV4m'

WIF
Code:
    >>> from PyBTC import WIF
    >>> WIF('0000000000000000000000000000000000000000000000000000000000000002')
    '5HpHagT65TZzG1PH3CSu63k8DbpvD8s5ip4nEB3kEsreAvUcVfH'

Ex as script

Code:

PyBTC.py -a
Address :  1LTUNrDmDZTDJxy3PviZxjwDJpvUr2YRu7
Privkey :  3427e5ca8a4b34f2c057b6ebd4372b6a86b6c8ad16831cce7cf5b53bcefc637e
WIF     :  5JDFqFTFDEfvzuxrQrSrvnrTHJKqeTdcNTxWMCQ2VotLZTfPw7v

source  Grin https://github.com/MGF15/PyBTC/
Jump to: