开发者

Is there a public / private key encryption scheme that will not change a message's length?

Is there a public / private k开发者_JS百科ey encryption scheme that will not change a message's length?

I would like to encrypt a message one packet at a time, but if the packet grows, it would no longer just be one packet long.


Here's a simple scheme: Use public / private key encryption to establish a symmetric key. Then do all of your encryption using that symmetric key.

If you also need to ensure message integrity and non-repudiation, then you can run the message through a hash function, which will map it to a fixed length. Then you can sign the hash.

Typically, you wouldn't want to use public keys to encrypt messages anyway. Public / private key pairs are harder to generate and more expensive to use for long encryption, compared to symmetric keys.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