You can't directly encrypt a large file using rsautl
. instead, do something like the following:
- Generate a key using
openssl rand
, eg. openssl rand 32 -out keyfile
- Encrypt the key file using
openssl rsautl
- Encrypt the data using
openssl enc
, using the generated key from step 1.
- Package the encrypted key file with the encrypted data. the recipient will need to decrypt the key with their private key, then decrypt the data with the resulting key.