<p><strong>Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something?</strong></p>

<p>According to <a href="https://en.bitcoin.it/wiki/Wallet_encryption" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Wallet_encryption</a></p>

<blockquote>
  <p><strong>This page describes the algorithm used for encrypting the wallet.dat file used in the original Bitcoin client.</strong> </p>
  
  <p>Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA-512 and OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change)</p>
</blockquote>

<hr>

<p>According to <a href="https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README</a></p>

<blockquote>
  <p>Bitcoin 0.4.1 BETA</p>
  
  <h2>Technical details of wallet encryption</h2>
  
  <p>Wallet encryption uses AES-256-CBC to encrypt only the private keys
  that are held in a wallet.  The keys are encrypted with a master key
  which is entirely random.  This master key is then encrypted with
  AES-256-CBC with a key derived from the passphrase using SHA512 and
  OpenSSL's EVP_BytesToKey and a dynamic number of rounds determined by
  the speed of the machine which does the initial encryption (and is
  updated based on the speed of a computer which does a subsequent
  passphrase change).  </p>
</blockquote>

<hr>

<p>The current version's C++ code at <a href="https://github.com/bitcoin/bitcoin/blob/master/src/wallet/crypter.cpp" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/src/wallet/crypter.cpp</a> mentions the same algorithms but I haven't tried to work out if the encryption is in fact identical to the early versions or if this is even the relevant source file (though it's name and location suggests so).</p>

<hr>

<p>It seems likely the encryption method is compatible between current and older versions.</p>

<p>I would hope that any competent software developer, when changing the encryption method, would implement a wallet version number or other indicator that would allow new software to detect older wallet.dat files and either upgrade them silently or provide an appropriate message to the user.</p>

<p>I may be wrong though.</p>

CC BY-SA 4.0
2021-04-16T15:43:39.487Z
The encryption algorithm has never been changed (as of april 2021). Wallet files created by older versions should be compatible with all new releases afterwards.
Pieter Wuille
CC BY-SA 4.0
2018-08-17T15:19:46.357Z
2018-08-17T15:34:58.467Z
2018-08-17T15:34:58.467Z
RedGrittyBrick
<p>First of all .. yes im stupid.
Now .. I had some BTC a few years ago. Thought I had kept it safe, now I seem to have reinstalled the OS on that PC and wiped profile folder. I looked around for a wallet.dat file and found one, but it could also be a file of another crypto currency .. not sure, it's so long ago I'm not sure what I did anymore but the date on the file seems on the old side (december 2013).
I installed Bitcoin Core (I used what existed before CORE came out .. just bitcoin afaik ?), I let it sync for a day and am now caught up.
I replaced the wallet.dat file and started the client again. First it took a few minutes rescanning, then crashed at 100% (???). I restarted client again, now it said it had to update the blockchain a bit more, it was at 99.9% and quickly finished.
Now it shows my wallet is empty, but it also tells me it is encrypted and locked. I tried unlocking from the debug console, but it tells me the pw is incorrect. This is weird because the only thing I'm sure of is that this is the correct password.
Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something ?
Even without unlocking should I be able to see the balance at least ?
I know its also possible to have the private key saved somewhere (thats what I should have done, but what I have saved looks short to me, I assume its the password.)
Looking at the balance of 0 BTC i have a feeling this jsut means I'm screwed. I only have myself to blame. I'm still going to attempt to find another backup file, or attempt to restore deleted files from that disk, maybe there's still something there.</p>

CC BY-SA 3.0
2017-05-27T09:19:22.403Z
Maybe you should try again with the final version of bitcoin-qt... bitcoin-0.8.6-win32-setup.exe. It is available at compzets.com and has the right sha256
Mark Ch
CC BY-SA 4.0
2021-04-16T22:49:38.517Z
Even without the password you'd still be able to see a transaction history. So likely this wallet.dat is for an altcoin if you're sure you had activity on it
hydrabeast
<wallet><wallet.dat><wallet-recovery>
Problems restoring wallet
Dudeski
# Problems restoring wallet

(Asked by: username_0 on 2017-05-27)

First of all .. yes im stupid.
Now .. I had some BTC a few years ago. Thought I had kept it safe, now I seem to have reinstalled the OS on that PC and wiped profile folder. I looked around for a wallet.dat file and found one, but it could also be a file of another crypto currency .. not sure, it's so long ago I'm not sure what I did anymore but the date on the file seems on the old side (december 2013).
I installed Bitcoin Core (I used what existed before CORE came out .. just bitcoin afaik ?), I let it sync for a day and am now caught up.
I replaced the wallet.dat file and started the client again. First it took a few minutes rescanning, then crashed at 100% (???). I restarted client again, now it said it had to update the blockchain a bit more, it was at 99.9% and quickly finished.
Now it shows my wallet is empty, but it also tells me it is encrypted and locked. I tried unlocking from the debug console, but it tells me the pw is incorrect. This is weird because the only thing I'm sure of is that this is the correct password.
Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something ?
Even without unlocking should I be able to see the balance at least ?
I know its also possible to have the private key saved somewhere (thats what I should have done, but what I have saved looks short to me, I assume its the password.)
Looking at the balance of 0 BTC i have a feeling this jsut means I'm screwed. I only have myself to blame. I'm still going to attempt to find another backup file, or attempt to restore deleted files from that disk, maybe there's still something there.

**Tags:** wallet, wallet.dat, wallet-recovery

> **Comments:**
> **username_1**: Maybe you should try again with the final version of bitcoin-qt... bitcoin-0.8.6-win32-setup.exe. It is available at compzets.com and has the right sha256  
> **username_2**: Even without the password you'd still be able to see a transaction history. So likely this wallet.dat is for an altcoin if you're sure you had activity on it  

---

## 1 answers

### Answer by username_3 on 2018-08-17. Score: 0

**Is it possible the encryption type has changed through the years and I need to somehow upgrade my wallet.dat or something?**

According to <https://en.bitcoin.it/wiki/Wallet_encryption>

> **This page describes the algorithm used for encrypting the wallet.dat file used in the original Bitcoin client.**
>
> Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA-512 and OpenSSL's EVP\_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change)

---

According to <https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README>

> Bitcoin 0.4.1 BETA
>
> ## Technical details of wallet encryption
>
> Wallet encryption uses AES-256-CBC to encrypt only the private keys
> that are held in a wallet. The keys are encrypted with a master key
> which is entirely random. This master key is then encrypted with
> AES-256-CBC with a key derived from the passphrase using SHA512 and
> OpenSSL's EVP\_BytesToKey and a dynamic number of rounds determined by
> the speed of the machine which does the initial encryption (and is
> updated based on the speed of a computer which does a subsequent
> passphrase change).

---

The current version's C++ code at <https://github.com/bitcoin/bitcoin/blob/master/src/wallet/crypter.cpp> mentions the same algorithms but I haven't tried to work out if the encryption is in fact identical to the early versions or if this is even the relevant source file (though it's name and location suggests so).

---

It seems likely the encryption method is compatible between current and older versions.

I would hope that any competent software developer, when changing the encryption method, would implement a wallet version number or other indicator that would allow new software to detect older wallet.dat files and either upgrade them silently or provide an appropriate message to the user.

I may be wrong though.

> **Comments:**
> **username_4**: The encryption algorithm has never been changed (as of april 2021). Wallet files created by older versions should be compatible with all new releases afterwards.  

---

