Use digital signatures when you want to distribute data, and you want to assure recipients that it does indeed come from you. Signing data does not alter it; it simply generates a digital signature string you can bundle with the data.

Digital signatures are created using a public-key signature algorithm such as the RSA public-key cipher. A public-key algorithm actually uses two different keys: the public key and the private key (called a key pair). The private key is known only to its owner, while the public key can be available to anyone. Public-key algorithms are designed so that if one key is used for encryption, the other is necessary for decryption. Furthermore, the decryption key cannot be reasonably calculated from the encryption key. In digital signatures, the private key generates the signature, and the corresponding public key validates it.

In practice, public-key algorithms are often too inefficient for signing long documents. To save time, digital signature protocols use a Cryptographic Digest, which is a one-way hash of the document. The hash is signed instead of the document itself. Both the hashing and digital signature algorithms are agreed upon beforehand. Here is a summary of the process:

  1. A one-way hash of the document is produced.
  2. The hash is encrypted with the private key, thereby signing the document.
  3. The document and the signed hash are transmitted.
  4. The recipient produces a one-way hash of the document.
  5. Using the digital signature algorithm, the recipient decrypts the signed hash with the sender’s public key.

If the signed hash matches the recipient’s hash, the signature is valid and the document is intact.

When software (code) is associated with a publisher’s unique signature, distributing software on the Internet is no longer an anonymous activity. Digital signatures ensure accountability, just as a manufacturer’s brand name does on packaged software. If an organization or individual wants to use the Internet to distribute software, they should be willing to take responsibility for that software. This is based on the premise that accountability is a deterrent to the distribution of harmful code.

Digital Certificates

A certificate is a set of data that completely identifies an entity, and is issued by a certification authority (CA) only after that authority has verified the entity’s identity. The data set includes the entity’s public cryptographic key. When the sender of a message signs the message with its private key, the recipient of the message can use the sender’s public key (retrieved from the certificate either sent with the message or possibly available elsewhere in the directory service) to verify the sender’s identity.

Certificate Store Technology

In order to perform a code signing operation, both private key and signer identification information must be supplied. The digital certificate used in the signature usually supplies the signer identification information, however. Thus, the private key must be supplied through some other means. Additionally, the signature must include the certificate chain for the cryptographic service provider (CSP), up to a root certificate trusted by the user, in order for the signed file to be authenticated. So in all, there are several items that need to be provided in order to generate a digital signature.

Microsoft has developed a certificate store technology to reduce the above complexity. Using this technology, when a user enrolls to obtain a certificate, they specify the private key information, the CSP information, and the certificate store name for the certificate. The certificate will then be stored in the certificate store and be associated with the other items. When the user wants to sign a document, they only need to identify the certificate in the certificate store. The code signing tool will retrieve the certificate, the private key, and the certificate chain for the CSP, all based on the specified certificate.

Using Microsoft’s certificate store technology, only one certificate is necessary to perform a digital code signing operation. This relieves users from having to manage private key and CSP information.

Digital Certification

One of the primary goals of a digital certificate is to confirm that the public key contained in a certificate is, in fact, the public key belonging to the person or entity to whom the certificate is issued. For example, a CA might digitally sign a special message (the certificate information) containing the name of a user, Alice, and her public key in such a way that anyone can verify that the certificate information message was signed by no one other than the CA; the CA thereby conveys trust in Alice’s public key.

The typical implementation of digital certification involves a signature algorithm for signing the certificate. The process goes something like this:

  1. Alice sends a certification request containing her name and her public key to a CA.
  2. The CA creates a special message (m) from Alice’s request, which constitutes most of the data in the certificate. The CA signs the message with its private key, obtaining a separate signature (sig) in the process. Then the CA returns the message m and the signature sig to Alice; the two parts together form a certificate.
  3. Alice sends the certificate to Bob to convey trust in her public key.
  4. Bob verifies the signature sig using the CA’s public key. If the signature is verified, he accepts Alice’s public key.

As with any digital signature, anyone can verify, at any time, that the certificate was signed by the CA, without access to any secret information. Bob needs only to get a copy of the CA’s certificate in order to access the CA’s public key.

A certificate is valid only for the period of time specified by the CA that issued it. The certificate contains information about its beginning and expiration dates. The CA can also revoke any certificate it has issued and maintains a list of revoked certificates. This list is called a certificate revocation list (CRL), and is published by the CA so that anyone can determine the validity of any given certificate.