Bitcoin Forum

Economy => Service Discussion => Topic started by: walletrecoveryservices on December 09, 2013, 10:34:50 PM



Title: Blockchain.info encryption
Post by: walletrecoveryservices on December 09, 2013, 10:34:50 PM
Hi
I'm trying to understand/duplicate the second-level password encryption used at the blockchain.info site.

https://blockchain.info/wallet/wallet-format

Their site says that the dpasswordhash value is calculated as 10 rounds of SHA256 on the sharedKey plus the secondpassword.
   
var dpasswordhash = Crypto.SHA256(sharedKey + secondPassword);

However, when I try to duplicate this functionality, I get a different dpasswordhash value.

Has anyone got some pseudo-code that can show this working (and actually getting the correct dpasswordhash value)?
(I can't make much sense of the javascript available at their site)

I've tried various things, such as using command line openssl, as per
openssl dgst -sha256 -hex -out tempout.txt tempin.txt

or similar, but I can't get the right answer :(
grrrr
Thanks for any advice!


Title: Re: Blockchain.info encryption
Post by: flatfly on December 09, 2013, 10:46:10 PM
First, are you trying openssl on Windows or Linux? I've noticed that it does make a difference, in some cases.


Title: Re: Blockchain.info encryption
Post by: walletrecoveryservices on December 09, 2013, 11:09:04 PM
First, are you trying openssl on Windows or Linux? I've noticed that it does make a difference, in some cases.
I am trying it on windows.
But even using some online tools such as
http://www.convertstring.com/Hash/SHA256
(which agrees with my results of using openssl), I can't get it to agree with the information from blockchain.info

It might be related to padding or encodings to/from hex or base58..?