ticarpi / jwt_tool

:snake: A toolkit for testing, tweaking and cracking JSON Web Tokens
GNU General Public License v3.0
5.47k stars 671 forks source link

Bug on jwt_tool.py cause of "AttributeError: 'RsaKey' object has no attribute 'export_key'" exception #32

Closed akabe1 closed 3 years ago

akabe1 commented 3 years ago

I would notify that there is a bug on the script jwt_tool.py at line 704 which cause the following exception when running a jwt scan:

AttributeError: 'RsaKey' object has no attribute 'export_key'

To fix it is necessary to substitute the affected line 704 containing: privKey = key.export_key(format="PEM")

with the following: privKey = key.exportKey(format="PEM")

ticarpi commented 3 years ago

It sounds like you're using pyCrypto rather than pyCryptodome, as these have the different syntax you mention in their Crypto.PublicKey.RSA packages. Try the following command to install the dependencies: python3 -m pip install pycryptodomex