RSA Encryption C #

I have a class that in C # does RSA encryption, where I used the default RSACryptoServiceProvider class. But I'm worried about the following: If you have the word hello for input and the encrypted string is returned as ABCDE, if you perform another encryption operation on the input greeting using the same keys (public and private) for RSA, will ABCDE be output again?

Thanks in advance

+3
source share
1 answer

Indeed, RSA is a deterministic encryption algorithm, therefore, given the same keys and plaintext, the same cryptotext is issued. RSA is commonly used using a padding scheme that should be semantically secure.

This, of course, is only a general case. I can not vouch for RSACryptoServiceProvider in C #

Edit:

Of course, your chosen fill pattern should be pretty pseudo-random. OAEP is commonly used.

+5
source

Source: https://habr.com/ru/post/1736864/


All Articles