This is a simple guide to digital file envelopes with OpenSSL. Digital envelopes let you send protected information to avoid interceptors from reading it. The file is locked with the receiver's public key and signed by the sender so the receiver knows it came from them.
For some context, AES is fast, but both sides need the same key. RSA solves the concerns about sharing keys, but it's slow and can only encrypt small things. So use both where a random session key encrypts the file with AES, and the receiver's public key encrypts the session key.
