For encrypting the data public key is used whereas the private key is used for decrypting the data.