Bitcoin Forum
November 02, 2024, 02:30:06 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How to come from a secret exponent to a Bitcoin private key?  (Read 2027 times)
Patrick349 (OP)
Member
**
Offline Offline

Activity: 117
Merit: 250


View Profile
June 25, 2016, 11:49:50 AM
 #1

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
cloverme
Legendary
*
Offline Offline

Activity: 1512
Merit: 1057


SpacePirate.io


View Profile WWW
June 25, 2016, 12:40:51 PM
 #2

See here:
http://bitcoin.stackexchange.com/questions/1389/how-are-public-private-keys-in-an-address-created
cr1776
Legendary
*
Offline Offline

Activity: 4214
Merit: 1312


View Profile
June 25, 2016, 01:40:51 PM
 #3

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
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
June 25, 2016, 02:36:34 PM
Merited by ABCbits (1)
 #4

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.

cr1776
Legendary
*
Offline Offline

Activity: 4214
Merit: 1312


View Profile
June 25, 2016, 05:12:49 PM
 #5

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):
...
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 287


View Profile
June 25, 2016, 08:26:52 PM
 #6

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?

Bitwasp Developer.
pebwindkraft
Sr. Member
****
Offline Offline

Activity: 257
Merit: 343


View Profile
June 26, 2016, 10:27:10 PM
Merited by ABCbits (1)
 #7

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://bitcointalk.org/index.php?topic=23081.0).
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.

birr
Hero Member
*****
Offline Offline

Activity: 870
Merit: 585


View Profile
July 05, 2016, 01:39:16 PM
 #8

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://bitcointalk.org/index.php?topic=23081.0).
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
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!