Enter passphrase, then Bitcoin Wallet Crashes. #955

issue Acadian opened this issue on March 19, 2012
  1. Acadian commented at 10:50 PM on March 19, 2012: none

    I encrypted my wallet a little while ago, but I forgot what password I used.

    I went through the list of my usual passwords, and was getting: "The password entered for the wallet decryption was incorrect. "

    When I enter a certain password that I use sometimes, Bitcoin Wallet will crash

    Screen Shot: http://imgur.com/Nz2SI

    I tried using that password to change passphrase and send bitcoins and it will cause Bitcoin Wallet to crash.

    I can try any other password I can think of and I get "passphrase entered for the wallet decryption was incorrect."

    debug.log is showing

    EXCEPTION: 9key_error
    CKey::SetSecret() : secret must be 32 bytes
    C:\Program Files\Bitcoin\bitcoin-qt.exe in Runaway exception

  2. Acadian commented at 10:57 PM on March 19, 2012: none

    I should also note that I tried moving this wallet to 2 other Windows computers and still the same thing.

    You guys have seen this issue before

    #711

    Also I tried Pywallet.py to dump the keys, but I'm getting "wrong password" on all the passwords tried

  3. sipa commented at 11:44 PM on March 19, 2012: member

    Which bitcoin version?

  4. Acadian commented at 12:23 AM on March 20, 2012: none

    was using 0.4.0, I updated to 0.5.3.1-beta and I'm still getting the crash.

  5. Diapolo commented at 5:24 PM on March 20, 2012: none

    What about 0.6 RC4, does this work? Are there any special characters in the password?

  6. Acadian commented at 5:28 PM on March 20, 2012: none

    Thanks for the quick replies everyone.

    I'll give 0.6 RC4 a go. There are no special characters in the password. The password is 7 alpha numeric characters, the first 5 characters are letters with the first letter being uppercase and the last two characters are just numbers.

  7. Acadian commented at 5:33 PM on March 20, 2012: none

    Same problem with 0.6 RC4

  8. Diapolo commented at 5:37 PM on March 20, 2012: none

    Too bad, is it the same error in the debug.log as before?

  9. Acadian commented at 6:02 PM on March 20, 2012: none

    Yes same error in debug.log,

  10. Acadian commented at 11:53 AM on March 21, 2012: none

    Can someone explain to me what's happening here?

    bool SetSecret(const CSecret& vchSecret, bool fCompressed = false) { EC_KEY_free(pkey); pkey = EC_KEY_new_by_curve_name(NID_secp256k1); if (pkey == NULL) throw key_error("CKey::SetSecret() : EC_KEY_new_by_curve_name failed"); if (vchSecret.size() != 32) throw key_error("CKey::SetSecret() : secret must be 32 bytes"); BIGNUM *bn = BN_bin2bn(&vchSecret[0],32,BN_new()); if (bn == NULL) throw key_error("CKey::SetSecret() : BN_bin2bn failed"); if (!EC_KEY_regenerate_key(pkey,bn)) { BN_clear_free(bn); throw key_error("CKey::SetSecret() : EC_KEY_regenerate_key failed"); } BN_clear_free(bn); fSet = true; if (fCompressed || fCompressedPubKey) SetCompressedPubKey(); return true; }

  11. sipa commented at 12:36 PM on March 21, 2012: member

    That function initializes the EC_KEY object embedded in a CKey to have a given (32-byte) secret (CSecret). In your case that function is called with an empty CSecret, which shouldn't happen.

  12. Acadian commented at 3:22 PM on March 21, 2012: none

    Is secret based on my password or a public key?

  13. Acadian commented at 1:26 AM on March 22, 2012: none

    I wish I understood this a bit more. Sorry for all the simple questions, but I'm really curious about how this class works and where the corruption happened.

    I used Fairdell HxCmp to do a byte comparison of 2 known good encrypted wallets and then I compared a good encrypted wallet to my bad encrypted wallet.

    Start at offset 4200, the bad wallet is all 00 00 00 the good wallet has data at this location. The 2 good wallets have data at this location as can be seen in Image #1 of the photo Album located below.

    Data starts to re-appear again at offset 6000. I'm not sure if any of this helps to make sense of this.

    The Photo Album can be found here. http://imgur.com/a/DhC8Z#0

  14. gavinandresen commented at 3:05 PM on March 26, 2012: contributor

    Consensus is this is a "we don't know how it happened but somehow the bits on your disk are not what they should be" problem that we can't reproduce.

    I moved the priority from high to medium, and removed the 0.6.0 milestone from this issue, but I think the only fix for problems like these will be a much better scheme for backing up and restoring wallets.

  15. gmaxwell closed this on Apr 5, 2012

  16. coblee referenced this in commit c6d44f8ef9 on Jul 17, 2012
  17. ptschip referenced this in commit 901b8db516 on Feb 13, 2018
  18. lateminer referenced this in commit 008b7938db on Oct 30, 2019
  19. lateminer referenced this in commit c04f442e4c on Nov 14, 2019
  20. MarcoFalke 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-17 09:16 UTC

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