BRAND: Digital Certificates

Digital Signatures and Digital Certificates

Learning Outcomes

After completing these activities you should be able to:


In this lesson, we will cover two topics that sound similar, but have very different purposes. Be careful and precise when using this terminology while being able to identify what these specific security tools provide. Digital Signatures are the result of a cryptographic transformation that provides a mechanism to verify the authenticity, integrity, and non-repudiation of a message. Digital Certificate (aka Certificate) is used to uniquely identify a public key and an owner that is authorized to use the key pair. We will discuss each of these in more detail in the lesson below.

Digital Signatures

The first security tool that we will discuss is digital signatures. A digital signature complements and uses asymmetric encryption and hashing so it may be a good idea to do a quick review of asymmetric encryption and hashing prior to starting this section.

Digital Signature - Example

To learn everything you wanted to learn about digital signatures you can visit the NIST website and view the Digital Signatures Standard (DSS) also known as Federal Information Processing Standards Publication (FIPS) 186-5.

Digital Signatures and Certificates in COVID


Digital Signatures and Certificates are being used for more than internet security and upholding our pillars. The EU has proposed and in some cases, used Digital Certificates for travel during the COVID-19 pandemic. This infographic demonstrates how this works at a high level.

Your CAC knows crypto.

Your CAC supports a number of different cryptographic algorithms, including:
Hashing: SHA-512
Symmetric encryption: AES-256
Asymmetric Encryption: RSA-2048
... and others. Included on your CAC are public/private key pairs that you can use to decrypt e-mails intended only for you, and to digitally sign documents.

Concerns About Trust: Man-in-the-middle attacks

The Problem. Asymmetric encryption is almost magical — you create security out of insecurity. However, there is still one weakness in the system that's fundamental: certifying the connection between a public key and its associated identity. Man-in-the-middle is a form of attack that can be carried out in a variety of scenarios. We will describe it in terms of attacking Rivest-Shamir-Adleman (RSA) public-key/asymmetric encryption, though this is just one kind of man-in-the-middle attack.

RSA guarantees us the following: you can carry on communication with the owner of public key Kpub and be sure that:

  1. messages you receive can only be read by you, and can only have come from the owner of Kpub
  2. messages you send can only be read by the owner of Kpub, and the owner of Kpub will know that they could only have come from you.
With the usual Alice and Bob scenario, Alice's public key KApub is out there on the Internet, as is Bob's public key KBpub. Alice "owns" KApub because she alone has the matching private key KApriv. Similarly, Bob "owns" KBpub because he alone has the matching private key KBpriv. This is illustrated by the diagram to the right. Following our usual plan, Alice sends Bob the plaintext message msg by:

plaintext encrypt with KApriv ciphertext1 encrypt with KBpub ciphertext2

... and she sends him ciphertext2. This works great, as long as Alice is really sure that KBpub belongs to the person she knows as "Bob". When that's no longer true, things get ugly.

Suppose we have our usual enemy Eve throwing a public key KA'pub up on the Internet and claiming it's Alice's public key, and throwing a public key KB'pub up on the Internet and claiming it's Bob's public key. The diagram to the left illustrates this. Now Alice thinks she's encrypting her message with Bob's public key, but the public key KB'pub she uses really belongs to Eve. Eve then decrypts and reads the message, perhaps modifying it a bit, and then encrypts it using the real Bob's public key. The real Bob receives the message none the wiser.

What if Alice encrypts with her private key KApriv first, and then with the key KB'pub she thinks belongs to Bob? Then Eve decrypts with her key KB'priv followed by Alice's public key KApub and she has the plaintext message from Alice. Once again, she reads the message or changes it. Then Eve encrypts with her fake key KA'priv first, and then with Bob's public key KBpub. Bob is able to decrypt the plaintext message. Because doing so required KA'pub, the key he believes to be Alice's public key, he thinks this message really must've come from Alice, and that nobody could have read it but himself.

This is called a Man-in-the-middle Attack. Eve, obviously, is the "man-in-the-middle" here. Eve needs to pull off some kind of misdirection to make Alice believe KB'pub really belongs to Bob, and to make Bob believe KA'pub really belongs to Alice. But we've seen how to trick people with spam e-mails, misleading links, and convincing copies of web pages, which are a few possible ways to do this.

Common Access Cards (CAC) and Department of Defense (DoD) Public Key Infrastructure (PKI)

Your CAC is a perfect real-world example that brings together a lot of what we have talked about: The cybersecurity tenants (Confidentiality, Integrity, and Availability), symmetric encryption, Asymmetric encryption, digital signatures, and digital certificates.

Anyone who receives a CAC must sign* a DD Form 2842:

"You have been authorized to receive one or more private and public key pairs and associated certificates.

"The certificates and private keys will be issued on a Common Access Card (CAC).

"A private key enables you to digitally sign documents and messages and identify yourself to gain access to systems. You may have another private key to decrypt data such as encrypted messages.

