Bitcoin Forum
November 02, 2024, 12:33:26 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Generating key pairs in Linux from a passphrase?  (Read 1234 times)
samadamsbeer (OP)
Member
**
Offline Offline

Activity: 93
Merit: 10


View Profile
April 23, 2013, 04:25:11 PM
 #1

In Linux I know "echo -n passphrase | sha256sum" will give me a string which then you convert to base58 to get a private key, and then you need to do something to that to get the corresponding public key.

What are the Linux commands to do this beyond the first one "echo -n passphrase | sha256sum" to get the private/public key pairs? Or how would I do that? I am trying to verify pairs given to me by bitaddress.org or brainwallet.org...
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
April 23, 2013, 04:48:38 PM
 #2

Pretty much anything that transforms your passphrase into 256 bits
sha256, first half of sha512, last half of sha512, sha1+sha1, ridemd256, etc

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
samadamsbeer (OP)
Member
**
Offline Offline

Activity: 93
Merit: 10


View Profile
April 23, 2013, 05:13:14 PM
 #3

Pretty much anything that transforms your passphrase into 256 bits
sha256, first half of sha512, last half of sha512, sha1+sha1, ridemd256, etc

Thanks - but can you tell me what the actual commands/steps would be though for Linux to get from seed passphrase to the private/public key?

Sorry I almost posted this to newbie section but thought the folks here would know how to answer.
Zeilap
Full Member
***
Offline Offline

Activity: 154
Merit: 100


View Profile
April 23, 2013, 06:02:01 PM
 #4

Step 1: delete your bash history
Step 2: don't try to roll your own security tools
proff
Newbie
*
Offline Offline

Activity: 46
Merit: 0


View Profile
April 23, 2013, 06:18:23 PM
 #5

Thanks - but can you tell me what the actual commands/steps would be though for Linux to get from seed passphrase to the private/public key?

Sorry I almost posted this to newbie section but thought the folks here would know how to answer.
NB Zeilap's comment. That said, look at https://bitcointalk.org/index.php?topic=133220.0 to see how to string the commands together.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
April 23, 2013, 07:32:59 PM
 #6

The wiki explains everything
Also, writing a space before your command doesn't keep it in bash history

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
dserrano5
Legendary
*
Offline Offline

Activity: 1974
Merit: 1029



View Profile
April 23, 2013, 08:43:51 PM
 #7

Also, writing a space before your command doesn't keep it in bash history

You can't rely on yourself to remember that. It's better to use 'unset HISTFILE'. And close the terminal after finishing so its memory (particularly the scrollback buffer) is released to the OS.
Shevek
Sr. Member
****
Offline Offline

Activity: 252
Merit: 250



View Profile
April 23, 2013, 11:03:31 PM
 #8


Thanks - but can you tell me what the actual commands/steps would be though for Linux to get from seed passphrase to the private/public key?


You can also download the html/js code from https://www.bitaddress.org/ Open your local instance with your browser; go to the tab "Brain wallet" and put there your password. If paranoid, unplug the net cord before proceeding.

Proposals for improving bitcoin are like asses: everybody has one
1SheveKuPHpzpLqSvPSavik9wnC51voBa
samadamsbeer (OP)
Member
**
Offline Offline

Activity: 93
Merit: 10


View Profile
April 24, 2013, 12:39:06 AM
 #9

Proff, at the link you mentioned installing Armory would seem to do the trick? But what command do I use?

Quote
echo -n C4BBCB1FBEC99D65BF59D85C8CB62EE2DB963F0FE106F483D9AFA73BD4E39A8A | python ArmoryQt.py -genPublicKey
did not seem to work.

Would like to use something other than bitaddress or brainwallet.org since I am looking to verify the output from those in the first place. Does not have to be command line based but I was looking for something command line because I was looking to do this on a bootable Puppy Linux machine.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
April 24, 2013, 02:27:47 AM
 #10

I'm not aware of any utilities currently available that will allow you to present a private key and receive a public key in response.

There appear to be libraries for javascript, PHP, and Python to assist with the calculation of the public key.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
April 24, 2013, 05:37:39 AM
 #11

I'm not aware of any utilities currently available that will allow you to present a private key and receive a public key in response..
Pywallet

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
April 24, 2013, 11:17:56 AM
 #12

I'm not aware of any utilities currently available that will allow you to present a private key and receive a public key in response..
Pywallet

I didn't see anything in the usage about that.  What are the command line parameters for that behavior?
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
April 24, 2013, 11:29:07 AM
 #13

pywallet.py -info -importprivkey PRIVKEY ('-importhex' if privkey is hexadecimal)

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
April 24, 2013, 11:35:39 AM
 #14

pywallet.py -info -importprivkey PRIVKEY ('-importhex' if privkey is hexadecimal)

Ah, I had assumed that importprivkey would attempt to import the private key into a wallet.  I hadn't realized that it would write the public key to STDOUT.  Interesting behavior.  Can I get it to write the Bitcoin Address to STDOUT instead of the public key?
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
April 24, 2013, 11:47:37 AM
 #15

Yeah that's pretty misleading but I made these changes when I first started to modify pywallet, that was not intended to become a real, public fork
I think it's mentionned in the readme though

When you do this you get: address, privkey, hexadecimal privkey, hash160 and pubkey

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
April 24, 2013, 12:02:18 PM
 #16

Yeah that's pretty misleading but I made these changes when I first started to modify pywallet, that was not intended to become a real, public fork
I think it's mentionned in the readme though

When you do this you get: address, privkey, hexadecimal privkey, hash160 and pubkey

Great! Thanks.  I've been looking for something like that.
samadamsbeer (OP)
Member
**
Offline Offline

Activity: 93
Merit: 10


View Profile
April 25, 2013, 02:07:48 AM
 #17

Hmm, tried to install in Ubtuntu. Got:

Quote
~$ aptitude install build-essential python-dev python-twisted python-bsddb3
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Dumb question, but do I need to be root to install? Just use sudo before "aptitude"? Always makes me nervous to install this stuff when I am not sure what Im doing.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1280


May Bitcoin be touched by his Noodly Appendage


View Profile
April 25, 2013, 05:40:10 AM
 #18

Yes you always need to be root to install something with aptitude
Yes, just sudo and it's OK
Note that installing with sudo won't make python and other things you install have root rights

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
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!