A digital signature is a means of adding an identifier to a file that cannot be forged. It ensures that you know who created the file and that it has not been modified since creation. Digital signatures are frequently used to positively identify email. Executable programs can also be digitally signed so that you can know its origin before running it on your system.
Most digital signatures use the RSA public key encryption algorithm. There are two keys involved with public key encryption. One key is used to encrypt the data and the other key is used to decrypt the data. Typically one key is made public so that anyone can access it and the other key is kept secret by its owner. Public key encryption has the advantage of not requiring the communicating parties to exchange secret keys before they send any data. Everybody can know your public key so anyone can send you an encrypted message. If you keep your private key secret, only you will be able to decrypt messages sent to you.
If Alice wants to send a message to Bob and doesn't want anyone else to be able to view the message, she can encrypt the messages with Bob's public key. Bob will decrypt it with his private key.
The above system prevents anyone buy Bob from viewing the message, but it doesn’t verify the Alice actually sent the message. Digital signatures use the encryption system in reverse. The RSA algorithm is symmetrical. Either the public or private key can be used to encrypt a message. The other key is needed to decrypt it. If you send me a message encrypted with your private key, anyone can decrypt it with your public key. But because you are the only one who knows your private key, you must have sent the message that decrypts successfully with your public key.
If Alice wants to send a digitally signed message to Bob, she will first compute a hash or checksum of the message. There are several standard message hash algorithms. Alice will then encrypt the checksum with her private key. The checksum is appended to the message and both are sent to Bob. When Bob receives the message he can decrypt the checksum using Alice's public key. He then computes a checksum of the message and compares it to the decrypted checksum he received from Alice. If the checksums match, then the message must have come from Alice because only she has the private key that could correctly encrypt the transmitted checksum. Because the checksum matches, Bob also knows that the message has not been modified.
For public key encryption to be secure, Bob must be certain that the public key he is using is truly the public key for Alice. If he acquired the key from an unsecured source, somebody may have tricked him into using your public key instead of Alice’s. You could then send messages claiming you were Alice and Bob would not know otherwise. There are several key server systems that can be used to securely distribute keys. A more convenient method is to send the decryption key along with the data.
Digital certificates are a means of securely packaging a public key so that its authenticity can be verified. To create a digital certificate for Alice, you need to create a signed set of data that includes Alice’s public key and optionally her name, email address and other identifying information. A checksum or message hash of the public key and identify information is created and encrypted with the private key of a certificate authority.
A certificate authority (CA) is an organization that people trust to make and sell secure digital certificates. The public keys of several certificate authorities come installed with most web browsers and email systems. Others can be downloaded. In Microsoft’s Internet Explorer you can view the list of available certificate authorities by selecting Tools / Internet Options / Content / Certificates / Trusted Root Certification Authorities. If you select one of the certificate authorities and press the View button, you can see the contents of the digital certificate. Note that the certificate has an expiration date. Most CA certificates have an expiration date years in the future, but most certificates used by people and servers expire in just a couple of years. If you click on the Details tab and scroll down to the public key, you can view the bit string the makes up the public key. Most public keys are 1K to 2K bits in length, making them very difficult to guess.
Not all digital certificates are directly created by a certificate authority. You can create a chain of trust where the certificate authority signs certificate A which is used to sign certificate B which is used to sign certificate C which is used to sign your email. Consider how this might work in a university. The chancellor gets a digital certificate from a certificate authority. She then uses her private key to sign the digital certificates of the vice chancellors. She knows who the vice chancellors are, so she can give them their digital certificate (including their private key) knowing that the certificates are going to the proper people. The vice chancellors can then use their digital certificates to sign new digital certificates for the deans. The deans create digital certificates for the department chairs and so on. Each person issuing digital certificates can reliably identify the people receiving their digital certificates. In this way everyone at the university can receive a digital certificate from someone who personally knows that it was given to the correct person. Thus when a signed message arrives from someone at the university, you know for certain that it was sent by the expected sender.