# Correct method to encrypt data so that it can be decrypted only by Alice and Bob

I need to build a system that stores encrypted transactions. Transaction involves always two parties. Payer and payee. Both must be able to download encrypted transaction from server and decrypt it using their own private key. And likewise issuing transaction must be possible by either one just by knowing both's public keys.

Is it safe to encrypt exactly same message twice (using different public keys), first by Alices public key and then by Bobs public key?(and make both 'versions' available) That way Alice can decrypt the first one and Bob the second one using their private keys. If attacker knows that two encrypted messages are actually the same, can that information help him crack the encryption?

Or is there a smarter way? And what algorithm do you recommend? I was thinking of RSA

-
How many bits would it take to represent the transaction on a computer? If you use say 2048 bit RSA, the plaintext can be a maximum of 2048 bits (256 bytes). This is the maximum though and you will likely have less room as you will definitely need padding in RSA for proper security. –  mikeazo Oct 4 '12 at 14:14

... or you just digitally sign all three parts. $\:$ –  Ricky Demer Oct 5 '12 at 4:40