1.3.1 - Compression, Encryption and Hashing Flashcards
What is compression?
A way of reduceing data and file sizes
What factors need to be taken into account when using compression?
The available bandwidth
The expected processing power of the user’s computer
The expected storage requirements.
What are the two types of compression?
Lossy Compression
Lossless Compression
What is lossy compression?
An algorithm that REMOVES DATA from the file to make file storage space or size smaller but the accuracy with
which it represents.
The data and information that is reduced is lost in the process and is not recoverable.
Assumes there is enough data remaining to be acceptable and similar to before hand (ei readable or still looks like the same image)
Commonly used for sound and image files:
- JPEG
- MPEG
- MP3.
What is lossless compression?
An algorithm is used to retain all the information in a file while reducing its size.
Files are stored and transmitted intact so the original can be reconstructed from this data.
Commonly used for the following files:
- program code
- ZIP
- GIF
- PNG.
What is run length encoding? (RLE)?
Is an algorithm that will loop through data. It then uses dictionaries to store the number of like data. For example here is some data:
aaaabbbbcccccddddddeee
Here it would create a dictionary of an integer and a string with the integer being the amount of strings in the data set:
4a4b5c6d3e
In simpler terms:
A dictionary is used to store items such as pixels, words or other groupings of bits.
Repeated occurrences are stored in a dictionary or table, plus their number of occurrences, e.g. 100 blue pixels
can be stored as B100.
Used in TIFF and BMP files.
What is dictionary coding?
Dictionary coding replaces recurring sequences with shorter, unique codes
A ‘dictionary’ is compiled to map original sequences to special codes
This method is effective for both text and binary data
The phrase “for example” could be coded as ‘FE’ if ‘FE’ doesn’t appear in the original text
A sequence of binary numbers ‘1010’ could be replaced by a shorter unique code
It may map two strings together, say the sentence is Hello world
Hello: H
World: W
So the compressed message is HW
What is a dictionary?
Is a data structure that maps values to a key. e.g
“Fun”: 1
“Two”: 2
What are the advantages and disadvantages of dictionary coding and run length encoding?
RLE: More effective when data has lots of repetition but may create larger files when input is too complex (ieofgignhfdikdfhbgui) will make a longer message as there are more single units.
Dictionary Coding: More versatile but may require more computational resources
What are the uses of encryption?
Widely used when transmitting information on the internet and in networks because data can be intercepted.
Protects files so that if unauthorised access is gained the data is unintelligible.
It is Important in VPNs because of the number of users sharing the physical network.
What is encryption?
Is used to protect data from being stolen, changed, or compromised and works by scrambling data into a secret code that can only be unlocked with a unique digital key.
What is an encryption key?
Keys are long random numbers which have the information needed to encrypt and decrypt messages.
What are the two types of encryption keys?
Public key is publicly available to all.
Private key is kept confidential to its owner.
What are two types of encryption?
Symmetric encryption
Asymmetric encryption
What is symmetric encryption?
The same key is used to encrypt and to decrypt.
Requires both parties to have a copy of the key.
Can’t be transmitted over the Internet or an eavesdropper monitoring the message may see it.