halturin / applepay

a Python library for decrypting Apple Pay payment tokens.
MIT License
59 stars 15 forks source link

cryptography.exceptions.InvalidTag #2

Closed hitrain closed 7 years ago

hitrain commented 7 years ago

Traceback (most recent call last): File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 2411, in globals = debugger.run(setup['file'], None, None, is_module) File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1802, in run launch(file, globals, locals) # execute the script File "/Users/svoma/PycharmProjects/apple_pay/test.py", line 11, in decrypted_json = payment.decrypt(payment_json['header']['ephemeralPublicKey'], payment_json['data']) File "/Library/Python/2.7/site-packages/applepay/payment.py", line 78, in decrypt return decryptor.update(cipherdata[:-16])+decryptor.finalize() File "/Library/Python/2.7/site-packages/cryptography/hazmat/primitives/ciphers/base.py", line 174, in finalize data = self._ctx.finalize() File "/Library/Python/2.7/site-packages/cryptography/hazmat/backends/commoncrypto/ciphers.py", line 184, in finalize raise InvalidTag cryptography.exceptions.InvalidTag