BitShares Forum

Other => Graveyard => DevShares => Topic started by: dorant on February 12, 2015, 01:40:10 pm

Title: A question about BitShares private key encryption
Post by: dorant on February 12, 2015, 01:40:10 pm
I've been trying to decrypt a private key using the passphrase for some time now, but I've run into some problems. After reading the source code, I thought that the encryption is done using BIP38, but the key size isn't correct, so I'm assuming either another algorithm was used or maybe there were some added characters.

Does anyone know exactly which algorithm BitShares uses to encrypt private keys, and can you show me the full steps?

Thanks
Title: Re: A question about BitShares private key encryption
Post by: xeroc on February 12, 2015, 02:58:44 pm
Afaik the key is AES encrypted .. i am sure you can find some easy to read code in the javascript implementation at https://github.com/bitshares/bitshares-js .. good luck
Title: Re: A question about BitShares private key encryption
Post by: bitmeat on February 12, 2015, 04:49:08 pm
I've been trying to decrypt a private key using the passphrase for some time now, but I've run into some problems. After reading the source code, I thought that the encryption is done using BIP38, but the key size isn't correct, so I'm assuming either another algorithm was used or maybe there were some added characters.

Does anyone know exactly which algorithm BitShares uses to encrypt private keys, and can you show me the full steps?

Thanks

I don't think you can extrapolate the key from the passphrase itself. I think the key is stored in the wallet file, but encrypted with the passphrase.

I really wish we had a deterministic wallet. This is sure to get people burned, thinking the pass is all they need to remember.
Title: Re: A question about BitShares private key encryption
Post by: arhag on February 14, 2015, 04:46:51 pm
I really wish we had a deterministic wallet. This is sure to get people burned, thinking the pass is all they need to remember.

You can if you manually specify the brain key when creating the wallet. It is an advanced feature for good reason IMO. If we had all the keys deterministically derived only from the wallet passphrase, then we would have other people get burned (as in have all of their funds stolen) because they selected a weak password.
Title: Re: A question about BitShares private key encryption
Post by: xeroc on February 14, 2015, 05:12:22 pm
I really wish we had a deterministic wallet. This is sure to get people burned, thinking the pass is all they need to remember.

You can if you manually specify the brain key when creating the wallet. It is an advanced feature for good reason IMO. If we had all the keys deterministically derived only from the wallet passphrase, then we would have other people get burned (as in have all of their funds stolen) because they selected a weak password.
Totally agree with arhag .. people nees to be educated to make backups and store them securely and redundant