Attachments are large files, and asymmetric encryption is very slow (i.e. RSA), so itβs best to create an AES key and encrypt it using the RSA public key, and then encrypt the attachment much faster than AES. Then send the encrypted key and attachment to the recipient. Since only she received the private key, only she can decrypt the AES key, thereby decrypting the attachment.
source
share