PgpEncryptedDataGenerator: How does open
work with multiple methods?
#491
-
Hi! 👋 I just started using Pgp encryption for one of our projects, and I got a bit confused about encrypting data with multiple public key methods: In the How/Why does that work? How can input be encrypted using different methods/keys? Or am I saying nonsense? I'm very new to this 😅 Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Update: I've been doing some more experiments. I believe that the message is encrypted for all the public keys, meaning that any matching private key can decrypt the message (so basically for multiple recipients). Am I correct? |
Beta Was this translation helpful? Give feedback.
Yes, that's correct - essentially what happens is the data is encrypted once using a session key and then the session key is encrypted using each public key that has been added. This allows the holder of a private key corresponding to any of the public keys provided to recover the session key and consequently recover the data.