English

Looking for Something?

Digital Signature - Why And How You Should Use It

Digital SignatureDigital signatures are severely underutilized in the modern world.

They help protect documents and files from being accessed by unwanted personnel. Unfortunately, they aren't always the easiest of things to set up.

To brush up on digital signatures, how they work, and why you should use them, keep reading!

What Is A Digital Signature?

What is a Digital SignatureBriefly, a digital signature is a type of electronic signature that helps with authenticating a file by encrypting it with a code that is particularly hard to reproduce.

Developers can sign their files with digital signatures, which employ a form of asymmetric cryptography (public keys and private keys) to verify that a file is exactly what it claims to be.

Digital signatures work very much like key pairs in PGP (which is no surprise as they are basically the same technology, and as we shall see, verifying digital signatures requires using a PGP-compatible client.) Unfortunately, this also means that like PGP, using digital signatures is a real pain in the butt…

Digital Signature Diagram

Digital Signature Verification

Digital Signature VerificationTo verify a file’s digital signature, you must use a PGP client (or more accurately GnuPG – its open source clone). Versions of GnuPG are available for Windows (Gpg4win), Mac OSX, and Linux (usually pre-installed).

In this tutorial, we will verify the Digital signature of Pidgin + OTR using Gpg4win, but the process is very similar for other versions of GnuPG.

We have a two-part article on using Gpg4win, and we strongly recommend reading at least Part 1 of it to familiarize yourself with key concepts that will be used below.

The Gpg4win download is itself digitally signed with a key that has been verified by a recognized certificate authority (CA), and which can be independently checked for verification using a trusted older copy of GnuPG (an SHA1 hash is also available). You should never trust a copy of Gpg4win that you have not verified.

Once GnuPG is installed, we need three things to verify a digital signature:

These files should all (hopefully) be provided by the developer whose digitally signed files you wish to verify. Public key/PGP Certificates are often stored on a keyserver, but the devs should provide instructions for accessing them.

How to Create a Digital Signature

Creating a digital signature is not difficult, to demonstrate, we will be using Kleopatra. Kleopatra is a key management program bundled with Gpg4win.

  1. You will need a personal private key to certify the PGP certificate. If you have created one before (for example using GPA), then you can import it (File -> Import Certificates…), or you can create a new key pair (File -> New Certificate…).
    Create a Digital Signature
  2. Import the public key/PGP certificate into Kleopatra – using either ‘Import Certificates’, or right-clicking on the file and selecting ‘Import keys’.
  3. Certify the PGP certificate using your private key – this tells GnuPG that you trust the person who signed the certificate.
  4. In Kleopatra right-click on the key and select ‘Certify Certificate’.
  5. Select the certificate, and confirm that you have verified its fingerprint (hopefully this will be published on the developer’s website, but see also below for further discussion on this point).
  6. Unless you are very sure about the authenticity of the certificate, then you should Certify only for yourself (certificates work on the principle of a web of trust – the more people who trust them, the more certain you can be they are genuine).
  7. Enter your private key passphrase to finish verifying the certificate.
    Valid Signature
  8. Now that you have certified the Certificate used to make the signature for the file you have downloaded (whew!), you can use it to verify the signature.
  9. In Kleopatra go to File -> Decrypt/Verify files and browse to the signature file, or right-click on it and go to MoreGpgEX options -> Verify.
  10. Ensure ‘Input File’ is the signature file, and that the ‘Signed data’ field contains the program or file you wish to verify, then hit ‘Decrypt/Verify’.
  11. All being well, Kleopatra will declare the signature valid. Yay!
    Kleopatra - Certify Digital Signature

Other Ways of Creating a Digital Signature

There are other ways of creating digital signatures, with other software as well. If you need instructions for creating them, then Google will be your best option.

Digital Signature Certificates

Digital Signature CertificatesThe simplest way to verify that a PGP Certificate is valid is to check the website of the person who is supposed to have signed the certificate… with a bit of luck, it will publish the fingerprint of the certificate.

However, although easy, this does not guarantee the authenticity of the signature, as the website may have been hacked or forced by a government to display a fake fingerprint (the same problem that plagues cryptographic hashes).

This is where the web of trust comes in, where users vouch for a certificate. In practice, this is an arcane process that is both too complex and too obscure for most users, so the best that most of us can hope for is that the certificate has been vouched for by a recognised Certificate Authority, or is signed by known developers who publish their signing keys (as the Tor developers do, for example).

Pidgin + OTR is in some ways a bad example of how digital signing should work because the OTR webpage comes with almost no instructions on how to use its published keys. Its PGP Certificate was not only very difficult to locate but other than being available from https://otr.cypherpunks.ca/gpgkey.asc there is no easy way to verify its authenticity (the fact that uses a 1024-bit RSA key is also poor show in this age when the NSA can probably crack such weak encryption).

It is, however, a good example of why the whole notion of digital signatures is such a mess! An interesting discussion on how you can attempt to verify the OTR Certificate is available here.)

Conclusion

Digital Signature Conclusion 150X150As you can see, verifying a digital signature really is a pain, so it is little wonder that even those who understand the jargon-heavy arcane process rarely bother. The issue is made even worse by many devs failing to explain how to verify their files, and/or issuing sloppy PGP Certificates that are very hard to verify are genuine (OTR-team, we are looking at you!)

The fact that digital signatures remain the only meaningful way to guarantee that files you download are the ones you intended to download (or that their devs intended you to download), does not bode well for internet security.

However, until someone invents a better, more user-friendly system, our best hope is to encourage devs to provide clear instructions on how to use their digital signatures, and to publish meaningful guarantees as to the authenticity of their PGP Certificates… (sigh)

Written by: Douglas Crawford

I am a freelance writer, technology enthusiast, and lover of life who enjoys spinning words and sharing knowledge for a living. You can now follow me on Twitter - @douglasjcrawf.

0 Comments

We apologize, our comments section is under maintenance. Please check back soon.