Bitcoin Forum
May 26, 2024, 04:01:26 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: encrypt/decrypt wallet  (Read 1960 times)
jonas.schnelli (OP)
Member
**
Offline Offline

Activity: 66
Merit: 10

bitcoin core contributor


View Profile WWW
October 08, 2013, 02:59:20 PM
 #1

Hi

I'd like to understand the bitcoinj wallet encryption.

When i have a enrcypted wallet (enc with Wallet.encrypt()), when is the time to decyrpt/reencrypt the wallet?
Do i have to wallet.decrypt before sending/signing the coins?
Do i have to re-encrypt the wallet after decrypt/sign?

I did not play around with is yet (theory questions).
 

Thanks
--
</jonas>
Mike Hearn
Moderator
Legendary
*
Offline Offline

Activity: 1526
Merit: 1129


View Profile
October 08, 2013, 04:49:02 PM
 #2

We need a documentation article on this feature.

You encrypt a wallet once. At that point, when creating spends, you can set SendRequest.aesKey and it will be used to decrypt keys as it signs.

Deriving an AES key from a users password is meant to be slow/intensive. So, the wallet takes the key directly and not the password (in case you wish to use it multiple times, cache it for a while, etc).  You can get the KeyParameter (which holds the key object) by using wallet.getKeyCrypter().derivePassword("password").
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!