diff --git a/graphenebase/bip38.py b/graphenebase/bip38.py index dcbbcecf..a6e2a3a9 100644 --- a/graphenebase/bip38.py +++ b/graphenebase/bip38.py @@ -62,7 +62,7 @@ def encrypt(privkey, passphrase): else: raise ValueError("No scrypt module loaded") (derived_half1, derived_half2) = (key[:32], key[32:]) - aes = AES.new(derived_half2) + aes = AES.new(derived_half2, AES.MODE_ECB) encrypted_half1 = _encrypt_xor(privkeyhex[:32], derived_half1[:16], aes) encrypted_half2 = _encrypt_xor(privkeyhex[32:], derived_half1[16:], aes) " flag byte is forced 0xc0 because Graphene only uses compressed keys " @@ -102,7 +102,7 @@ def decrypt(encrypted_privkey, passphrase): derivedhalf2 = key[32:64] encryptedhalf1 = d[0:16] encryptedhalf2 = d[16:32] - aes = AES.new(derivedhalf2) + aes = AES.new(derivedhalf2, AES.MODE_ECB) decryptedhalf2 = aes.decrypt(encryptedhalf2) decryptedhalf1 = aes.decrypt(encryptedhalf1) privraw = decryptedhalf1 + decryptedhalf2 diff --git a/setup.py b/setup.py index 3bde66d5..f0157bb3 100755 --- a/setup.py +++ b/setup.py @@ -38,7 +38,7 @@ "requests", "websocket-client", "pylibscrypt", - "pycrypto", + "pycryptodome", ], classifiers=['License :: OSI Approved :: MIT License', 'Operating System :: OS Independent',