<p>At present, I have dumped my wallet and have all private key, address information. I am now wanting to understand the decryption process for the private keys within the wallet. I have completed the following so far as stated in the comments - bitcoin source code (crytper.h/.cpp)</p>

<pre><code>Wallet Private Keys are then encrypted using AES-256-CBC
</code></pre>

<p>* with the double-sha256 of the public key as the IV, and the
 * master key's key as the encryption key</p>

<p>So, my data looks this way:
    E Private Key (96)
    IV Public Key (8)
    U Master Key  (16)
I am using <a href="https://www.devglan.com/online-tools/aes-encryption-decryption" rel="nofollow noreferrer">https://www.devglan.com/online-tools/aes-encryption-decryption</a> for the decryption. When I use this site, my answer is not the private key which I know but rather data that is 32 bits longer than the encrypted key. Has anyone tried to figure the path for the keys? If so, what am I doing wrong? Thanks for all your help.         </p>

CC BY-SA 4.0
2019-10-02T23:31:43.730Z
If you ran `dumpwallet` or `dumpprivkey`, the keys are already decrypted and are in Wallet Import Format, a base58 encoding of the 256-bit keys. You can import them directly into another wallet.
Raghav Sood
CC BY-SA 4.0
2019-10-03T02:09:24.853Z
Thanks. This is not what we are trying to accomplish. We are checking the comments in the source code to verify this is the case as stated above.
kmart875
<bitcoin-core><private-key><wallet.dat><encryption>
Bitcoin Private Key Decryption
kmart875
# Bitcoin Private Key Decryption

(Asked by: username_0 on 2019-10-02)

At present, I have dumped my wallet and have all private key, address information. I am now wanting to understand the decryption process for the private keys within the wallet. I have completed the following so far as stated in the comments - bitcoin source code (crytper.h/.cpp)

```
Wallet Private Keys are then encrypted using AES-256-CBC

```

\* with the double-sha256 of the public key as the IV, and the
\* master key's key as the encryption key

So, my data looks this way:
E Private Key (96)
IV Public Key (8)
U Master Key (16)
I am using <https://www.devglan.com/online-tools/aes-encryption-decryption> for the decryption. When I use this site, my answer is not the private key which I know but rather data that is 32 bits longer than the encrypted key. Has anyone tried to figure the path for the keys? If so, what am I doing wrong? Thanks for all your help.

**Tags:** bitcoin-core, private-key, wallet.dat, encryption

> **Comments:**
> **username_1**: If you ran `dumpwallet` or `dumpprivkey`, the keys are already decrypted and are in Wallet Import Format, a base58 encoding of the 256-bit keys. You can import them directly into another wallet.  
> **username_0**: Thanks. This is not what we are trying to accomplish. We are checking the comments in the source code to verify this is the case as stated above.  

---

## 0 answers

