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

关于sign方法中再次对明文加密是否有必要 #1

Open
lgyHector opened this issue Aug 4, 2016 · 1 comment
Open

关于sign方法中再次对明文加密是否有必要 #1

lgyHector opened this issue Aug 4, 2016 · 1 comment

Comments

@lgyHector
Copy link

今天偶然遇见个问题,就是在向微信回复密文消息的时候。先是调用了encrypt对回包加密
然后想当然的调了sign方法获得签名。但是发现总是回复失败。加解密方法肯定没问题。然后发现
sgin中这行:

var encrypted = this.encrypt(text, app);

又对明文加了一次密所以获得的签名并非之前自己调用encrypt 获得的加密体。感觉有点鸡肋啊。
一般都是加密体带着自己的签名进行校验。是否sgin方法可以用已获得的加密体进行签名。不然这个sgin有点用不上啊。

@calidion
Copy link
Member

calidion commented Aug 4, 2016

调用sign时就不用encrypt的。
一般来说不必调用encrypt。
只调用sign就可以了。

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