Protecting your privacy: asymmetric cryptography (part 2)

This is the second of four posts in which I discuss cryptography. If you read all four posts, you will understand the differences between symmetric and asymmetric cryptography, why the US government were against the spread of modern cryptography, how it has resulted in the first crypto war between code rebels (techno-libertarians) and the US government, and how you can easily protect your privacy using Pretty Good Privacy (PGP).

The topics of the four posts are:

  1. What is symmetric cryptography;
  2. What is asymmetric (public key) cryptography;
  3. The first crypto war between code rebels and the government;
  4. How to easily use PGP to protect your e-mail communication.

What is asymmetric (public key) cryptography

In my previous post, I mentioned four disadvantages of symmetric cryptography. These disadvantages are:

  1. The secret key must be shared between sender and receiver, before messages can be exchanged safely, preferably over a secure channel.
  2. The secret key is in two separate places.
  3. The sender of the message must trust the receiver that he will not steal or copy the secret key.
  4. It is not scalable for, for example, e-commerce.

Soon after the publication of the Data Encryption Standard (DES), asymmetric (public key) cryptography was invented by the Stanford graduate student, Whitfield Diffie, and Stanford Professor, Martin Hellman. This was a huge revolution within cryptographic research, because up until then it was thought that there should always be a shared secret key for the communication between the sender and receiver. The main question that Diffie and Hellman were trying to solve was: how can you create secure communication over a unsecure channel, when two corresponding people have never had contact with one another and therefore have not yet been able to share secret keys with each other.

The solution, public key cryptography, was introduced by Diffie and Hellman in their paper, ‘New Directions in Cryptography’ (1976). It inspired more cryptographic research outside the circles of secret agencies. Soon after the first publication on public key cryptography, three young Professors at MIT, Ron Rivest, Adi Shamir and Leonard Adleman, developed the now famous RSA public key cryptosystem in 1977.

Merkle Diffie Hellman
Ralph Merkle, Martin Hellman, and Whitfield Diffie. Merkle is known for his invention of Merkle trees, which is a tree-like structure of cryptographic hashes that organizes for example Bitcoin transactions. The public key cryptosystem, as published in ‘New Directions in Cryptography’, is mostly known as the Diffie-Hellman key exchange. Hellman, however, recognizes the contributions of Merkle for the Diffie-Hellman key exchange.
RSA
Adi Shamir, Ron Rivest, and Len Adleman. Inventors of the RSA cryptosystem.

Public key cryptography works as follows. There are two separate keys that correspond mathematically with one another: the public key and the private key. The public key is used to encrypt a message, and can be shared to other people. The private key is used to decrypt a message, and should be kept secret. Public key cryptography is hence a two way function. Just by knowing someone’s public key, it’s not possible to find out the person’s private key.

In our below example,

  1. Alice would like to send a secret love message to Bob.
  2. Bob has a corresponding public an private key, and sends the public key over a unsecure channel to Alice.
  3. Alice uses Bob’s public key to encrypt her secret love message.
  4. Alice sends the secret love message to Bob.
  5. Bob uses the corresponding private key to decrypt the message and finds out that Alice loves him.
Public Key cryptography
Alice and Bob use public key cryptography to exchange secret messages.

Doing so, you can have private correspondence over an unsecure channel. Actually, we’re using public key cryptography all the time. Whenever you see a green padlock in front of the URL bar, it means that the data you enter on the website is first encrypted before it’s sent out.

Digital Signatures

Public key cryptography is not only used for the encryption and decryption of messages, but also for message authentication. If Alice would not have encrypted her message with Bob’s public key, but with her own private key, then the encrypted message can be decrypted with her public key. If you receive a message of John Locke and you’d like to know whether it’s really sent out by Locke, then you could look up his public key and use it to decrypt his message. If the result is plaintext, and assuming that Locke is the only person in the world who possesses the only private key that can produce the encrypted message, you can be sure that the message was sent by Locke. In other words: applying a private key to a message is the equivalent to putting a digital signature.

Digital Signatures
Alice puts a digital signature on her message, and Bob digitally verifies that the message is truly coming from Alice. This is an easy way of using digital signatures. In reality, a text is hashed first with a hash algorithm, before it is encrypted with the private key. Bob then uses Alice’s public key to decrypt the message to retrieve the hash, and compares the resulting hash with the original hash of Alice’s message.

Digital signatures are particularly important, because they provide the following security aspects:

  1. Authentication: it offers proof that the message comes from the right person.
  2. Non-repudiation: we cannot deny that the signee has sent it.
  3. Data integrity: the message cannot be altered after it has been signed.

Diffie and Hellman saw great potential for public key cryptography in the coming digital age. The US secret intelligence, however, were not happy with this development in cryptography and tried to prevent public use of this new cryptosystem. The standoff between privacy advocates of whom many were cryptographers and the US government is known as the first crypto war.

In part three of this series, we will discuss the crypto war. Eventually, at the end of the post series, you will be able to encrypt your e-mails using public key cryptography.

Please keep it civil

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s