ehn-sign-verify-python-trivial
ehn-sign-verify-python-trivial copied to clipboard
echo "{'A': 1234}" | python3 hc1_sign.py | python3 hc1_verify.py
Traceback (most recent call last):
File "/root/Desktop/ehn-sign-verify-python-trivial/hc1_sign.py", line 85, in <module>
payload = json.loads(payload.decode("utf-8"))
File "/usr/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/usr/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib/python3.9/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
Traceback (most recent call last):
File "/root/Desktop/ehn-sign-verify-python-trivial/hc1_verify.py", line 153, in <module>
if (cin[0] == 0x78):
IndexError: index out of range
Any idea whats wrong?
It may be a python version/lib thing - but more likely is something in the payload you are sending into hc1_sign.py.
Try with something as simple as:
echo '{ "foo": "bar" }' | ./hc1_sign.py
or pipe your JSON through 'jq' or a json linter.
i have the same error
@dirkx @barmosseri @Isacco00 try this cmd
echo '{ "foo": "bar" }' | python3 hc1_sign.py
@dirkx can you please either fix the readme or merge one of pending PRs which fix this issue? See #24 for example as the most recent one, also #3 was fixing this as well.
Done and apologies for the tardiness!