识别你自己的消息RSA
我有一个使用 AES 加密消息的软件,随机生成的 AES 密钥由接收者的公共 RSA 密钥加密。现在,当我将消息发送给多个用户时...
发送方:
消息由随机散列(sha256)AES 密钥加密
AES 密钥然后使用每个接收者的公钥对其进行多次加密并附加到加密的消息中。
消息有[接收者号码,[加密密钥列表],加密消息]
接收方:
get接收器数量
循环通过附加的加密密钥并使用您的私有 RSA 进行解密。直到您找到适合您的那一款。这样,当他/她解密密钥时,他们会获得 AES 密钥。
3.使用AES密钥解密消息。
知道密钥是基于 64 的字符串,这意味着它以“=”结尾,并且由于 sha 的原因,长度为 256
,问题是: 我如何知道(如果我是接收者)使用我的私有 RSA 解密的密钥自动是正确的?
先感谢您。
I have a Software that Encrypts message using AES , the random generated AES key is Encrypted by the receiver's public RSA key. now when I send the message to multiple users...
Sender Side :
Message is Encrypted by Random hashed (sha256) AES KEY
The AES key is then Encrypted many time and appended to the encrypted message using each receiver's public key.
the message has [ number for receivers, [list of encrypted keys], Encrypted message]
Receiver Side:
get the number of receivers
loop thru the appended encrypted keys and decrypt using your Private RSA. until you find the one intended for you. such that when he/she decrypt the key they get the AES Key.
3.decrypt the message using AES key.
Knowing that the key is of base 64 string which means it ends with '=', and of the length 256 because of the sha
the Question IS :
How Do i know (if I'm the receiver) that the Decrypted key using my Private RSA is correct Automatically ?
thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有两个问题:您描述的协议是固定的,还是可以以任何方式修改?如果它是固定的,您对 RSA 使用哪种填充方案? PKCS#1 v1.5、OAEP 还是根本没有?
如果协议可能被修改,您可以使用带有身份验证的密码模式,例如 EAX、CCM 或 GCM。如果 RSA 密钥传输解密失败,则经过身份验证的 AES 解密也会失败。
使用 RSA-OAEP 的变体进行密钥传输,提供“纯文本感知”,如下所述:http://www.rsa.com/rsalabs/node.asp?id=2346。
Two questions: Is the protocol you describe fixed, or might it be modified in any way? If it is fixed, which padding scheme do you use for RSA? PKCS#1 v1.5, OAEP or none at all?
If the protocol might be modified, you could use a cipher mode with authentication, such as EAX, CCM or GCM. If RSA key transport decryption fails silently, so will the authenticated AES decryption.
Use a variation of RSA-OAEP for the key transport that provides "plain text awareness" as described here: http://www.rsa.com/rsalabs/node.asp?id=2346.
没有办法找到这个加密消息属于哪个接收者。
但你可以做的是尝试解密消息,如果解密成功那么那就是接收者
There is no way to find this encrypted message belongs to which receiver.
But you can do is try to decrypt the message if the decrypt is successful then that is the Receiver