You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 23, 2020. It is now read-only.
RSA encryption only works on blocks that are smaller or equal to the key size.
If you want to use the RSA algorithm to directly encrypt data, you'll have to break up the plaintext into suitably sized blocks. There are some standard methods for doing this (such as RSAES-PKCS1-v1_5 and RSAES-OAEP) which are supported by Pointy Castle. See the "RSA encryption and decryption" section of the tutorial at https://github.com/PointyCastle/pointycastle/blob/master/tutorials/rsa.md. Though RSAES-PKCS1-v1_5 is not considered very secure these days, and is only there for backward compatibility. But directly encrypting data using RSA is not recommended.
The normal practice is to generate a random session key and encrypt the data using a symmetric algorithm (e.g. AES-256) and then encrypt the small session key using RSA. The receiver will use their private key and the RSA algorithm to decrypt the session key, and then use the decrypted session key to decrypt the data. This greatly improves performance, since the bulk data is encrypted/decrypted using the much faster symmetric algorithm rather than the slower RSA algorithm.
If I encrypt data with RSA key. The Data itself is also an RSA key with same length in XML format
The text was updated successfully, but these errors were encountered: