ehn-sign-verify-python-trivial icon indicating copy to clipboard operation
ehn-sign-verify-python-trivial copied to clipboard

IndexError: index out of range

Open olafmarcos opened this issue 3 years ago • 5 comments

Testing the utility i get the following traceback and error:

echo '{"A": 1234}' | python3 hc1_sign.py | python3 hc1_verify.py

Traceback (most recent call last): File "hc1_sign.py", line 149, in out = b'HC1:' + b45encode(out).encode('ascii') AttributeError: 'bytes' object has no attribute 'encode' Traceback (most recent call last): File "hc1_verify.py", line 153, in if (cin[0] == 0x78): IndexError: index out of range

python3 -V Python 3.7.3

olafmarcos avatar Aug 20 '21 08:08 olafmarcos

I got the same problem

bisinnoco avatar Sep 09 '21 05:09 bisinnoco

Try just out = b'HC1:' + b45encode(out)

senzacionale avatar Sep 15 '21 11:09 senzacionale

Same problem here. Is there any solution for this error?

out = b'HC1:' + b45encode(out) -> doesn't work for me.

I have another problem with:

Traceback (most recent call last): File "/Downloads/ehn-sign-verify-python-trivial/hc1_sign.py", line 149, in out = b'HC1:' + b45encode(out).encode('ascii') AttributeError: 'bytes' object has no attribute 'encode'

zeroninjahack avatar Sep 19 '21 20:09 zeroninjahack

Remove encode

senzacionale avatar Sep 20 '21 05:09 senzacionale

Remove encode

@senzacionale Thank you for answering but, where should I remove encode? I don't understand your answer.

zeroninjahack avatar Sep 25 '21 20:09 zeroninjahack