Digital certificates and signatures

Digital signatures are one component of what is called a public key infrastructure ( PKI ). PKI provides mechanisms and process for ensuring the confidentiality and integrity of digital information. It allows someone to prove his/her online identity and that documents and communications ( e.g. email and banking transaction ) haven’t been tampered with.

"Padlocks_128"Recently the topic of spam came up in one of the meetings of the PMUG. Someone suggested that digital signatures were one solution to the problem of spam, but there was no clear understanding of digital signatures and how they help with the spam problem. I intend to write a concise but easily understood series of article on digital signatures, email encryption, and how to use it on Mac OS X ( with Mail.app ).

What is a digital signature?

According to Wikipedia:

A digital signature or digital signature scheme is a type of asymmetric cryptography used to simulate the security properties of a handwritten signature on paper.

Digital signatures are one component of what is called a critical public infrastructure ( PKI ). PKI provides mechanisms and process for ensuring the confidentiality and integrity of digital information. It allows someone to prove his/her online identity and that documents and communications ( e.g. email and banking transaction ) haven't been tampered with.

How does it work?

The science behind PKI involves some very complicated math. It consists of finding the factors of vast prime numbers. These factors are used to create two keys, one private and one public. The private key is kept strictly confidential and is not shared with anyone, while the public key is distributed widely. Messages encoded with the private key can only be decoded with the corresponding public key and signal encoded with the public key can only be decrypted by the private key.

How is this useful for digital signing?

The idea is to take a piece of digital data and, using a mathematical algorithm, compute a large number called a hash - a small digital "fingerprint" made from any data. The hashing function should create a unique hash for any particular piece of data. If the data changes, then the hash will also change, and we will know that the data has been tampered with.

To digitally sign a document, we compute the hash of the document and then encode the hash using the private key. Since the data was encoded with the private key, it can only be decoded with the corresponding public key. To verify that the document ( e.g. an email message ) came from that user, decrypt the hash using the widely known public key, compute a new hash from the received document, and compare against the hash that was sent. If the hashes do not match, we know that the document was tampered with. We know who sent the message because only that user has the private key used to encode the message.

How do I know the person sending the message is the person posting the message?

How do I know that the doctors are a doctor? That the lawyer knows the law? In the end, everything in security boils down to trust, but verify. In the real world we have authorities that certify that the doctors and lawyers ( teacher etc.) know what they are doing. The doctor or lawyers has been issued a license (certificate) to practice their craft. Similarly, PKI has the concept of a Certificate Authority (CA).

The user securely creates a private key, and the CA signs the users public key with their private key. This places their stamp of approval on the user digital certificates. The system is very heavily dependent on the trust placed in the CA. If the private key of the CA is compromised, the entire PKI system is at risk since anyone could use that private key to create digital certificates. Similarly, if the user loses his/her private key, then anyone could digitally impersonate that user.

How does it all work together?

  • "A" and "B" want to exchange confidential message. - A creates a message and encodes the message ( and the message hash ) using B's public key. B receives the message and decodes the message using his/her secret private key. B is the only one who can decrypt the message because B has the private key.
  • "A" wants to send "B" a ( non-confidential ) message but B wants assurances the message did come from A. -A creates a message and encodes the hash of the message using her private key. B received the message and decoded the hash using As the public key. B knows the message came from A because only A has the private key to encode the hash.

What's Next?

In my next article, I plan to show how to use the digital certificate, and digital signature to make your email more secure.

References:

Cross-posted from the Princeton Macintosh User's Group

Author: Khürt Williams

A human who works in information security and enjoys photography, Formula 1 and craft ale. #nobridge

6 thoughts on “Digital certificates and signatures”

Comments are closed.