Bitcoin Forum
May 16, 2024, 01:37:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Extracting Privat Key from PEM File on: January 15, 2021, 01:48:40 PM
Hello there,

I have a problem with extracting an Privat Key from an old wallet (*.pfx).

In 2011 I convert a Wallet in this (OpenSSL PEM) format. In an old Post i can see the answer, but my programming skill is weak: https://bitcointalk.org/index.php?topic=2631.0

1. I use OpenSSL for receiving the Privat Key:
openssl pkcs12 -in mywallet.pfx -nocerts -out privatekey.pem -nodes

2. Open the *.pem (I used the public key from the Topic above  Wink ):
-----BEGIN PRIVATE KEY-----
MIH1MIGuBgcqhkjOPQIBMIGiAgEBMCwGByqGSM49AQECIQD/////////////////
///////////////////+///8LzAGBAEABAEHBEEEeb5mfvncu6xVoGKVzocLBwKb
/NstzijZWfKBWxb4F5hIOtp3JqPEZV2k+/wOEQio/Re0SKaFVBmcR9CP+xDUuAIh
AP////////////////////66rtzmr0igO7/SXozQNkFBAgEBA0IABJJ6TBhmiWm4
Y1ACBVJVn0oyG9Ay5IzEZq8cPyrs1PERl963YQh5UrGOT0NodynfHswkz8bUpaJW
FsowR/l9wXc=
-----END PRIVATE KEY-----


As I understand it, I have to do the following steps :

- computes the sha256 of the key ;
- computes the rmd160 of this hash ;
- add a byte at the begin for the version number (?) ;
- add four bytes at the end for the check sum ;
- encode the result in base58 ;


How can I do that with CMD and Editor? Is this the right way to get the correct bitcoin address?

Thanks for help.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!