Technology >> PKI
Public Key Infrastructure (PKI)

Introduction to Public Key Infrastructure (PKI)

It is necessary to understand some of the basics of encryption, digital certificates and digital signatures before examining the components of a PKI.

"Encryption" is the term used to describe the process of taking legible data, and scrambling it into a form that is non-intelligible to anyone who doesn't know how to unscramble (or "decrypt") it again.
Encryption processes usually involve a method for encrypting the data and one or more "keys". The keys are usually a very long number, and are used during the encryption or decryption process.
In most cases, the method (or "algorithm") that is used by an application to encrypt data is common knowledge and the key that is used is kept private.

There are two main types of encryption - "symmetric encryption" (the same encryption key is used for encryption and decryption), and "asymmetric encryption" (different keys are used for encryption and decryption).

Asymmetric encryption algorithms use two keys - a "public key" and a "private key". The algorithm usually involves a mathematical step that is very easy to do one way, but very difficult to do in reverse.

The algorithm is designed such that:

  • Anything that is encrypted using the public key can be decrypted with the private key.
  • Anything that is encrypted with the private key can be decrypted with the public key.
  • The keys are generated in such a way that it is not possible to determine one key if you know the other.
This method of encrypting data using a widely publicized public key and separate private key is also called "Public Key Cryptography" and is the type of encryption that is utilized by digital certificates.
Digital Certificates

A meaning for "certificate" is ďA document testifying to the truth of something". A digital certificate is an electronic "certificate" that contains information about a user and is used (among other things) to verify whom the user is. Digital certificates make use of Public Key Cryptography. The public key is stored as part of the digital certificate. The private key is kept on the user's computer, or in some hardware such as smart cards, i-keys etc.

Digital certificates are based on the IETF X.509 series of documents.

The main uses of digital certificates are:
  • Proving the identity of the sender of a transaction, non-repudiation and checking the integrity of transmitted data (via the use of digital signatures).
  • Encryption
  • Single sign-on (the digital certificate can be used as an authorization key to connect to computer systems.)
If digital certificates are to be used for security and identification purposes, all of the following conditions must be met:
  •  Every certificate is unique.
  • The owner of a certificate has been fully identified. All digital certificates are signed by the Certificate Authority (CA) that issues it. In issuing a certificate, the CA is basically saying that they have identified the user, and the user really is who they claim to be. To be able to trust a digital certificate, the CA needs to have fully identified the customer before issuing the certificate (or be satisfied that some other entity has adequately performed such identification).
  •  A private key can only be used by the owner of the certificate. As with all authentication schemes, the onus is on the user to keep the private key private. Usually a password, a smart card or biometric device is used to lock the private key and prevent others from using it.
Digital Signatures

A digital signature is a small amount of data that was created using some secret key, and there is a public key that can be used to verify that the signature was really generated using the corresponding private key. The algorithm used to generate the signature must be such that without knowing the secret key it is not possible to create a signature that would verify as valid.
Digital signatures are used to verify that a message really comes from the claimed sender (assuming only the sender knows the secret key corresponding to his/her public key). They can also be used to timestamp documents: a trusted party signs the document and its timestamp with his/her secret key, thus testifying that the document existed at the stated time.
Digital signatures can also be used to testify (or certify) that a public key belongs to a particular person. This is done by signing the combination of the key and the information about its owner by a trusted key. A digital signature of an arbitrary document is typically created by computing a message digest from the document, and concatenating it with information about the signer, a timestamp, etc. The resulting string is then encrypted using the private key of the signer using a suitable algorithm. The resulting encrypted block of bits is the signature. It is often distributed together with information about the public key that was used to sign it. To verify a signature, the recipient first determines whether it trusts that the key belongs to the person it is supposed to belong to (using the web of trust or a priori knowledge), and then decrypts the signature using the public key of the person. If the signature decrypts properly and the information matches that of the message (proper message digest etc.), the signature is accepted as valid.

A digital signature is created as follows:
  • A "digest" of the data is created. The digest is a short length of binary information and is based entirely on the contents of the data. A hashing algorithm such as MD4 or SHA is used to create the "hash" or digest. Hashing algorithms are designed such that changing just one character in the message would result in a different hashed value.
  • The hash is then encrypted using the private key of the person who is sending the message.
  • The encrypted digest is known as a "digital signature" and is attached to the message when it is sent.
When the message is received:
  • A hash of the message is again created, using the same hashing algorithm.
  •  The sender's public key is used to decrypt the digital signature, and this is compared to the digest of the message that has been generated by the receiver's software.
  • If both hashes are the same, then the data in the message has not been altered during transmission.
Given that only the owner of the digital certificate can create the digital signature (because they are the only person who has access to their private key), attaching a digital signature to a transmission also proves the identity of the person who sent it.

Several methods for making and verifying digital signatures are available. The most widely known algorithm is RSA.
Public Key Infrastructure

A Public Key Infrastructure (PKI) is made up of various software based services and encryption technologies that are used to facilitate trusted and encrypted transactions over an insecure network.

Digital Certificates are used in most practical implementations of a Public Key Infrastructure.

The PKI for an organization typically includes the following components:
  • Digital certificates - one for each user and server.
  • A Certificate Authority (CA) responsible for issuing certificates.
  • One or more Registration Authorities (RA) that are responsible for identifying users during the digital certificate registration process.
  • A Directory service - used to store information about users, including their public key.
  • The Directory service is usually based on the LDAP or X.500 protocols.
  • Software that is capable of using digital certificates, for example, Niyamas Tyootelery.
PKI uses a standardized set of transactions using asymmetric public key cryptography, a more secure and potentially much more functional mechanism for access to digital resources. The same systems can be used for securing physical access to controlled environments, such as your home or office.

In a PKI world, everyone would be issued at least one cryptographic key pair. Each key pair would consist of a secret (private) cryptographic key and a public cryptographic key. These keys are typically a 1024-bit or a 2048-bit string of binary digits with a unique property: when one is used with an encoding algorithm to encrypt data, the other can be used with the same algorithm to decrypt the data. The encoding key cannot be used for decoding. A responsible party such as a notary public, passport office, government agency or trusted third party certifies public keys. The public key is widely distributed often through a directory or a database that can be searched by the public. But he private key remains a tightly guarded secret by the owner. Between sender and receiver, secure messaging (or the other secure transaction) would work as described below.


For the sender (Fig 1) the following steps occur:

  • Message data is hashed; that is a variable -length input string is converted to a fixed- length output string. Hash functions are mainly used with public key algorithms to create Digital signatures.
  • A symmetric key is created and used to encrypt the entire message. DES and IDEA are examples of symmetric key cryptography.
  • The symmetric key is encrypted with the receiver's asymmetric public key.
  • The message hash is encrypted with the sender's asymmetric private key, creating a digital signature independent of the encrypted message.
  • The encrypted message, encrypted symmetric key and signed message hash are send to the receiver.


For the receiver (Fig 2) these steps occur:

  • The encrypted symmetric key is decrypted using the receiver's asymmetric private key.
  • The symmetric key is then used to decrypt the message body.
  • The encrypted hash is decrypted with the sender's asymmetric public key.
  • The decrypted message is then rehashed with the original hashing algorithm.
  • The two hashes are compared to verify the senders identity and serves as proof that the message was not altered in transit.
Issues surrounding PKI

Through the use of PKI and digital signature, one can prove to a third party or the court that a particular piece of electronic document is authentic and can be traced to the person who has digitally signed the document or transaction. This works because the cryptography and mathematics underlying a PKI system ensure that digitally signed documents cannot be forged. The digital certificate can be thought of as the electronic equivalent of the identification card. Thus, the authority which issues the digital certificates (known as Certificate Authority) must be highly trusted and secure.

Besides security, there are other issues related to PKI - technology, legal framework and standards. The technology for PKI has been around for more than a decade and is relatively mature and a number of countries have introduced legislation to recognize the validity of digital signature.

The lack of commonly accepted industry standards for policies and business practices surrounding PKI is probably the reason why PKI has not yet taken off in a big way. Now, after introduction of IT Laws by many countries has enabled a standard for business transactions. Forums like Asia Pacific PKI Forum allow inter-operability to its digital certifying authority licencees with their counterparts in the member countries of that region. As financial institutions sign on to these policies and business practices, their customers will create an extensive global system of known and trusted businesses. Once certified by a Certification Authority, a trading partner can authenticate any other party with assurance. Even if a trading partner is from another part of the world, the fact that he is a certified member (through the trust relationship with his bank) makes trading viable and reduces the risk of transacting in the global system. By virtue of commonly accepted standards, trading partners will know that:
  • Their transactions are legally binding;
  • They have recourse in the event of a dispute or a potential fraud situation; and
  • They can place legal and practical trust on the electronic identity issued by any Certification Authority
Certificate Authority (CA)

A Certificate Authority (CA) is a third party that is responsible for issuing digital certificates to users. Each digital certificate that the CA issues, is digitally signed by the CA's private key.

This is to ensure that the digital certificate has not been tampered with.

Each CA has its own procedure for identifying users. The procedure is usually listed in the CA's Certificate Practice Statement (CPS). Identification procedures range from little or no identification, through to a user having to provide 100 points worth of ID before being issued with a digital certificate.

Ideally, a CA is trusted, and always follows their advertised Certificate Practice Statement.

Typically, browser software (for example, Niyamas Tyootelery) gives users the option of marking a given CA as trusted or not trusted. A Certificate Authority also runs and maintains the server that contains the certificate database, maintains a list of any certificates that have been revoked, and publishes public keys and the revocation list into a publicly accessible directory service. The CA is also responsible for making sure that the server itself is physically secure, and that the CA's private key is not compromised. Certificate Authorities are usually arranged in a "chain" where any given CA has its root key signed by the next CA up the chain. The CA at the root or the top of the chain signs its own root key. If a given CA is trusted by a user's software, every subordinate CA below it in the CA chain is automatically trusted since the trusted CA has vouched for the trustworthiness of all Certificate Authorities below it.
Registration Authority (RA)

Before a user can be issued with a digital certificate, they need to be identified according to the procedures of the Certificate Authority that is issuing the certificate. This registration process is often handled by a separate Registration Authority (RA).

A Registration Authority is responsible for identifying users and notifying the Certificate Authority that the user is allowed to be issued with a digital certificate. The RA does not sign or issue digital certificates directly.