Приглашаем посетить
Клюев (klyuev.lit-info.ru)

19.5 Data security with public-key technology

Table of Contents

Previous Next

19.5 Data security with public-key technology

19.5.1 Conventional and public-key cryptography

Conventional encryption methods only use one key for encryption and decryption. The sender encrypts the message or document with this key and sends it to the receiver. In order to decrypt this document, the receiver has to have the same key.

The advantage of the algorithms in these methods is that they are fast, efficient, and computationally safe. Some popular implementations are:

  • IDEA [IDEA]

  • Blowfish (128-bit key, 16 rounds)

  • DES (DES-EDE)

  • CAST5 (128-bit key, known as RFC 2144)

For further information, the description and algorithm of the first three are available from the "Cypto C-Source" Web site (www.cc.jyu.fi/~paasivir/crypt/source.html). The CAST5 algorithm is DES-like and is an IETF standard known as RFC 2144.

For conventional methods to work, the key must be provided to the receiver in such a way that others won't be able to obtain it. If somebody else does have the key, this entire security will be compromised. Due to the secrecy nature of the key, these encryption/decryption methods are called secret-key (or symmetric) cryptography.

The use of the so-called public keys can solve this major problem. Instead of using only one key, public-key cryptography is a concept where two keys are involved. One key is a public key that can be widely published and can be obtained by anyone. Many people suggest that a public-key server should be involved. The other key is a secret (or private) key and should be kept secret permanently. It is computationally infeasible (or difficult) to derive the secret key from the public one. When you encrypt a message with one key, the other key must be used to decrypt the message.

An additional use of public-key technology is in digital signatures. In this case, the role of the private and public keys is reversed. If a sender encrypts a document using his or her private key, everyone can decrypt and read the document by using the sender's public key. Since only the sender of the document has the secret key, he or she must have sent the document. This digital signature can also be used to prevent repudiation: the sender cannot claim that he or she did not actually send the message. In common practice, the private key is used to encrypt an MD of the document as the signature from the sender.

In general, the idea of public-key technology is based on prime number factorization. An internationally recognized public/private-key algorithm is named RSA after its creators (Ron Rivest, Adi Shamir, and Len Adleman). A brief discussion of this algorithm will be introduced shortly.

19.5.2 Hybrid cryptography

In many cases, conventional encryption/decryption with one key can provide more efficient and safer protection against intruders. Therefore, most advanced cryptographic systems nowadays offer hybrid methods to take advantage of both methods. Most implementations of hybrid cryptography would involve the following:

  • Use conventional methods to encrypt a message.

  • Use a public-key method to encrypt the digital key from the conventional method.

  • Send the encrypted message and encrypted digital key to the recipient.

  • Get the recipient to use his or her private key to decrypt the digital key.

  • Then get the recipient to use the decrypted digital key to decrypt the message.

Using hybrid methods, you can solve the key distribution problem and get stronger protection against intruders than with secret-key cryptography. All techniques related to digital signatures can also apply to hybrid methods.

The first commercial product of public-key technology and hybrid methods is Pretty Good Privacy (PGP) developed by Philip Zimmermann. Based on this product, an IETF standard known as RFC 2440 (or OpenPGP) was established in November 1998. Complying with the standard, a freely available implementation of OpenPGP was developed by GNU called Gnu Privacy Guard (GnuPG).

A quick tour of GnuPG with examples is provided in section 19.6 so that we can put public-key security into practice. For now, let's consider a basic public-key algorithm.

19.5.3 A brief discussion on the RSA public-key algorithm

A well-known public-key algorithm is called RSA after its creators Ron Rivest, Adi Shamir, and Len Adleman, the founders of RSA Data Security Inc. Basically, the algorithm can be used to generate two keys for encryption and decryption. One key is called public and the other, obviously, is called private. The algorithm can be briefly described in the following four steps:

Step 1. Find the prime numbers p and q and their product pq

  • Search for two, large random, and distinct primes p and q.

  • The values of p1 and q1 should not have a large common divisor.

  • Compute the product pq.

Step 2. Compute the encryption (e) and decryption (d) exponents

  • Calculate the encryption exponent e such that

    e < pq

    and e is relatively prime to p1 and q1.

  • Calculate decryption exponent d such that

    d = e 1 mod lcm(p1,q1)

    i.e., the inverse of e modulo the least common multiple of (p1, q1). The least common multiple lcm(p1,q1)is the smallest number divisible by p1 and q1.

Step 3. Output the public and private keys

  • Output the values of e and pq as the public key.

  • Output the values of d and pq as the private key.

Step 4. Perform encryption and decryption

  • Encryption: given a message m, the ciphertext c can be computed using the public key by

    c = me mod pq

    where e and pg are the information in the public key.

  • Decryption: given a ciphertext c, the plain text m can be computed using the private key by

    m = cd mod pq

    where d and pq are the information in the private key.

This algorithm is widely used in many systems, both private and public, to provide data security and digital signatures on an insecure transmission environment such as the Internet. From a practical point of view, any implementation of this algorithm should consist of three parts: keys generation, encryption, and decryption. There are a number of program codes and libraries related to this algorithm available on the Internet and a good place to find and download them is the site www.cc.jyu.fi/~paasivir/crypt/source.html.

A practical implementation of public-key and hybrid technologies is called Gnu Privacy Guard (GnuPG). We will provide a quick tour in the next section on how to use it to protect data against attack.

    Table of Contents

    Previous Next