Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cant create wallet #29

Closed
yhaenggi opened this issue Nov 30, 2012 · 3 comments
Closed

Cant create wallet #29

yhaenggi opened this issue Nov 30, 2012 · 3 comments

Comments

@yhaenggi
Copy link

When i try to create a wallet i get this (.armory/armorylog.txt):

2012-11-30 17:45 (INFO) -- qtdialogs.py:332 - KDF takes 60.00 seconds and 8589934592 bytes
2012-11-30 17:45 (INFO) -- armoryengine.py:6505 - ***Creating new deterministic wallet
2012-11-30 17:45 (INFO) -- armoryengine.py:6511 - (with encryption)
2012-11-30 17:45 (INFO) -- armoryengine.py:6513 - Target (time,RAM)=(60.000,8589934592)
2012-11-30 17:45 (ERROR) -- Traceback (most recent call last):
  File "/usr/share/armory/ArmoryQt.py", line 2110, in createNewWallet
    doRegisterWithBDM=False)
  File "/usr/share/armory/armoryengine.py", line 6515, in createNewWallet
    kdfTargSec, kdfMaxMem)
  File "/usr/share/armory/armoryengine.py", line 7082, in computeSystemSpecificKdfParams
    kdf.computeKdfParams(targetSec, long(maxMem))
  File "/usr/share/armory/CppBlockUtils.py", line 1611, in computeKdfParams
    def computeKdfParams(self, targetComputeSec=0.25, maxMemReqtsBytes=32*1024*1024): return _CppBlockUtils.KdfRomix_computeKdfParams(self, targetComputeSec, maxMemReqtsBytes)
NotImplementedError: Wrong number or type of arguments for overloaded function 'KdfRomix_computeKdfParams'.
  Possible C/C++ prototypes are:
    KdfRomix::computeKdfParams(double,uint32_t)
    KdfRomix::computeKdfParams(double)
    KdfRomix::computeKdfParams()
@etotheipi
Copy link
Owner

Hi K1773R,

It looks like to me that you overflowed the key-stretching function, by specifying 8 GB of RAM be used for converting your passphrase into an encryption key. The maximum value that can be accepted by the underlying C++ call is 4 GB. I probably should've anticipated that and done some extra error checking there...

Also, you might want to consider using a time value less than 60s... that's kind of extreme :) Even with the default 0.25s, if you tried to bruteforce a completely random 6-character password, it would take up to 900 years! As long as the resulting RAM usage is above 1-2 MB you are protected against GPU-acceleration (and probably even at smaller RAM values than that). Using 60s means that you will be waiting 30-60s every time you want to unlock your wallet, such as printing a backup, or sending a transaction.

Admittedly, you are the first person in 8 months that has overflowed that function. But I'll throw in a warning message for the next person that does it.

@yhaenggi
Copy link
Author

i already thougd its a u_int32 limiatation since i saw it in the logfile.
this should fix it:

--- armoryengine.py.orig    2012-11-30 18:38:57.560395895 +0100
+++ armoryengine.py 2012-11-30 18:46:35.020396086 +0100
@@ -6241,6 +6241,10 @@

       if withEncrypt and not securePassphrase:
          raise EncryptionError, 'Cannot create encrypted wallet without passphrase'
+         
+      if kdfMaxMem > 4194304000:
+         LOGINFO('ERROR: Max memory for KDF is 4GB!');
+         raise NotImplementedError, 'Max memory for KDF is 4GB, please specify a lower value!'

       LOGINFO('***Creating new deterministic wallet')

EDIT: had to change the patch since i didnt work with 4096MB (4GB), changed it to 4000MB and worked :)

@yhaenggi
Copy link
Author

closing -> old

TierNolan pushed a commit to TierNolan/BitcoinArmory that referenced this issue Nov 23, 2018
64037f8 Update JavaScript tests (Pieter Wuille)

Pull request description:

Tree-SHA512: ae9b8f1539d51eac45ea7df8a46d08de1c4764db259c6cf1492984da0723e2f996508e75efbaf2b3da5213b6e018b467b0810ff15b5b86e16856e24aaf83beea
TierNolan pushed a commit to TierNolan/BitcoinArmory that referenced this issue Nov 23, 2018
af2da22 Add new tests for invalid Bech32 strings (Clark Moody)

Pull request description:

  Similar updates in the vein of etotheipi#27, etotheipi#29, etotheipi#30, etotheipi#31, etotheipi#32

  Adds invalid Bech32 string test cases.

  Please note: Rust strings are UTF-8, so that the character literal `0xff` [turns into](https://codepoints.net/U+00FF) `0xc3bf` when accessed with the `bytes` function.

Tree-SHA512: 73f85762fc22059acb9c4b382068997fb0341354f1de26ecb2d75ba3c57aee80609fd2839967541c9a9f96ccdc04137140174396f5acfe62a6511fd9f18e703e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants