Data Compression & Encryption
Data Compression & Encryption
Encryption
Introduction
Data compression is a process by which the file size is reduced by re-encoding the
file data to use fewer bits of storage than the original file. The original file can then be
recreated from the compressed representation using a reverse process called
decompression. There are several different algorithms and implementations that allow
you to compress your files, some of which perform better than others for certain kinds of
file types.
Data Encryption is the conversion of electronic data into another form, called
ciphertext, which cannot be easily understood by anyone except authorized parties.
The primary purpose of encryption is to protect the confidentiality of digital data stored on
computer systems or transmitted via the Internet or other computer networks. Modern
encryption algorithms play a vital role in the security assurance of IT systems and
communications as they can provide not only confidentiality, but also the following key
elements of security
Types of Compression
Data compression
3a. Remove the two trees from the forest that have the lowest count contained in their
roots.
3b. Create a new node that will be the root of a new tree. This new tree will have
those two trees just removed in step 3a as left and right subtrees. The count in the root
of this new tree will be the sum of the counts in the roots of its subtrees. Label the edge
from this new root to its left subtree 1, and label the edge to its right subtree 0.
4. Return the one tree in the forest as the Huffman code tree.
Algorithm for Data Encryption
int i=0;
while (i < total number of character to transmit)
{if(data(i)!=data(i+1) do ; if this point is not like the next point
{transmit(data(i)+128) ; set bit 7 and transmit
i=i+1 ; increment pointer
}ENDDO
ELSE
{count=i+1 ; count-i is the repeat count
WHILE ((data(i)=data(count) AND (count-i<127)) DO
{count=count+1; increment counter
} ENDDO
count=count-i
; repeat count
transmit(count) ; send repeat count with bit7=0
transmit(data(i)) ; send character
i=count+1 ; point to next character
}ENDIF
}ENDWHILE