Bitcoin Forum
May 13, 2024, 02:13:47 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Incorrect IV length error in Electrum console  (Read 122 times)
iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 25, 2018, 08:39:34 PM
 #1

Hello, I can open my password-protected wallet locally via GUI without any problems, but when I try to access electrum password-protected functions on server using console I get this error:

Code:
Server-side exception: <Fault -32603: Server error: File "/usr/local/lib/python3.5/dist-packages/electrum/crypto.py", line 118, in pw_decode | electrum.util.InvalidPassword: Incorrect password
>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/electrum/crypto.py", line 116, in pw_decode
    d = to_string(DecodeAES(secret, s), "utf8")
  File "/usr/local/lib/python3.5/dist-packages/electrum/crypto.py", line 102, in DecodeAES
    s = aes_decrypt_with_iv(secret, iv, e)
  File "/usr/local/lib/python3.5/dist-packages/electrum/crypto.py", line 80, in aes_decrypt_with_iv
    cipher = AES.new(key, AES.MODE_CBC, iv)
  File "/usr/local/lib/python3.5/dist-packages/Cryptodome/Cipher/AES.py", line 225, in new
    return _create_cipher(sys.modules[__name__], key, mode, *args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Cryptodome/Cipher/__init__.py", line 79, in _create_cipher
    return modes[mode](factory, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/Cryptodome/Cipher/_mode_cbc.py", line 287, in _create_cbc_cipher
    factory.block_size)
ValueError: Incorrect IV length (it must be 16 bytes long)

During handling of the above exception, another exception occurred:
Code:
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/jsonrpclib/SimpleJSONRPCServer.py", line 376, in _dispatch
    return func(*params)
  File "/usr/local/lib/python3.5/dist-packages/electrum/daemon.py", line 287, in run_cmdline
    result = func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/electrum/commands.py", line 87, in func_wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/electrum/commands.py", line 360, in getseed
    s = self.wallet.get_seed(password)
  File "/usr/local/lib/python3.5/dist-packages/electrum/wallet.py", line 1375, in get_seed
    return self.keystore.get_seed(password)
  File "/usr/local/lib/python3.5/dist-packages/electrum/keystore.py", line 217, in get_seed
    return pw_decode(self.seed, password)
  File "/usr/local/lib/python3.5/dist-packages/electrum/crypto.py", line 118, in pw_decode
    raise InvalidPassword()
electrum.util.InvalidPassword: Incorrect password
Traceback (most recent call last):
  File "/usr/local/bin/electrum", line 465, in <module>
    result = server.run_cmdline(config_options)
  File "/usr/local/lib/python3.5/dist-packages/jsonrpclib/jsonrpc.py", line 650, in __call__
    return self.__send(self.__name, args)
  File "/usr/local/lib/python3.5/dist-packages/jsonrpclib/jsonrpc.py", line 532, in _request
    check_for_errors(response)
  File "/usr/local/lib/python3.5/dist-packages/jsonrpclib/jsonrpc.py", line 1220, in check_for_errors
    raise ProtocolError((code, message))
jsonrpclib.jsonrpc.ProtocolError: (-32603, 'Server error: File "/usr/local/lib/python3.5/dist-packages/electrum/crypto.py", line 118, in pw_decode | electrum.util.InvalidPassword: Incorrect password\n')

How to fix it?
1715566427
Hero Member
*
Offline Offline

Posts: 1715566427

View Profile Personal Message (Offline)

Ignore
1715566427
Reply with quote  #2

1715566427
Report to moderator
1715566427
Hero Member
*
Offline Offline

Posts: 1715566427

View Profile Personal Message (Offline)

Ignore
1715566427
Reply with quote  #2

1715566427
Report to moderator
1715566427
Hero Member
*
Offline Offline

Posts: 1715566427

View Profile Personal Message (Offline)

Ignore
1715566427
Reply with quote  #2

1715566427
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715566427
Hero Member
*
Offline Offline

Posts: 1715566427

View Profile Personal Message (Offline)

Ignore
1715566427
Reply with quote  #2

1715566427
Report to moderator
1715566427
Hero Member
*
Offline Offline

Posts: 1715566427

View Profile Personal Message (Offline)

Ignore
1715566427
Reply with quote  #2

1715566427
Report to moderator
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
November 25, 2018, 08:50:47 PM
 #2

What command are you trying to run that gives this error, can you isolate it or is it in a script somewhere?
iron888 (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 0


View Profile
November 25, 2018, 08:58:21 PM
 #3

What command are you trying to run that gives this error, can you isolate it or is it in a script somewhere?
For example when calling
Code:
electrum getseed
jackg
Copper Member
Legendary
*
Offline Offline

Activity: 2856
Merit: 3071


https://bit.ly/387FXHi lightning theory


View Profile
November 25, 2018, 09:01:25 PM
 #4

There is a stackoverflow thread with the solution here, have you tried this? https://stackoverflow.com/questions/42485408/getting-error-of-invalid-iv-length-while-using-aes-256-cbc-for-encryption-in-nod


That’s not directly electrum but it looks like it’s with the aes encryption in general, but I could be completely wrong.

Add code to work out how big the actual inputted password is otherwise and return the results here (in bytes).
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!