Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

As I understand, when you want to send a confidential message to someone, you encrypt the message with his public key. And he use his private key to decrypt the message.

At the same time, one can use his private key to sign a message, and other people use his public key to verify that it's him who sign it.

How the math is different between decrypt the message and sign a message?

share|improve this question
Depends on the encryption and signature scheme you are using. – DrLecter May 8 '14 at 5:25
With RSA you generally use different padding. With other schemes encryption and signing usually have very little in common. – CodesInChaos May 8 '14 at 8:03
So in general total different type of algorithm is used in public encryption and signature signing, correct? – Phương Nguyễn May 8 '14 at 10:19
@CodesInChaos: I think this could actually be a pretty good "FAQ" question, and your comment, with some embellishment (e.g. compare RSA signing with RSA encryption and DSA / ElGamal signing with ElGamal encryption), could make a good answer for it. I may try to write one later, unless someone else does it first. – Ilmari Karonen May 8 '14 at 11:46

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.