1.3.1 Compression, Encryption and Hashing

compression – Compression is the method computers use to make files smaller by reducing the number of bits (1’s and 0’s) used to store the information. Most file formats will use one form of compression or another.

Lossy vs lossless – Lossy compression makes the file smaller by getting rid of bits that will have little impact on the overall file. In images this can be done by looking at pixels that next to each other. If they are similar, they are made to be the same. Once a file has been compressed using a lossy method, any bits that are lost cannot be recovered. With lossless compression the file is reduced without losing any quality so the original file can be restored. Generally, lossless compression will not be able to make a file as small as a lossy method. Images in GIF and JPEG formats are lossy, while PNG, BMP and Raw are lossless formats for images. lossy is not well suited for line drawings and other textual or iconic graphics, where the sharp contrasts between adjacent pixels can cause noticeable artifacts.

Run length encoding (RLE) – The role of (RLE) is to reduce data repetition. It is based on representing elements by how many times they appear consecutively. The basic principle is to replace the sequence of the same symbol by a number of its occurrences. “XXXXXOOOOOOHH” when compressed yields “5X6O2H”. this is a form of lossless compression as when decoded no data has been lost. This will largely be effective, however when repetition is infrequent then it will be less effective or even increase the size.

Dictionary compression – is a class of lossless data compression algorithms which operate by replacing the stings of data with a reference to their position in a list. This way any repetitions just reference the same location in the list. when compressing like this both the new document of references and the “dictionary” must be stored, there for this is best done with longer documents with many repetitions.

Encription – Encryption is the altering of data to increase it’s security

symmetric encryption

where both parties have the same key to both encrypt and decrypt the data. This adds some level of security however as both parties have the same key and it both encrypt and decrypt the data the key can be easily compromised and used maliciously.

Create your own website, free on WordPress.com.Create your own website.
Start free