PGP message integrity: Basically, only private key can decrypt message encrypted with public key. But in the message integrity service in PGP does the reverse, where the Hash of the message if encrypted with private key and then the receiver decrypts it with public key! I need clarification.


This procedure, also called signing a message, does not encrypt the message itself, thus does not ensure it cannot be read by others. Instead, a hash sum of the message is encrypted using the private key.

For verifying, the recipient again calculates the hash sum of the message, and decrypts the hash sum calculated by the sender using the sender's public key. If this operation is successful, the recipient knows the the sender must be the owner of the private key, as nobody else could have used this for encrypting the hash message.

This requires that both keys (private and public) can be used to encrypt for each other, which is given for RSA. The procedure might be different for other encryption algorithms.

| improve this answer | |
  • $\begingroup$ so with RSA, encryption and decryption can be done with both public and private key? $\endgroup$ – Balu Jul 21 '14 at 17:40
  • $\begingroup$ Yes, for RSA any of the two keys can be used for encrypting, and the respective other key for decrypting. $\endgroup$ – Jens Erat Jul 21 '14 at 17:46
  • $\begingroup$ that made it clear for me :) I was confused with the older version of public key crypto, until i knew about RSA. $\endgroup$ – Balu Jul 21 '14 at 17:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.