Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: Abiky on January 20, 2017, 09:36:54 PM



Title: How do I find a private key in encrypted form in Bitcoin Core?
Post by: Abiky on January 20, 2017, 09:36:54 PM
I know that it is possible to create encrypted paper wallets on a paper generator like Bitaddress.org and obtain the private key in encrypted form on there.

However, when it comes to getting an encrypted private key from my Bitcoin Core wallet, it only appears as a normal private key which can only be obtained by unlocking the wallet with your passphrase.

I only want to extract the encrypted private key (BIP 38) from Bitcoin Core, instead of the normal one. How do I do that?

Any help would be greatly appreciated.  ;)


Title: Re: How do I find a private key in encrypted form in Bitcoin Core?
Post by: LoyceV on January 20, 2017, 09:40:00 PM
You can't. Bitcoin Core doesn't use BIP 38 encryption, it encrypts the wallet (see here (https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README) for details, although you don't need this to answer your question).

What you can do, is BIP-38 encrypt that unencrypted private key. You can do this using bitaddress.org (https://www.bitaddress.org) (download and use offline).
But if you take the address from Bitcoin Core, you are using a hot address to create an encrypted backup, which normally defeats the purpose of encrypting it. If your PC would get compromised, it's still not safe as long as Bitcoin Core has the same private key.


Title: Re: How do I find a private key in encrypted form in Bitcoin Core?
Post by: shorena on January 20, 2017, 09:40:13 PM
Export the private key and encrypt it using BIP 38. This is not a build-in feature of bitcoin core. It uses AES.


Title: Re: How do I find a private key in encrypted form in Bitcoin Core?
Post by: Abiky on January 20, 2017, 09:56:05 PM
You can't. Bitcoin Core doesn't use BIP 38 encryption, it encrypts the wallet (see here (https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README) for details, although you don't need this to answer your question).

What you can do, is BIP-38 encrypt that unencrypted private key. You can do this using bitaddress.org (https://www.bitaddress.org) (download and use offline).
But if you take the address from Bitcoin Core, you are using a hot address to create an encrypted backup, which normally defeats the purpose of encrypting it. If your PC would get compromised, it's still not safe as long as Bitcoin Core has the same private key.

Export the private key and encrypt it using BIP 38. This is not a build-in feature of bitcoin core. It uses AES.

Thanks guys. I thought that it was straightforward to do it within Bitcoin Core, but still with this solution I will be able to encrypt it with BIP 38. Just wanted to know about this since I wanted to design my very own paper wallet based from a Bitcoin Core wallet.

By the way, do you think that implementing the wallet details within an NFC tag would be safe? Since the private key would be encrypted there should be no issue, right? Just asking this because I'm going to try a little experiment of redeeming my BTC from within an NFC tag.

Nevertheless, I appreciate your time and effort guys helping me with this. I always learn new stuff here at BCT everyday.  :)


Title: Re: How do I find a private key in encrypted form in Bitcoin Core?
Post by: ranochigo on January 21, 2017, 12:28:54 AM
Thanks guys. I thought that it was straightforward to do it within Bitcoin Core, but still with this solution I will be able to encrypt it with BIP 38. Just wanted to know about this since I wanted to design my very own paper wallet based from a Bitcoin Core wallet.

By the way, do you think that implementing the wallet details within an NFC tag would be safe? Since the private key would be encrypted there should be no issue, right? Just asking this because I'm going to try a little experiment of redeeming my BTC from within an NFC tag.

Nevertheless, I appreciate your time and effort guys helping me with this. I always learn new stuff here at BCT everyday.  :)
Yes, the NFC tag can relay information to the reader. BIP38 is by right, fairly hard to bruteforce if you have a long enough password.

How are you going to decrypt and spend the coins though? That is a small problem.