<p>Is there any standalone software modules created which allow the user to complete the following:
     1. Enter in passphrase
     2. Enter a given salt
     3. Enter the number of rounds</p>

<p>I am looking for this in order to find the value, and locate the memory location in either Bitcoin src code or Wallet.dat file database. I have found the master key, iv, salt and rounds in wallet.dat file already. Thanks for all the help and I will pass tips to those who point me in the right direction. Thanks again.</p>

CC BY-SA 4.0
2019-09-04T22:17:46.753Z
What are you trying to do? This sounds like you have some issue for which you think that such a software is the solution. What is the problem that you are actually trying to fix?
Ava Chow
CC BY-SA 4.0
2019-09-05T01:01:39.037Z
I am tracing source code with my passphrase to understand how Bitcoin Core works exactly as far as Encrypt/Decrypt of passphrase. The function EVP_ByteToToken, I do not follow exactly, thus the request.
kmart875
CC BY-SA 4.0
2019-09-05T02:54:19.047Z
Bitcoin Core no longer uses OpenSSL in wallet encryption (or in the vast majority of the software). Whatever OpenSSL functions that were used have been reimplemented in Core to be backwards compatible. It is probably easier for you to read the source code for up-to-date Bitcoin Core rather than older versions that still use OpenSSL.
Ava Chow
CC BY-SA 4.0
2019-09-05T03:28:34.013Z
Thanks. I am using the source code from https://github.com/bitcoin/bitcoin.
kmart875
CC BY-SA 4.0
2019-09-05T03:28:43.577Z
allet 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).
kmart875
CC BY-SA 4.0
2019-09-05T04:32:16.067Z
Where do you see that information? `EVP_BytesToKey` appears in only one place and it is in a different comment about the function that replaced it. Wherever you are reading that is out of date and you should read the code itself.
Ava Chow
CC BY-SA 4.0
2019-09-05T04:51:56.190Z
bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod,
kmart875
CC BY-SA 4.0
2019-09-05T04:53:25.783Z
Crypter.cpp, when i=0 which is does on encryption and decryption, the if loop occurs as follows:  if (nDerivationMethod == 0)
        i = BytesToKeySHA512AES(chSalt, strKeyData, nRounds, vchKey.data(), vchIV.data());
kmart875
<bitcoin-core><hash><passphrase>
Bitcoin Module - Hash512-EVP_ByteToToken
kmart875
# Bitcoin Module - Hash512-EVP_ByteToToken

(Asked by: username_0 on 2019-09-04)

Is there any standalone software modules created which allow the user to complete the following:
1. Enter in passphrase
2. Enter a given salt
3. Enter the number of rounds

I am looking for this in order to find the value, and locate the memory location in either Bitcoin src code or Wallet.dat file database. I have found the master key, iv, salt and rounds in wallet.dat file already. Thanks for all the help and I will pass tips to those who point me in the right direction. Thanks again.

**Tags:** bitcoin-core, hash, passphrase

> **Comments:**
> **username_1**: What are you trying to do? This sounds like you have some issue for which you think that such a software is the solution. What is the problem that you are actually trying to fix?  
> **username_0**: I am tracing source code with my passphrase to understand how Bitcoin Core works exactly as far as Encrypt/Decrypt of passphrase. The function EVP_ByteToToken, I do not follow exactly, thus the request.  
> **username_1**: Bitcoin Core no longer uses OpenSSL in wallet encryption (or in the vast majority of the software). Whatever OpenSSL functions that were used have been reimplemented in Core to be backwards compatible. It is probably easier for you to read the source code for up-to-date Bitcoin Core rather than older versions that still use OpenSSL.  
> **username_0**: Thanks. I am using the source code from https://github.com/bitcoin/bitcoin.  
> **username_0**: allet 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).  
> **username_1**: Where do you see that information? `EVP_BytesToKey` appears in only one place and it is in a different comment about the function that replaced it. Wherever you are reading that is out of date and you should read the code itself.  
> **username_0**: bool CCrypter::SetKeyFromPassphrase(const SecureString& strKeyData, const std::vector<unsigned char>& chSalt, const unsigned int nRounds, const unsigned int nDerivationMethod,  
> **username_0**: Crypter.cpp, when i=0 which is does on encryption and decryption, the if loop occurs as follows:  if (nDerivationMethod == 0)         i = BytesToKeySHA512AES(chSalt, strKeyData, nRounds, vchKey.data(), vchIV.data());  

---

## 0 answers

