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

运行main.py 报错 是怎么回事 #49

Open
sc32024826 opened this issue Feb 22, 2024 · 7 comments
Open

运行main.py 报错 是怎么回事 #49

sc32024826 opened this issue Feb 22, 2024 · 7 comments

Comments

@sc32024826
Copy link

image
@sc32024826
Copy link
Author

我在本地运行main.py 成功了 但是在actions 中报错了 这个Crypto 是怎么回事? 我 python 不会

@baicuhaha
Copy link

哈喽 你解决了没? @sc32024826

@sc32024826
Copy link
Author

@baicuhaha 我不会啊 查也查不到 等个大佬

@czz3120
Copy link

czz3120 commented Feb 26, 2024

哈哈哈,咱们碰见的是同样的问题。都查了好几天资料,aes_key改了又改还是不行

@baicuhaha
Copy link

baicuhaha commented Feb 26, 2024

@sc32024826 @czz3120 我改的decrypt_aes_ecb 这个方法的,然后PRIVATE_AES_KEY用的明文。
`def decrypt_aes_ecb(ciphertext, key):
"""
无偏移的AES解密
:param ciphertext: 需要解密的密文
:param key: AES私钥
:return: 解密后的明文
"""

ciphertext = base64.b64decode(ciphertext)
cipher = AES.new(key, AES.MODE_ECB)
plain_str = cipher.decrypt(ciphertext)
return plain_str.decode('latin1').strip()  # 使用 latin1 字符集解码字节字符串

PRIVATE_AES_KEY = "以茅台自用版本"`
然后成功了,你们可以试试。。

@sc32024826
Copy link
Author

@baicuhaha 感谢 成功了

@evdcmate
Copy link

evdcmate commented Mar 5, 2024

修改config.py中的AMAP_KEY,PRIVATE_AES_KEY,其他可不改。这个issue可以关闭了。

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