I'm using Crypto++ for RSA encryption. My plain text exceeds FixedMaxPlaintextLength. What should I do?

StackOverflow https://stackoverflow.com/questions/2033809

Question

Should I break the text into chunks?

Is RSA the wrong encryption scheme?

Was it helpful?

Solution

Wrong scheme. The standard technique for message encryption (for example, PGP and CMS) is to generate a random symmetric session key K for something like AES and encrypted the message with AES using key K. Then encrypt K with the public key of each recipient of the message.

OTHER TIPS

Typically, the asymmetric RSA algorithm is used for key exchanges. If you are encrypting larger chunks of data, it might be better to use something like AES.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top