Recently, I have a need to encrypt few large files. I have the option to use the OpenSSL command line utility, however I prefer to use GnuPG.
How does GnuPG works under the hood with the
--encryptoption? Does it generate symmetric key first, then it encrypt it with public key? Or is it only asymmetric encryption, which is heavy on performance?
If it's generating symmetric a key first, which then gets encrypted using the public key later (asymmetric), what algorithm does it use to encrypt data symmetrically?
The encryption method I'm asking about (symmetric + asymmetric encryption) is sometimes refered as "hybrid encryption" or with use of "session key".
I haven't found such information anywhere and digging through code is a pain.