Bitcoin Forum
June 25, 2024, 01:06:13 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why do same passwords output different hashes?  (Read 102 times)
rastixxx (OP)
Newbie
*
Offline Offline

Activity: 5
Merit: 0


View Profile
March 21, 2021, 07:04:22 PM
 #1

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
khaled0111
Legendary
*
Offline Offline

Activity: 2562
Merit: 2902


Top Crypto Casino


View Profile WWW
March 21, 2021, 09:01:57 PM
Last edit: March 21, 2021, 09:23:26 PM by khaled0111
Merited by ABCbits (2), bitmover (1)
 #2

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).

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
bitmover
Legendary
*
Offline Offline

Activity: 2338
Merit: 6026


bitcoindata.science


View Profile WWW
March 21, 2021, 11:14:34 PM
 #3

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
NotATether
Legendary
*
Offline Offline

Activity: 1638
Merit: 6911


bitcoincleanup.com / bitmixlist.org


View Profile WWW
March 22, 2021, 05:06:26 PM
 #4

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.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!