"People and electronic systems inside and outside the DoD will use public keys associated with your private keys to verify your digital signature, or to verify your identity when you attempt to authenticate to systems, or to encrypt data sent to you.

*Note: the DD2842 itself can be digitally signed!

DoD PKI Infrastructure
The Department of Defense has its own Certificate Authorities. You can view and download them at DoD's PKI management site: https://crl.gds.disa.mil/. The DoD PKI is managed by DISA (Defense Information Systems Agency).

Digital Certificate Basics

Let's add a new actor to our Alice/Bob/Eve play. Suppose there is a fourth party named Cedric, who is trusted by both Alice and Bob. Cedric has the public/private key-pair KCpub/KCpriv, and Alice and Bob both know his public key. Suppose Alice presented Cedric with her name "Alice" and public key KApub, in such a way that Cedric was satisfied that he was really dealing with Alice. Cedric could make a certificate by encrypting the string Alice:KApub with his private-signing key, KCpriv. Alice could send Bob this certificate before they start encrypted communication. Bob would decrypt with Cedric's public-signing key KCpub, and get the name Alice and the public key KApub. Because Bob knows that KCpub really belongs to Cedric, he knows that the certificate really was created by Cedric — because it takes Cedric's private-signing key to create something decryptable with his public-signing key. Moreover, since Bob trusts Cedric, he now believes that the key KApub belongs to the identity "Alice".

Digital Certificates Standard - X.509

X.509 is a standard for a Public Key Infrastructure. An X.509 Certificate is a file that a user or a program can use to verify that public key K really belongs to identity I. A Photo ID like a passport does a similar thing for you: it certifies that your name really belongs to your face. Provided a person assures himself that your passport is valid, i.e. not fake, he'll probably believe that your name really does belong to your face. That belief is based on trust: a trust that the U. S. government probably wouldn't issue that passport to you unless the name in the passport was really yours. X.509 certificates work the same way, they are issued by a certificate authority, and if you trust that certificate authority and you assure yourself of the validity of the certificate, then you trust that public key K really belongs to identity I.

Conceptually, a certificate has three pieces of information:



The certificate binds an identity to the public key using the CA's digital signature, which can be verified, providing non-repudiation and integrity to the digital certificate.

Certificate authorities have certificates as well, and you need that certificate in order to verify that a certificate is valid. So a participant in this system keeps on hand the certificates of one or more certificate authorities it trusts. When a certificate is received for some entity with whom he wants to communicate, he looks at the issuer's identity: if that matches the common name of one of the authorities he trusts, he'll take the certificate for the authority and use it to verify the new certificate.

Identity and Web Servers

At first blush, the fact that Man-in-the-middle attacks work seems to indicate that RSA (or public key cryptography in general) has failed us. After all, wasn't it supposed to provide a guarantee that if Alice sends Bob a message, Bob can be sure that message really did come from Alice? In fact, this is not what RSA/Asymmetric Encryption guarantees. If Bob decrypts with his private key followed by the public key Kpub, he is only guaranteed that the message was really sent by the owner of Kpub. He has no guarantee of the identity of the owner of Kpub! So RSA has worked perfectly. It's provided exactly the guarantee it said it would provide. But we need something more in order to be safe from Man-in-the-middle attacks. What we need is a way to match public keys with identities.

xkcd.com/1121/

It's important to note that this is not merely a technical problem. What constitutes "identity" is a social problem, and maybe even a philosophical problem. However, once we've decided what identity means, at least in a limited context, we need technical tools to help bind identities to public keys — a "public key infrastructure" (PKI). The particular system we will look at is based on X.509 Certificates, and it's responsible for mapping identities to public keys in, for example, web browsing with HTTPS.

Let's consider the problem of Man-in-the-middle Attacks on secure web communications, i.e. when using HTTPS. A man-in-the-middle attack would look like this: you want to check your balance at the Navy Federal Credit Union, so you enter the URL www.navyfcu.org in your browser's address bar. RSA is used to provide secure communications between your browser and the web server (actually, it's only used at the beginning in order to agree on a secret key for that session, after which symmetric encryption is used). A Man-in-the-middle attack would mean that the public key your browser thought belonged to www.navyfcu.org actually belongs to some bad guy. So what does "identity" mean in this context? You think you're communicating with Navy Federal Credit Union. Your browser thinks it's communicating with www.navyfcu.org. RSA thinks it's communicating with public key (4f32 .... 7e). So there are different notions of who exactly we're communicating with.

  1. RSA is responsible for secure, authenticated communication with public key (4f32 .... 7e).
  2. The X.509 Certificate system is responsible for certifying that the public key (4f32 .... 7e) really belongs to domain name www.navyfcu.org.
  3. The user is responsible for knowing that the domain name www.navyfcu.org really belongs to the Navy Federal Credit Union.
In other words, X.509 Certificates certify the mapping of domain names to public keys.

Certificates in the News

Read the following articles to learn more about the importance of Digital Certificates.