Added database encryption #46

pull Gnonthgol wants to merge 1 commits into bitcoin:master from Gnonthgol:master changing 1 files +16 −1
  1. Gnonthgol commented at 5:15 PM on January 28, 2011: none

    Simple code to enable encryption of the database. Uses Berkeley DB built in AES encryption with a password from the new dbpassword option. 1FabZdhzEQJC7qJxb3k1RHVMf5gctB8qbh

  2. Adding database encryption 722bd74749
  3. tcatm commented at 5:26 PM on January 28, 2011: none

    I think encryption should be limited to wallet.dat, so one could have multiple wallets with different passwords. This patch seems to encrypt blkindex.dat and addr.dat, too.

    Also, a GUI prompt to enter the password would be useful.

  4. Gnonthgol commented at 6:05 PM on January 28, 2011: none

    It is not possible to selectively encrypt parts of the database environment with Berkeley DB. There is several possible solutions but the best long term is to encrypt everything and add a export/import wallet feature.

    The gui prompt was a good idea, remember to add a non-GUI prompt for running headless.

  5. gavinandresen commented at 8:03 PM on January 28, 2011: contributor

    From http://www.bitcoin.org/smf/index.php?topic=2698.msg36793#msg36793

    First, unless I'm reading the bdb docs wrong, you specify a password at database creation time. And then can't change it.

    So, at the very least, somebody would have to write code that (safely) rewrote wallet.dat when you set or unset or changed the password.

    Second, encrypting everything in wallet.dat means you'd have to enter your wallet password as soon as you started bitcoin (because user preference are stored in there right now), when ideally you should only enter the password as you're sending coins.

    And third, there are all sorts of usability issues with passwords. Users forget their passwords. They mis-type them. I wouldn't be terribly surprised if doing the simple thing and just encrypting the whole wallet with one password resulted in more lost bitcoins due to forgotten passwords than wallets stolen by trojans.

    I think creating a safe, useful wallet protection feature isn't easy, and there a lot of wrong ways to do it.

  6. gavinandresen commented at 8:09 PM on January 28, 2011: contributor

    Gnonthgol: if you're motivated to solve this right, please jump onto the forums and work out a good approach; I think this is a very important feature to get right.

  7. tcatm commented at 8:12 PM on January 28, 2011: none

    Also, database encryption can currently be accomplished using something like encfs or Truecrypt to encrypt the whole .bitcoin directory. That's probably a better workaround until we know how to get this right.

    Closed. Further discussion should happen on the forums as Gavin suggested.

  8. zathras-crypto referenced this in commit 6b32320224 on Jul 3, 2014
  9. rdponticelli referenced this in commit 6c2f5ad94b on Nov 26, 2014
  10. MarcoFalke referenced this in commit 8643071725 on Sep 3, 2015
  11. TheBlueMatt referenced this in commit 601116fd2d on Oct 20, 2015
  12. ptschip referenced this in commit 29acd18c0f on Jul 6, 2016
  13. CryptAxe referenced this in commit 446eedf921 on Nov 15, 2017
  14. classesjack referenced this in commit 26975d430b on Jan 2, 2018
  15. CryptAxe referenced this in commit b7172a21cc on Mar 11, 2018
  16. Warchant referenced this in commit 8c8c82ca5c on Dec 31, 2019
  17. velesnetwork referenced this in commit 1d836a32ff on Jan 12, 2020
  18. jonasschnelli referenced this in commit f2a673f15b on Dec 1, 2020
  19. rajarshimaitra referenced this in commit d2f6a8ee6a on Mar 23, 2021
  20. satindergrewal referenced this in commit 6003396a91 on Jun 22, 2021
  21. rajarshimaitra referenced this in commit 713694baaf on Aug 5, 2021
  22. DrahtBot locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-04-13 21:16 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me