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

一个简单的登录搞的都登录不进去 #11

Closed
cc0411 opened this issue Mar 24, 2019 · 4 comments
Closed

一个简单的登录搞的都登录不进去 #11

cc0411 opened this issue Mar 24, 2019 · 4 comments

Comments

@cc0411
Copy link

cc0411 commented Mar 24, 2019

rsakey = RSA.importKey(key)  # 导入私钥
    cipher = PKCS1_v1_5.new(rsakey)  # 生成对象
    missing_padding = len(en_pwd) % 4
    if missing_padding:
        en_pwd += b'=' * (4 - missing_padding)
    text = cipher.decrypt(base64.b64decode(en_pwd.encode('utf-8')), "ERROR")  # 将密文解密成明文,返回的是一个bytes类型数据,需要自己转换成str

    return text.decode('utf-8')
@cc0411
Copy link
Author

cc0411 commented Mar 24, 2019

git reset 上次提交也无法登录 放弃

@pythonzm
Copy link
Owner

无法登录?具体报什么错?

@cc0411
Copy link
Author

cc0411 commented Mar 26, 2019

就报我发的那段代码有问题 不是byte 是str

@pythonzm
Copy link
Owner

感谢反馈,第一次做数据加密传输这块儿,所以可能会有点儿坑 @_@

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

2 participants