ehn-dcc-development / ehn-sign-verify-python-trivial

Extremely minimal python implementation of the eHN-S protocol.
European Union Public License 1.2
76 stars 41 forks source link

IndexError: index out of range #13

Open olafmarcos opened 3 years ago

olafmarcos commented 3 years ago

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

bisinnoco commented 3 years ago

I got the same problem

senzacionale commented 3 years ago

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

zeroninjahack commented 3 years ago

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'

senzacionale commented 3 years ago

Remove encode

zeroninjahack commented 3 years ago

Remove encode

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