Bitcoin Forum
April 26, 2024, 01:04:21 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Creating a wallet on Linux and importing it on Android  (Read 1152 times)
mrb (OP)
Legendary
*
Offline Offline

Activity: 1512
Merit: 1027


View Profile WWW
October 02, 2016, 10:57:48 PM
 #1

I am using the following steps to create from scratch a wallet on a (secure, offline) Linux machine that can be later imported by Bitcoin Wallet's "restore wallet" feature:

  • Using bitcoinj's wallet-tool utility from the current github master branch: $ wallet-tool --wallet=wallet create
  • I want to know the first address where it can receive coins so: $ wallet-tool --wallet=wallet current-receive-addr
  • Encrypt it: $ openssl enc -e -aes-256-cbc -base64 <wallet >wallet.enc && rm wallet

I can think a few details that are important to get right:

  • Use a recent version of bitcoinj. Older ones produce wallets that are not BIP32-compliant deterministic wallets.
  • Make sure to use a strong password for encryption that is equivalent to at least approx. 80 bits of entropy, because "openssl enc" does not use iterated hashing to compute the key & IV. For example a random lowercase alphanumeric password should be at least 16-character long (eg. "9n0y27xhq3k2h7f8" is ~83 bits of entropy).

Are there any pitfalls to think of? Is it expected that all future versions of Bitcoin Wallet should be able to import wallet.enc?

By the way, Andreas: there seems to be an assumption in Crypto.java that iterative hashing is used when backing up the wallet, but this is false. The "openssl enc" format does not support iterative hashing.
"This isn't the kind of software where we can leave so many unresolved bugs that we need a tracker for them." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714093461
Hero Member
*
Offline Offline

Posts: 1714093461

View Profile Personal Message (Offline)

Ignore
1714093461
Reply with quote  #2

1714093461
Report to moderator
mrb (OP)
Legendary
*
Offline Offline

Activity: 1512
Merit: 1027


View Profile WWW
October 07, 2016, 12:30:48 AM
Last edit: October 07, 2016, 08:17:23 PM by mrb
 #2

Thanks. I can confirm the openssl developers have never added an iteration count to the "enc" format. I saw a patch floating around, but it never got committed.
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!