Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexError: index out of range #13

Open
olafmarcos opened this issue Aug 20, 2021 · 5 comments
Open

IndexError: index out of range #13

olafmarcos opened this issue Aug 20, 2021 · 5 comments

Comments

@olafmarcos
Copy link

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
Copy link

I got the same problem

@senzacionale
Copy link

senzacionale commented Sep 15, 2021

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

@zeroninjahack
Copy link

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
Copy link

Remove encode

@zeroninjahack
Copy link

Remove encode

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants