Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: spazzdla on October 21, 2017, 01:40:40 PM



Title: Tool to create Private / Public Key from random words?
Post by: spazzdla on October 21, 2017, 01:40:40 PM
Something where you pick like 16, 36.. 400? words and it gives you a combo ?


Title: Re: Tool to create Private / Public Key from random words?
Post by: aplistir on October 21, 2017, 02:13:00 PM
Something where you pick like 16, 36.. 400? words and it gives you a combo ?
You can create a brainwallet in https://www.bitaddress.org/ (https://www.bitaddress.org/) by selecting the tab "brain wallet"
It will create your address and private key from words or phrases.

I would not recommend it though.
Brainwallets are insecure. Many of them have been hacked.
You might think you are selecting random words, but they probably are not as random as you think, and that helps attaker in cracking your key.


Title: Re: Tool to create Private / Public Key from random words?
Post by: ranochigo on October 21, 2017, 02:34:08 PM
Brainwallet is incredibly insecure. Unless you can be certain that no one would ever, I mean ever, guess your passphrase, then you can use it, just don't store too much.

If you'd like, you can try using this: https://keybase.io/warp/. It is safer* than regular brainwallets due to the different technique in generating the brainwallet and also having it salted.

*It is by no means anywhere as safe as generating an address from your desktop wallet.


Title: Re: Tool to create Private / Public Key from random words?
Post by: coinableS on October 23, 2017, 01:43:05 AM
Best to learn to do it yourself so you know you can re-create it in 10 years, you won't have to rely on bitaddress or whoever to still be around.
Probably one of the easiest things to do in python, even for non-programmers.

Download python 3.X
Install, make sure to check to include IDLE and adding python pip to PATH

Open command prompt and type
Code:
pip install bitcoin
Code:
pip install pybitcointools

Now open up Python IDLE, file -> new

include the bitcoin package

Code:
 from bitcoin import *

Create a variable that includes your random words

Code:
myVariable = "taco public free convenient garbage gumball"

Then run it through a sha256 hash

Code:
priv = sha256(myVariable)

Now you can encode it into a WIF private key

Code:
privwif = encode_privkey(priv, 'wif')

Then to get the corresponding address, encode the public key then encode to base58

Code:
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print out what you want
Code:
from bitcoin import *

myVariable = "taco public free convenient garbage gumball"

priv = sha256(myVariable)
privwif = encode_privkey(priv, 'wif')
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print(privwif)
print(addr)

Then save the file, and run it (F5).

Code:
5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN


Title: Re: Tool to create Private / Public Key from random words?
Post by: tobs on October 23, 2017, 06:15:18 PM
Code:
from bitcoin import *

myVariable = "taco public free convenient garbage gumball"

priv = sha256(myVariable)
privwif = encode_privkey(priv, 'wif')
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print(privwif)
print(addr)

Code:
5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN
Just out of curiosity, is there actually a way where you can find your words by only having a private key? I mean like decoding these random numbers and letters into the words behind it?

Like finding out "taco public free convenient garbage gumball", by having only "5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN" available.


Title: Re: Tool to create Private / Public Key from random words?
Post by: coinableS on October 26, 2017, 02:52:56 AM
Code:
from bitcoin import *

myVariable = "taco public free convenient garbage gumball"

priv = sha256(myVariable)
privwif = encode_privkey(priv, 'wif')
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print(privwif)
print(addr)

Code:
5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN
Just out of curiosity, is there actually a way where you can find your words by only having a private key? I mean like decoding these random numbers and letters into the words behind it?

Like finding out "taco public free convenient garbage gumball", by having only "5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN" available.

No, sha256 is a one-way hash function. To get the words from just a private key, sha256 would have to be broken and bitcoin would need to change it's base layer crypto algorithm.


Title: Re: Tool to create Private / Public Key from random words?
Post by: spazzdla on October 31, 2017, 06:59:48 PM
Best to learn to do it yourself so you know you can re-create it in 10 years, you won't have to rely on bitaddress or whoever to still be around.
Probably one of the easiest things to do in python, even for non-programmers.

Download python 3.X
Install, make sure to check to include IDLE and adding python pip to PATH

Open command prompt and type
Code:
pip install bitcoin
Code:
pip install pybitcointools

Now open up Python IDLE, file -> new

include the bitcoin package

Code:
 from bitcoin import *

Create a variable that includes your random words

Code:
myVariable = "taco public free convenient garbage gumball"

Then run it through a sha256 hash

Code:
priv = sha256(myVariable)

Now you can encode it into a WIF private key

Code:
privwif = encode_privkey(priv, 'wif')

Then to get the corresponding address, encode the public key then encode to base58

Code:
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print out what you want
Code:
from bitcoin import *

myVariable = "taco public free convenient garbage gumball"

priv = sha256(myVariable)
privwif = encode_privkey(priv, 'wif')
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print(privwif)
print(addr)

Then save the file, and run it (F5).

Code:
5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN

Perfect this is what I am after


Title: Re: Tool to create Private / Public Key from random words?
Post by: HeRetiK on October 31, 2017, 07:36:40 PM
[...]

Code:
from bitcoin import *

myVariable = "taco public free convenient garbage gumball"

priv = sha256(myVariable)
privwif = encode_privkey(priv, 'wif')
privpub = privtopub(priv)
addr = pubtoaddr(privpub)
print(privwif)
print(addr)

Then save the file, and run it (F5).

Code:
5KWLNBRD7SzYgG53odgvUCki59ccHCGHv4tryExbVsR8FPZ3pPF
14psgZLp3uYo6kvQEtzTXRC1FxdDsuG2fN

Perfect this is what I am after

If you rely on sha256 you should use a really long passphrase though. Something like 50 words or more. Problem being, while not broken, sha256 is rather easily brute forced nowadays, which is why it's also not recommended for storing passwords in databases anymore.

Alternatively you could use a more work intensive hashing algorithm such as bcrypt, scrypt or Argon2. However I personally am not familiar enough with Python to recommend any libraries that provide these hashing functions.


Title: Re: Tool to create Private / Public Key from random words?
Post by: AltCoinProject on November 04, 2017, 08:34:53 AM
You want to make a brute force attack to random addresses. You can create random addresses without words with python.

from bitcoin import *

for addr in range(1000): // 1000 results shown each
    priv = sha256(random_key())
    pub = privtopub(priv)
    addr = pubtoaddr(pub)
           print (addr)
           print (priv)

If you are lucky, you can get an address with priv key in nect 1000 years, which have balanced non-zero.


Title: Re: Tool to create Private / Public Key from random words?
Post by: mstone on November 05, 2017, 03:37:10 PM
If you are lucky, you can get an address with priv key in nect 1000 years, which have balanced non-zero.
extremely, extremely, extremely, extremely, extremely, extremely lucky*