Reputation: 679
Here is what i have or as far as i know about GPG 1. when GPG encrypt using a public key , we need to specify a keyid/user_id to identity that key.
So my question is : How GPG identify or find out the corresponding private key of that encryption public key ? Is that information indicated in the encrypted file ?
Upvotes: 1
Views: 1480
Reputation: 94108
By using the key ID, normally a cryptographically secure hash over (part of) the key. Note that for e.g. RSA the modulus already identifies the public and private key, so normally a hash over the modulus suffices for identification. No direct need to store the ID.
Upvotes: 3
Reputation: 182883
The encrypted file contains a list of all the keys that can be used to decrypt it. If you have any of those private keys, you can decrypt it.
Upvotes: 1