开发者

RSA Encryption C#

开发者 https://www.devze.com 2022-12-22 17:40 出处:网络
I have a class which in C# doing RSA encryption where I used the default RSACryptoServ开发者_开发百科iceProvider class. But I have a concern regarding the following; If you have the word hello for an

I have a class which in C# doing RSA encryption where I used the default RSACryptoServ开发者_开发百科iceProvider class. But I have a concern regarding the following; If you have the word hello for an input and the encrypted string is returned as ABCDE, if you perform another encrypt operation on the input hello, using the same keys (public and private) for the RSA will the output be again ABCDE?

Thanks in advance


Indeed, RSA is a deterministic encryption algorithm, so given the same keys and plaintext, the same cryptotext will be outputted. RSA is commonly used with a padding scheme to be semantically secure.

This is of course only the general case. I can't vouch for the RSACryptoServiceProvider in C#

Edit:

Of course, your chosen padding scheme needs to be pretty pseudorandom as well. OAEP is one commonly used.

0

精彩评论

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

关注公众号