Data Compression and Encryption zUnderstand reversible and non-reversible data compression....

22
Data Compression and Encryption Understand reversible and non- reversible data compression. Identify Huffman code and FAX compression algorithm Understand the encryption and decryption

Transcript of Data Compression and Encryption zUnderstand reversible and non-reversible data compression....

Data Compression and Encryption

Understand reversible and non-reversible data compression.

Identify Huffman code and FAX compression algorithm

Understand the encryption and decryption

Why Data Compression

Data compression is developed to reduce the number of characters required in a transmission to increase transmission efficiency.

Messages are composed of fixed length of bits coded to represent characters.

Data Compression System

Data compression techniques

Reversible: the data by the receiver can be recovered after data compression.

Nonreversible: the data cannot be recovered by the receiver.

Huffman code - Reversible

Assigns fewer bits to the most commonly used characters and allocates fewest bits to the less commonly used characters.

can achieve 50% of reduction of original codes.

Example of Coding Tree (Huffman)

Information

Information, I is related to I = log 2 p

where p is the probability of occurrence. The number of bits, n, to carry out the information is related to 1/log 2 P.

Adaptive scanning - Reversible

Uses a dictionary to store frequently occurring strings of characters.

The common character string will be replaced by a shorter code during transmission and will be reversed after finished.

FAX compression - Reversible

FAX treats each facsimile line as a series of white and black runs.

The runs are coded based on their length, and the code is transmitted instead of the full bit map

For 40 black spots, instead of sending 40 "dot"s, it will send "40b” where “b” is for black dots.

Data Compression - Nonreversible

Often called data compression, which permanently eliminates the irrelevant portions of the data.

The sender is sending a data of having five decimal places 23.45612, the sender can chop the decimal places to four, 23.4561 before sending it out.

Voice Compression

Voice is sampled at 8K signalling rate and is assigned 8 bits leading to a data rate of 64K bps (8x8K = 64K bps).

Data compression can be applied to reduce to 8K bps for a single voice.

The mobile phone you are using can carry data at the rate of 9600 bps.

Video Compression

Video after compression is a variable bit rate (VBR), which means that the bandwidth required to transmit the data varies with time.

Commercial package can achieve up to 26-to-1 or more.

Video Compression format

Data Encryption

The aim is to ensure the data transmission in the Communication network is secure.

That is to say only the user who knows the method to revert (decrypt) to data.

The process of converting the original data into another message is called encryption

The reverse process to convert back into the original message is called decryption.

Plaintext and Ciphertext

The original message is called plaintext.

The encrypted message is called ciphertext.

plaintext: I am a studentciphertext: 7864%^*hj&*%#ii

Web Security

The word cryptography comes from the Greek, which means secret writing. It consists of four basic elements

Plaintext: The is the original message to be sent and is usually human-readable.

Ciphertext: This is the plaintext after encryption. Cryptographic algorithm: This is the

mathematical operations used to encrypt/decrypt the plaintext.

Key: This is a secret key used to encrypt/decrypt the message.

Symmetric Cryptography

Symmetric Cryptography means the same key is used to encrypt the plaintext and decrypt the ciphertext.

Asymmetric Cryptography

This algorithm can be achieved through a set of keys. This key, usually termed as private key, must be well informed to the remote before

it can be converted into the plaintext.The sender will use its own key to encrypt

the message while the remote will use the private key (not the same key of sender) to decrypt the received message.

Transposition

Transposition means to transpose the original order of pattern into different order.

For instance, a byte of 1100 1000 after transposition becomes 10100100.

Example of Transposition

Substitution

It means to substitute the complete set of bits by a different set of bits.

For instance, the original plaintext is 1011 0011 and the key is 11000011.

After substitution the ciphertext becomes 01110000

Decryption