Repository navigation
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! |
Answered by
dghgit
Oct 21, 2023
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? |
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.