You did not specify the details of your method to analyze, however, the usual method is not purely based on the encryption with public-key cryptography, rather a hybrid cryptosystem, where the symmetric key is transferred with the public key cryptography and the key is used in the symmetric key cryptography.
With RSA
Let's say we want to send the message $m$ to $n$ parties each have $pub_i$ and $prv_i$ keys (use RSA with OAEP).
Now, generate a uniform random AES256 key $k$ and encrypt the message with AES-GCM,
$$(c,tag) = \operatorname{AES-GCM-Enc}(k,IV,m)$$
Now encrypt the $k$ for each person $$\bar k = \operatorname{RSA-OAEP-Enc}(pub_i,k)$$ and send each user $(\bar k, c, IV, tag)$. Now each user can individually get the key $k$ and decrypt the message.
The weakness is that an observer can see that you have sent the same message to all. To mitigate this, if necessary, use a different IVs per user. Note that this will increase the encryption time.
Other candidates
RSA-KEM
The above was direct usage of the RSA. Normally one can go for RSA-KEM (in short below, full detail here)
- Generate a random $r \in [1,n-1]$ and use HKDF to derive a key.
- Encrypt the message with AES-GCM by using the derived key
- send the $r$ with textbook-RSA together with the $(c,tag)$
NaCL
NaCl has existing solutions for this; the authenticated encryption
Integrated Encryption Scheme (IES)
Integrated Encryption Scheme (IES) has multiplicative and an elliptic curve version, too.
In the Elliptic curve version ECIES, first, there are agreements on
- the elliptic curve parameters $(q,n,b,G,n,h)$
- Key Derivation Function (KDF)
- Message authentication code like HMAC-SHA256 ( or directly use AES-GCM or ChaCha20-Poly1305)
- each user has $x_i$ as private key and the public key $P_i = [x_i]G$
Then the message can be sent as
The sender generates a random integer $r \in [1,n-1]$ and set $R = [r]G$
Let $P=(x(P),y(P)) = [r]P_i$ and make sure that $P \neq \mathcal{O}$
Let $S = x(P)$
Derive the encryption AES256 key$$k = \operatorname{HKDF}(S)$$
Encrypt with AES-GCM or ChaCha20Poly1305.
$$(c,tag) = \operatorname{AES-GCM-Enc}(k,IV,m)$$
Send $(R,c,IV,tag)$
On the decryption side
- Calculate $P = [x_i]R$ due to $$P = [x_i]R=[x_i r]G =[r x_i] G = [r]P_i $$ as prepared
- Let $S = x(P)$
- Derive the encryption AES256 key$$k = \operatorname{HKDF}(S)$$
- Decrypt $$(m,\perp) = \operatorname{AES-GCM-Dec}(k,IV,c,tag)$$Never accept an incorrect tag, halt $(\perp)$?
WhatsApp
WhatsApp uses a similar idea.
Note: If possible, I would go for the NaCL