Data Encryption and Data Compression

It was decided to let the presentation layer handle all the problems relating to the representation of transmitted data, including conversion, encryption and data compression.

Unlike the lower five layers, which merely deal with the orderly movement of bits from source to destination, the presentation layer is concerned with preserving the 'meaning' of the information transported.

It is the job of the presentation layer to encode structured data from the internal format used on the sending machine to a bit stream format suitable for transmission , and then to decode it to the required representation at the destination.

The organisations that operate computer networks frequently expect to be paid for their efforts. In nearly all cases , the cost of using a network depends on the amount of data sent. So the final bill can often be reduced by compressing the data before sending it.

Data compression is related closely to data representation. One way to transmit a 32-bit integer is to simply encode it as four bytes and send it on its way. However, if it is known that 95% of the numbers sent are between 0 and 250 then it may be better to transmit these integers as a single unsigned byte, and to use the code 255 to indicate that the following data is a true 32-bit integer. In this case while it is true that 5 bytes will be needed instead of 4 , the gain from being able to use one byte most of the time certainly offsets any losses.

With the advent of networking no one can manually police the millions of bits of data that daily move between computers in a network. Moreover, organisations have no way of being sure that their data is not being secretly copied by wiretap or other means on the way to their proper destination. Worst of all , when satellite links are employed then any one can 'tune in' to the transmitted data. Clearly, some kind of encryption ( also known as encipherment ) is needed to make the data unintelligable to all but their intended recipient.

Protecting data from prying eyes is not the only security issue in networking.

One can imagine at least four security services:

Protecting data from being read by unauthorised persons.

Preventing unauthorised persons from inserting or deleting messages.

Verfying the sender of each message.

Making it possible for users to send signed documents electronically.

Encryption can be used to acheive all these goals.

Summary

Data compression is closely related to transfer syntax. ASN.1 provides a little bit of data compression, for example , by representing small integers in a single byte. Other compression techniques include Huffman coding, arithmetic coding, and run length coding.

Many of the issues relating to network privacy and security can be implemented in the presentation layer. The output of the presentation layer, expressed in one or more transfer syntaxes, can be encrypted before being given to the session layer, for example.

Encryption can be done using conventional or public key cryptology. It also plays a major role for authentication and providing digital signature validation.