1.3.1 Compression, Encryption and Hashing Flashcards
Why do we use compression?
Reduce space used up in storage
Load online images and video faster
Reduce download times and bandwidth
What is lossy compression?
When non-essential information is removed from the file so that the data can still be understood, but the quality of it is degraded.
On what sort of data can we use lossy compression?
- Images
- Audio
- Video
How may a sound file be compressed using lossy compression?
Frequencies that are too high for us to hear are removed.
Quiet sounds that play at the same time as louder sounds are removed.
What percentage of the original file size can lossy compression reduce an audio file to?
10%
How may an image be compressed using lossy compression?
Reducing bit depth - reduce the number of bits that are used to store each colour.
e.g. five different shades of yellow all now look the same
What is lossless compression?
When patterns in data are used to store the file in a compressed format which can then be reversed to display the original data with no loss of quality.
What technique, lossy or lossless, results in a smaller file size?
Lossy
But both reduce file size significantly
What compression method would be used for a word document and why?
Lossless - data cannot be removed as this would make the document unreadable
What is run length encoding?
When rather than recording every pixel in the sequence, the value of the pixel is recorded with the number of times that it repeats.
RED, RED, RED, RED, RED, RED, BLUE
RED(6), BLUE
What is a dictionary-based compression technique?
When instead of a whole text file being stored, a dictionary is stored with the location of each word in the text file being stored instead of the word. (see example in textbook, p77)
What does it mean if a text file uses its own dictionary?
The dictionary is comprised of the words in the text file.
What does it mean if a text file uses a known dictionary?
The dictionary is predetermined and does not depend on the words in the file.
When would using a dictionary-based compression technique not be adequate?
If the text file is very short or if it does not contain any repeating words.
Why is dictionary-based compression suitable for very long text files?
Because it saves so much space compared to the original file that the extra space of storing a dictionary is insignificant in proportion.
What is encryption?
The transformation of data from one form to another in order to prevent an unauthorised third party from being able to understand it.
What is the original data / message known as before encryption?
Plaintext
What is the encrypted data known as?
Ciphertext
What is the “cipher” in encryption?
The encryption method or algorithm
What is the “key” in encryption?
The secret information required to lock or unlock the message.