Author

Topic: How to come from a secret exponent to a Bitcoin private key? (Read 2028 times)

hero member
Activity: 870
Merit: 585
when looking at http://offlinebitcoins.com/, the secret that can be entered is the 32bit 32byte (64 character) HEX string, that effectivly is the private key.
I assume that you want to convert it into a WIF key, so it can be used in a wallet - this is what http://offlinebitcoins.com/ can do for you, one after another ...
There are seven steps behind, as explained here: https://en.bitcoin.it/wiki/Wallet_import_format.  

There is the bitcointools and botg (bitcoin of the grid: https://bitcointalksearch.org/topic/bitcoin-off-the-grid-botg-secure-savings-script-v011-23081).
These are shell scripts running on unixoid OS, with a bit fiddling around (it has base58; sha256 and ripemd160 can be coming through openssl), so you'd quickly get what you are looking for.
I am not aware of a Windows shell script suite.
The wiki page on generating the WIF key from the hex string leaves out the actual syntax of the command for the SHA256 hash:
$ echo -n 'hexstringhere' | xxd -r -p | sha256sum -b
sr. member
Activity: 257
Merit: 343
when looking at http://offlinebitcoins.com/, the secret that can be entered is the 32bit HEX string, that effectivly is the private key.
I assume that you want to convert it into a WIF key, so it can be used in a wallet - this is what http://offlinebitcoins.com/ can do for you, one after another ...
There are seven steps behind, as explained here: https://en.bitcoin.it/wiki/Wallet_import_format

There is the bitcointools and botg (bitcoin of the grid: https://bitcointalksearch.org/topic/bitcoin-off-the-grid-botg-secure-savings-script-v011-23081).
These are shell scripts running on unixoid OS, with a bit fiddling around (it has base58; sha256 and ripemd160 can be coming through openssl), so you'd quickly get what you are looking for.
I am not aware of a Windows shell script suite.

sr. member
Activity: 412
Merit: 287
Hey Guys,

I just made a batch file which gives out random secret exponents (like on offlinebitcoins.com) into a text file.
Does anyone of you know a programm or some other really fast way how to transform this list with secret exponents into a list with their Bitcoin private keys?

Best regards,

Patrick

A secret exponent in this context usually means the number multiplied against the generator point.. which IS the private key.
Are you looking to encode it differently, or what are you trying to do?
legendary
Activity: 4130
Merit: 1307
They may be random enough, hopefully they are, but it is very easy to mess something up, for example blockchain.info and Android messed it up, as have many others:

http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html
https://bitcoin.org/en/alert/2013-08-11-android

But as Danny said, if it is really random, sharing the code is a good way to ensure that it really doesn't have any obvious issues.

 Smiley

I think that they are random enough Wink
Here is an example (for the secret exponents):
...
legendary
Activity: 3472
Merit: 4794
I think that they are random enough Wink

These are two VERY DIFFERENT sentences when it comes to crypto security:
  • "I THINK they are random enough"
  • "They ARE random enough"

A process that gives "random enough" results is safe to share with everyone.  Since the results are "random" it doesn't matter who knows how they were generated.

If you are not willing to share the exact process (better yet, the exact code) you are using to generate the secret exponents, then they almost certainly are NOT random enough.

If you are willing to share the exact process (better yet, the exact code) you are using to generate the secret exponents, then you'll at least have the opportunity to have some knowledgeable people inform you how much of a risk you are taking.

legendary
Activity: 4130
Merit: 1307
Also just be really careful that these are truly random if you intend to store value there. This is often a tricky thing and many people have been caught by using either not truly random prngs etc
member
Activity: 117
Merit: 250
Hey Guys,

I just made a batch file which gives out random secret exponents (like on offlinebitcoins.com) into a text file.
Does anyone of you know a programm or some other really fast way how to transform this list with secret exponents into a list with their Bitcoin private keys?

Best regards,

Patrick
Jump to: