Yes and no. You cannot encrypt using RSA, but you can go to one of the following:
The usual encryption approach is used with a symmetric algorithm and the transmission of a key encrypted using RSA. For example, to send D data to another person with the PK public key:
- send Ek (D) (D is encrypted with a symmetric algorithm with key K)
- send also Epk (K) (K is encrypted with RSA algorithm with PK)
The other side opens PK (K) to get K, and open K (D) to get D.
split the data into small parts and encrypt each separately.
The first approach is much better for two main reasons:
- You will not ruin the data (except for encryption itself).
- Symmetric encryption / decryption is much faster than public encryption, for example, RC4 is a simple XOR data, while RSA uses a lot of power.
(3. There must be a reason why PGP is so common ...)
source share