Having said all that, you should not proceed that way. RSA encryption/decryption is tremendously slow and CPU intensive. You'd be far better off encrypting your big input file with some symmetric algorithm (e.g. AES) and then encrypting with the RSA key (private or public, depending on your needs) the key used with this algorithm.
On 12/11/05, Amir (sent by Nabble.com) <[EMAIL PROTECTED]> wrote:
Hi all,
How can I encrypt a large file (like 100mb) with a public key so that no one other than who has the private key be able to decrypt it?
I can make RSA public and private keys but when it comes to encrypting a large file using this command:
openssl rsautl -encrypt -pubin -inkey public.pem -in myLargeFile.txt -out myLargeFile_encrypted.txt
I get this error:
RSA operation error
3020:error:0406D06E:rsa routines:RSA_padding_add_PKCS1_type_2:data too large for key size:.\crypto\rsa\rsa_pk1.c:151:
I tried to make keys with sizes from 40 to 4096 bits, no luck, same error
Thankx in advance
Amir
Sent from the OpenSSL - User forum at Nabble.com:
How to encrypt a large file by a public key?