I'm newbie to encryption.
In Public Key Cryptography we have pair of keys - one for encryption and one for decryption.
In case Alice wants Bob to send her secret message, she publishes her encryption key (it'll be called public key) and keeps decryption key in secret (it'll be called private key). Bob encrypts message with Alice public key and Alice uses her private key to decrypt Bob's message.
Till now I think we all agree.
Now let's see what happen with signatures. Alice wants to send Bob a message and sign it to prove Bob that the message owned by her Alice. Signatures are intended to solve authentication problem. With Public Key Cryptography, signature is encrypted digest (e.g. checksum) of message with Alice private key and decrypted by Bob with Alice public key. Since only Alice knows it's private key, Bob can be sure that the message is from Alice.
This how signature is explained here:
Some Asymmetric Algorithms (public key algorithms) such as RSA allow the process to work in the opposite direction as well: a message can be encrypted with a private key and decrypted with the corresponding public key. If the recipient wants to decrypt a message with Bob's public key he/she must know that the message has come from Bob because no one else has sender's private key. Digital signatures work this way.
What I'm confused is what is this private key Alice uses for encryption of signature? Thus for signature we use:
- The same set of keys, used to send secure messages from Bob to Alice, meaning the same private key used by Alice to decrypt message received from Bob can be used to encrypt digest of message, sent by Alice back to Bob or ...
- Additional pair of encryption/decryption keys used for signing Alice's messages, where Alice publish decryption key of the pair.