Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using two public keys to encrypt a file

I am not sure if this is the correct place for this question as this might be more of a theory based question. But I was also interested in the C# implementation of the following. And how feasible it is

I am planning on using PGP for encryption and decryption of files. Is it possible to encrypt the file with two public keys (my public key and the receiver's public key) so that if i will be able to decrypt the file using either one of the private keys. Is this scenario feasible? Is so what is the direction I should take for a correct implementation of the same. Any help would be highly appreciated

like image 212
Ron Avatar asked Oct 22 '25 20:10

Ron


1 Answers

Look at this wiki page:

http://en.wikipedia.org/wiki/Pretty_Good_Privacy

What you will see that actual data is encrypted/decrypt with random key and this random key is encrypted/decrypted with according public/private key.

So, as result you don't have to encrypt a file (data) using two keys. You still encrypt the data with one random key. The only difference is that you encrypt this random key with multiple public keys (as example your's and receiver's).

As result, any of you will be able to decrypt random key using private key and decrypt data.

like image 127
Victor Ronin Avatar answered Oct 25 '25 18:10

Victor Ronin



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!