Author Topic: How to restore backup from .bin file programmatically  (Read 3553 times)

0 Members and 1 Guest are viewing this topic.

Offline svk

yup I know that, but the problem is I am getting encrypted brainkey with an encryption key but i dont know what type of encryption is that. :(

DO you know anyone in this forum who can guide me about it? who knows how gui wallet works?

@jcalfee1 is the one who wrote the code for it, I haven't looked too much at this part myself.

Found this though:

Code: [Select]
var brainkey_plaintext = aes_private.decryptHexToText( wallet.encrypted_brainkey )
aes_private is an instance of Aes, the method decryptHexToText can be found here:

https://github.com/svk31/graphenejs-lib/blob/master/lib/ecc/src/aes.js#L228
« Last Edit: June 27, 2016, 12:03:27 pm by svk »
Worker: dev.bitsharesblocks

Offline madforstrength

yup I know that, but the problem is I am getting encrypted brainkey with an encryption key but i dont know what type of encryption is that. :(

DO you know anyone in this forum who can guide me about it? who knows how gui wallet works?

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Hi @xeroc can you tell me how can i decrypt encrypted private keys?

Also I got encrypted brain key alongwith its encryption key, would appreciate if you can tell me to decrypt brainkey as well.

Thanks
I don't know many details about how the GUI encrypts the wallet.
But once you have a brain key (12 english words) you can use the BrainKey object in graphenebase.account (https://github.com/xeroc/python-graphenelib/blob/master/graphenebase/account.py#L47-L65) to get the private key(s)

Offline madforstrength

Hi @xeroc can you tell me how can i decrypt encrypted private keys?

Also I got encrypted brain key alongwith its encryption key, would appreciate if you can tell me to decrypt brainkey as well.

Thanks

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Yes @xeroc I have been trying to reverse engineer its
Code: [Select]
decryptWalletBackup method.
Can you tell me python/graphene equivalent of this method ?
Code: [Select]
PublicKey.fromBuffer

Erm .. it would probably be something like this

from graphenebase.account import PublicKey
frim binascii import unhexlify
b = rawPublicKey
pubKey = PublicKey(unhexlify(b))

Offline madforstrength

Yes @xeroc I have been trying to reverse engineer its
Code: [Select]
decryptWalletBackup method.
Can you tell me python/graphene equivalent of this method ?
Code: [Select]
PublicKey.fromBuffer

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc

Offline madforstrength

@xeroc , This is the backup file that we export from webwallet, it is importing fine in other webwallet as well as desktop wallet.

What I am trying to do is adding "import from backup .bin file" functionality in my application. So I was wondering if you or someone can tell me how this file is decoded to get wallet json keys.

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
@xeroc Hi again,

Can you tell me if python-graphenelib has any method to import backup from bin file?
Nop. Don't even know what format that is.

Quote
Or any other way I can import backup from bin file in my wallet?
Where did you get that file? Does it not load in the Web wallet?

Offline madforstrength

@xeroc Hi again,

Can you tell me if python-graphenelib has any method to import backup from bin file?

Or any other way I can import backup from bin file in my wallet?

Thanks and Regards