Question:
I am trying to use RSA to encrypt 190K of data, but it is taking 72 seconds to run. Can this be sped up?
Answer:
RSA encryption is a *very* time consuming algorithm, and should never be used to encrypt large amounts of data. The typical use for RSA is to encrypt symmetric algorithm session keys. For example, instead of encrypting 190K with RSA, you would generate a secret key for a (much faster) symmetric encryption algorithm, such as AES. You encrypt the data using AES, then use RSA to encrypt the AES key (typically using the public key). You send both the encrypted session key and the encrypted data to your partner. The partner then decrypts the session key with the corresponding RSA private key, and then uses it to decrypt the AES encrypted data.