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

iv 中包含 \r\n 导致 Decryption Failed #225

Open
zhangyoufu opened this issue Nov 30, 2023 · 0 comments
Open

iv 中包含 \r\n 导致 Decryption Failed #225

zhangyoufu opened this issue Nov 30, 2023 · 0 comments

Comments

@zhangyoufu
Copy link

我使用下面的代码生成随机 iv,使用了很长时间后,遇到偶发的Decryption Failed报错。

iv = bytearray(Cryptodome.Random.get_random_bytes(16))
for i in range(len(iv)):
    iv[i] &= 0x7F # ensure ASCII
req_json['iv'] = iv.decode()

测试后发现,如果 iv 参数中存在 \r\n 会引起 Decryption Failed 错误。单独的 \r 或者 \n 都没有问题。

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

1 participant