As discussed in the previous section, at the core of digital signatures is the ability to uniquely identify the sender of a message. The reciprocal nature of the relationship of the key pair makes this unique identification possible through public key cryptography.
Because the private key in a key pair belongs to only one party, any time that it is shown that the private key has been used, it can be concluded that only the owner of that key has used it. In this way, the use of the private key is like a signature on a paper because only the owner of a signature can actually make it. The signature confirms its owner's presence just as the use of the private key confirms its owner's presence.
If a key pair is successfully used in an encryption and decryption operation, the pair's private key must have been used for one part of the operation. Because a public key is tied to only one private key, the corresponding public key can be used to identify its related private key and only its related private key. If a particular public key is used successfully in an encryption and decryption operation, it can be inferred that the corresponding private key was used for one part of the operation. Because only the key owner can use the private key, this means that the key owner and only the key owner could have performed part of the encryption and decryption operation.
Using a private key to establish identity shows that the full encryption and decryption operation was accomplished successfully. Showing a full operation means that plaintext would have to be encrypted to ciphertext using a private key and then decrypted back to plaintext using the corresponding public key. If this operation is successfully shown, the use of the private key, and only the private key, is demonstrated.
To show a successful encryption and decryption operation, the plaintext before the encryption and decryption operations must match the plaintext after the encryption and decryption operation. Both sets of plaintext must be compared directly and shown to match absolutely. There must be a control that is used for comparison and validation.
In e-mail, this control is the actual message. Because the message is available to both the sender and the recipient, it is a convenient control element.
To be used in this comparison operation, the message is converted into a "hash," which is a numerical representation of the complete text. Identical message text will yield identical hash values.
By taking the hash value of the message and combining it with the private key at the time of sending, the owner of the private key proves that he or she, and only he or she, sent the message.
Combining the message with the private key is accomplished by encrypting the hash value with the sender's private key, which creates the actual digital signature. Depending on how the sender's e-mail system has been configured, the digital signature is appended either to the bottom of the message, creating a "clear signed" message, or the result is combined with the original message into a binary attachment, creating an "opaque signed" message.
Because the digital signature is added to the original message as an attachment, clear signed messages can be read by e-mail clients that do not support S/MIME. The signature is discarded and the original message is displayed by non-S/MIME clients. However, there is no way the message can be verified; it is essentially the same as an unsigned message. The disadvantage of clear signed messages is that there is an increased chance for intervening mail gateways to alter the message, and thus invalidate the signature.
Conversely, because the message and the digital signature are treated as a single binary attachment in opaque signed messages, they are much less likely to be altered in transit. However, only an S/MIME client can read the attachment. If a non-S/MIME client receives an opaque signed message, the message is unreadable.
Opaque-signed messages were, in part, created to solve the problem of e-mail systems that altered message bodies while e-mail was in transit. It should be noted here that current e-mail solutions that comply with S/MIME standards do not alter the message body. However, there are many clients that cannot read opaque-signed e-mail messages. Therefore, sending clear-signed messages is recommended.
When the message is received, the digital signature can be retrieved and the sender's public key applied in a decryption operation, which yields the original hash value of the message. A comparison of this hash value with the hash value of the received message can then be performed. Because only one private key can correspond to a public key, and only the owner of the public key could use it to encrypt the hash value successfully, decrypting the hash with the public key shows that the private key owner encrypted the hash value. Because the hash value is a numerical representation of the message text, if the encrypted hash value matches the hash value of the message received, it indicates that the message text that was sent matches the text that was received. When coupled with the fact that only the private key owner could have sent the message, the result is that the recipient is assured that only the key owner sent the message, which provides authentication and, consequently, nonrepudiation. It also shows that the message has not been changed, which provides data integrity. If the hash values did not match, the recipient would know that the message had either been altered in transit or that the public key used does not match the private key used. In both cases, the recipient knows that the message is not valid and should not be trusted.
Thus, the way that public key cryptography provides the security services that make up digital signatures can be seen.
The following figure shows the sequence of signing with the addition of the supporting elements of public key cryptography.
Public key cryptography and digital signing of an e-mail message.gif)
-
Message is captured.
-
Hash value of the message is calculated.
-
Sender's private key is retrieved.
-
Hash value is encrypted with the sender's private key.
-
Encrypted hash value is appended to the message as a digital signature.
-
Message is sent.
The following figure shows the sequence of verifying with the addition of the supporting elements of public key cryptography.
Public key cryptography and verifying a digital signature of an e-mail message.gif)
-
Message is received.
-
Digital signature containing encrypted hash value is retrieved from the message.
-
Message is retrieved.
-
Hash value of the message is calculated.
-
Sender's public key is retrieved.
-
Encrypted hash value is decrypted with the sender's public key.
-
Decrypted hash value is compared against the hash value produced on receipt.
-
If the values match, the message is valid.
The sequence shows how public key cryptography provides the capabilities that give a digital signature its core security services: authentication, nonrepudiation, and data integrity.