More system administrators are turning to public key infrastructure (PKI) solutions as the trend of letting data flow freely past network boundaries becomes more prevalent. Most people associate PKI with encryption, but PKI isn’t just about encryption. It’s also about data integrity and authentication. So, before implementing a PKI solution, you need to understand how encryption, digital signatures, and digital certificates work together to secure and maintain the integrity and confidentiality of sensitive data.
Encryption
Encryption is the process of turning legible clear text, which is referred to as plaintext, into incomprehensible ciphertext. In other words, you use cryptography to make the data you want to keep secret indecipherable to everyone except for the people with the necessary key to decrypt it.
Cryptography uses mathematical methods, sometimes referred to as ciphers or algorithms, to scramble data so that it can’t be easily read without the necessary key. A decryption key is usually a long random number that you must possess to decrypt a given piece of data using the same algorithm with which the data was encrypted.
There are several types of encryption, including symmetric and asymmetric. In symmetric encryption, shared keys are used to encrypt and decrypt data. The encryption and decryption keys can be identical or one key can be easily derived from the other. Although symmetric encryption is computationally fast, it requires that the key be exchanged between the sender and recipient. If the key is compromised during transit, the encrypted data can be read by the person in possession of the key.
Asymmetric encryption, which PKI implements, involves two keys: a public key and a private key. As Figure 1 shows, the process starts when a sender uses a public key to encrypt a message. The sender can request a public key from the intended recipient or download it from a public directory or website. Only the intended recipient can decrypt the message with its corresponding private key. Although slower than symmetric encryption, asymmetric encryption doesn’t require a secure key exchange.

Figure 1: Asymmetric encryption process
Symmetric and asymmetric encryption are often used together. An asymmetric cipher is used to encrypt a session key (i.e., a symmetric key intended for use in a given exchange of data), and the encrypted session key is used to encode the message. This approach, which is referred to as bulk encryption, provides the security of asymmetric encryption with the speed of a symmetric cipher.
The length of the key is an important factor in bulk and asymmetric encryption. It’s mathematically feasible to derive a private key having access only to a public key. Therefore, as computing power constantly improves, you should assume that the encrypted data will be secure for only a limited amount of time. The longer the key, the more time your data should remain secure. However, longer keys are more processor intensive, so you need to strike a balance between security and speed.
The length of a shared key is also an important factor in symmetric encryption. For information about the key lengths in symmetric and asymmetric encryption standards, see the sidebar “Common Encryption and Hash Standards.”
Digital Signatures
Public key cryptography can be used to issue messages with a digital signature. As with a handwritten signature, this seal of approval enables a message’s receiver to verify that the information did in fact come from a given sender. Digital signatures are much more reliable than handwritten signatures, as it’s very difficult to produce a fake digital signature. In addition, the integrity of the message content is guaranteed.
A hash is used to ensure message integrity—in other words, it guarantees that the message hasn’t been modified in transit. Hash algorithms analyze a message, then generate a small code (hash or message digest) that uniquely identifies it. Changing a message without changing its hash is difficult. Besides proving that a message hasn’t been modified, hash algorithms ensure that no two messages have the same hash.
Hash algorithms produce message digests that form part of the digital signature sent with a message. As Figure 2 shows, the process begins when the sender uses an algorithm to generate a hash of the original data to form a message digest. The sender then uses its private key to encrypt the message digest and sends the message to the recipient. The recipient generates its own hash of the message using the same algorithm. The recipient decrypts the original message digest sent with the message using the sender’s public key and compares the two digests. If they’re identical, the message hasn’t been tampered with in transit.

Figure 2: Data integrity process
Digital Certificates
Digital certificates are electronic documents that contain:
- A public key
- Information about the purposes for which the certificate can be used (e.g., server authentication, email encryption)
- Start and end validity dates
- Identity information about the individual or organization using the certificate
- A digital signature to attest that the identity information provided corresponds with the included public key
-
Digital certificates are usually distributed in the standard X.509 format.
A Certification Authority (CA) is a trusted entity that confirms the identities of individuals and organizations that are using digital certificates, much in the same way that one government relies on the passport authority of another country to validate its citizens’ identities. For instance, if you require a digital certificate for a public-facing web server for data encryption and server authentication, you can approach a CA to confirm your organization’s identity and send information that only your company can provide. Client OSs usually come supplied with the root CA certificate of the most commonly used public CAs (e.g., Thawte, VeriSign), enabling the OS (and the applications that run on it) to trust them. If you require authentication inside your organization only, you can install and manage your own CA.