Broken at line for both decrypt and encrypt: aes = AES.new(derivedhalf2) Adding the arg: AES.MODE_CBC allows the code to run but it fails with error below during decryption: 'Addresshash verification failed! Password is likely incorrect.'