New submission from Dodain <moizimti...@gmail.com>:
The signature (SHA256 of HMAC Digest) calculated using hmac library doesn't match the signature calculated using jwt library. The singature calculated using JWT is the right signature. The signature with JWT library is VXG8L0SEY3wo5hdAznbvxWXDbhNtuOd7PaZOhzZn_HQ Whereas the signature with hmac library is SHR3SSe+8+X8eBw/H+CUc6f5KyXmuONfprdttjeQrwQ= Since only one file can bu attached so I am inlining the code for finding jwt signature with jwt library. The code for HMAC library is attached. import jwt public = "1234" print (public) print jwt.encode({"login":"admin"}, key=public, algorithm='HS256') ---------- components: Library (Lib) files: sign_with_hmac_library.py messages: 348119 nosy: dodain priority: normal severity: normal status: open title: Signature of SHA256 HMAC digest not matching with the signature of jwt library type: behavior versions: Python 2.7 Added file: https://bugs.python.org/file48489/sign_with_hmac_library.py _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue37622> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com