Author

Topic: Why do same passwords output different hashes? (Read 102 times)

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
Its because Bitcoin Core also uses a random 8-byte salt as well as the passphrase to encrypt the wallet.

Because the salt is completely random, changing the password to the same thing will cause a new salt to be generated for encrypting the keys.
legendary
Activity: 2212
Merit: 5622
Non-custodial BTC Wallet
Both of the wallets below have the same passwords
Both same wallet, I 'pass' the password to the wallet, got a hash
then i changed the password and reverted to the old password and got a hash
but why are the mixes different from each other?

Any difference made in the hash input will make a completely different hash output
take a look here:

https://emn178.github.io/online-tools/sha256.html

You can play around there. Anything you type will create a different hash.
legendary
Activity: 2520
Merit: 2853
Top Crypto Casino
Every time you change the passphrase you will get a different hash even if you re-use the same passphrase.
This is because of how bitcoin core encrypts the wallet file (it actually encrypts the sensitive data like private keys). You can read more about it here:
https://github.com/bitcoin/bitcoin/blob/6b8a5ab622e5c9386c872036646bf94da983b190/doc/README

I believe the bolded parts on the quote below may answer your question:
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).
newbie
Activity: 5
Merit: 0
Both of the wallets below have the same passwords
Both same wallet, I 'pass' the password to the wallet, got a hash
then i changed the password and reverted to the old password and got a hash
but why are the mixes different from each other?

all the same wallet
$bitcoin$64$42843248320b4cf83803a131276d4ee7f32a0c035194010a3dcb6f0147b6ab70$16$7100a2e7a3bd647d$143789$2$00$2$00=pass
$bitcoin$64$d3ee9879e6e960b32b6ec29c68263a65ce52c9e961cce33cdd89458af9d763cd$16$7100a2e7a3bd647d$134165$2$00$2$00=pass

$bitcoin$64$efecc7df59db20bf14e7ee7a7adf23e347bad739443a4fd051625c4062f9023a$16$7100a2e7a3bd647d$111555$2$00$2$00=12345
Jump to: