
Here the MD5 hash is being encrypted with the private key of the sender. But I read in a paper that private key is only used for signing and not encrypting. Is the image wrong or can private key also be used in the way that is shown in the image?
|
Here the MD5 hash is being encrypted with the private key of the sender. But I read in a paper that private key is only used for signing and not encrypting. Is the image wrong or can private key also be used in the way that is shown in the image? |
|||||||||||
|
|
Signing actually means encrypting the hash of the message with the private key, so yes it's correct. That means you decrypt the hash with the sender's public key, therefore you can be certain the sender wrote that message (provided that the hash you compute matches the one you decrypt). |
||||
|
|
|
Encryption is typically described as changing a peice of data from something readable by anyone (cleartext) to something undecipherable (ciphertext). Then decryption is the reverse process. Any time an operation is performed, regardless of the purpose, these terms apply. In the case of a signature, the purpose is integrity, but the same process holds true:
The message itself is later encrypted entirely with 3DES and transmitted, so privacy is provided by the the symmetric key. On the other end: - the signature is removed from the message - the unintelligible ciphertext is rendered back into the original hash by the public key of the sender - the (now cleartext) hash is compared to a repeated hash of the message In this case, the encryption is something that anyone can decrypt using the public key of the sender - so it doesn't guarantee a private transmission. But it's still encryption because the original data (the hash) cannot be interpreted without first decrypting the signature. It gets confusing in asymetric cryptography, because "signing" and "encrypting" are two applications of public/private key pairs, but even in a signature the mathematical steps of encryption/decryption take place because cleartext gets turned into ciphertext in either case. |
|||
|
|
|
"Encryption with the private key" is how the very first digital signature algorithm was initially described, in a hand waving way (this was RSA, back in 1977; the article also contains more useful mathematics). It turns out that this "explanation":
See PKCS#1 for how RSA should be used. In particular, see how private key and public key operations are not at all symmetrical, and cannot be swapped in such an off-hand manner. What should be remembered is the following:
|
|||
|
|