• No se han encontrado resultados

6. RESULTADOS Y DISCUSIÓN

6.2 DISEÑO DEL PLAN Y ESTRATEGIA DE EDUCACIÓN AMBIENTAL

6.2.4 Objetivos y Acciones Propuestas por Meta del PEA-QE

Hashing and encryption algorithms are used for the most basic authentication procedures and for the highest security encryption of data. Each algorithm takes as input the raw data to be transmitted and a key. A key is a binary value that is used to lock and unlock the data. Keys vary in length from 32 bits to 256 bits or larger—for any specifi c algorithm it is generally the case that the larger the key, the more diffi cult it is to crack the encryption code.

As described in the preceding sections, authentication algorithms use the data and key to generate an authentication code. The receiver can run the same algo- rithm with the same key on the received data and compare the resulting authen- tication code to the one transmitted with the data. Encryption algorithms use the key to convert the data into a series of apparently meaningless bytes that the receiver must unscramble before they can be used. The data may be unscram- bled using a paired algorithm and a partner key corresponding to those used for encryption, or the same algorithm and the same key may be used, depending on the encryption technique employed.

The most basic hashing algorithm is the cyclic redundancy check (CRC). CRC is used in IP to validate that data has not been accidentally modifi ed, for example, by errors during the transmission process. It is valuable for that purpose and will dis- cover a very high proportion of accidental errors, but it is of absolutely no use as an authentication algorithm since there are well-known procedures for modifying the CRC value for any change made to the data. More complex hashing algorithms are used for authentication in conjunction with a security key.

Encryption algorithms tend to be more complex and have longer keys. The standard minimum encryption algorithm is the Data Encryption Standard (DES) described in Section 5.7.2, but many more sophisticated approaches have been developed. There are two keying techniques used in cryptography; the secret key model has already been described and functions by the sender and receiver both knowing (and keeping secret) the key so that they can successfully exchange data.

5.7 Hashing and Encryption: Algorithms and Keys

CH05-P374463.indd 133

134 CHAPTER 5 Concepts in IP Security

This is a fi ne procedure, but as already explained it requires some form of key exchange between end points. This is not only insecure, because someone might intercept this key exchange, but it is dependent on the trustworthiness of both the sender and the receiver since, for example, once the receiver knows the send- er’s key he or she can impersonate the sender or intercept other encrypted data.

Curiously, the solution to this problem is to make the key public knowledge. In public key cryptography one algorithm but two keys are used: one to encrypt the data and the other to decrypt it. One of these keys is freely advertised but the other is kept secret. So, for example, a node wishing to receive secret data would advertise the encryption key to use, but would keep secret the decryption key. The remote node would use the advertised (public) encryption key to encode the data and would send it to the recipient where it could be decoded using the secret key. Conversely, a node wishing to prove its identity will advertise a pub- lic decryption key, but keep secret its encryption key—in this way anyone can

decode its digital signature and know that only the owner of the secret encryp-

tion key can have sent the message. This technique can be extended to message digest techniques to provide public key authentication.

In practice, algorithms that use two keys ( dual key algorithms ) are more com- plex and slower to operate since they require each byte of data to be handled many times. This makes them far from ideal for use in bulk data transfer, but for- tunately a solution exists. A secret key algorithm is used to encode the data (that is, it is encrypted using an algorithm that can be encoded and decoded using a single key) and the secret key itself is encrypted using a public key algorithm. The encrypted secret key need only be exchanged once for each transaction and can be used to decode all of the data.

5.7.1 Message Digest Five (MD5)

The simplest authentication hashing algorithm in popular use is the Message Digest version 5 (MD5) algorithm described in RFC 1321; RFC 1828 describes how to apply the algorithm to authentication. Support for this algorithm is mandated in several protocols (such as RSVP) and must be supported as a minimum require-

ment of IPsec. MD5 produces a 16-byte authentication code (the message digest )

from data of any length with or without a key of any length. Without a key, MD5 can be used like the CRC to detect accidental changes in data. It can be applied to individual messages, data structures, or entire fi les. But since a hacker could readily recompute the message digest and so mask a malicious change to the data, a key is used (appended or prepended to the data) to make it impossible for a third party to determine the correct MD5 authentication code of a modify packet.

Figure 5.14 shows some sample code to implement the MD5 authentication algorithm by way of evidence that even the simplest authentication algorithms are nontrivial. The guts of the algorithm are the RSA Data Security, Inc. MD5 Message-Digest Algorithm and are copied from RFC 1321. In the code, a top- level function, MD5( ), is called with a data buffer and a key; it returns a 16-byte authentication code. This function processes the following strings in turn: the key,

CH05-P374463.indd 134

135