In public key cryptography, both sender and receiver generate a pair of keys - Public key and Private key. Public keys are known globally.
Suppose $A$ is sender and $B$ is the receiver.
So, $A$ has $3$ keys:
1. Public key of $A$ (Everyone knows) 2. Private key of $A$(only $A$ knows) 3. Public key of $B$(Everyone knows)
And $B$ also has $3$ keys:
1. Public key of B (Everyone knows) 2. Private key of B(only B knows) 3. Public key of A(Everyone knows)
- Anything that is encrypted using public key of A can be decrypted only using private key of A.
- Anything that is encrypted using private key of A can be decrypted only using public key of A.
- Anything that is encrypted using public key of B can be decrypted only using private key of B.
- Anything that is encrypted using private key of B can be decrypted only using public key of B.
Now $A$ wants to send a secret message to $B$.
So, for encryption: A has following $3$ options:
- Public key of A (Everyone knows):
So, for decryption $B$ needs - Private key of $A$ - only $A$ knows it. So, $B$ will not be able to decrypt it.
- Private key of $A$ (only $A$ knows)
So, for decryption $B$ needs - Public key of $A$ - Everyone knows it. So everyone can decrypt it. So it is of no use.
- Public key of $B$ (Everyone knows):
So, for decryption $B$ needs - Private key of $B$ - only $B$ knows it. So, only $B$ will able to decrypt it (That's what we want)
So, for providing Security:
Sender encrypts using receiver's public key and Receiver decrypts using his own private key.
Correct Answer: $A$