So, Alice chooses a random AES key, encrypts the message with it and send this to Bob, along with an encrypted version of the AES key to decrypt it and a signature to prove her as originator.

Of course, there are other setups, like sending to multiple people or having no need for a signature or similar, but I'm looking for a kind of setup like this. Maybe I understand something wrong and my pseudo code above lacks precision or contains a bug. It just represents my crude understanding of the matter ;-)

I can do all this step by step by myself, using Python libraries like Crypto or Unix shell tools like openssl.

But I'm looking for a standard way to do this, without worrying myself about how to implement paddings or that split() function used in the pseudo code when receiving the message. I guess there must be a library or a tool set or whatever which does this for me and which maybe even allows to interoperate with other programs doing similar tasks.

Questions:

Is my setup described above feasible and typical? Or does it contain any logical errors, flaws or attackable aspects?

Is there such a library or toolset available as Unix command line tools or Python libraries which does this for me?

I'd prefer to stick to RSA and AES with an option of exchanging each with any other chosen algorithm, but solutions for a fixed algorithm set would be welcome as well.

As I said, sending from Alice to Bob is my first approach but being able to send to more than one receiver would we a nice bonus.

$\begingroup$You might be interested in NaCl. (It uses different primitives, but the crypto_box C++ interface is about as foolproof as it gets.)$\endgroup$
– yyyyyyyMay 8 '16 at 22:57

$\begingroup$Sounds like there is no standard way of doing what I want besides the even more feature-loaded PGP and GPG. I would have assumed some kind of PKCS#whatever or similar is what I want.$\endgroup$
– AlfeMay 8 '16 at 23:02

1

$\begingroup$Well, there's CMS (also known as PKCS#7) which would get you close as well.$\endgroup$
– Maarten Bodewes♦May 8 '16 at 23:14