3.1 Compression, Encryption & Hashing Flashcards
What is compression?
The process used to reduce the storage space required by a file by removing unnecessary or insignificant detail.
What are the 2 main advantages of compression?
Increases the number of files that can be stored in the same amount of storage space
Increases the number of files that can be transferred in a given amount of time
What are the 2 types of compression?
lossy
lossless
What is the difference between lossy/lossless compression?
Lossy compression reduces the size of a file while removing some information whereas lossless compression reduces file size without removing any information.
What are the advantages/disadvantages of lossy compression?
advantages -
- reduces file size more than lossless
disadvantages -
- original file can not be restored
- some quality may be lost
What are the advantages/disadvantages of lossless compression?
advantages -
- no quality lost
- original file can be restored
disadvantages -
- reduces file size less than lossy
What are 2 methods of lossless compression?
run length encoding
dictionary encoding
What is run length encoding?
A method of lossless compression in which repeated values are removed and replaced by 1 occurrence of the value followed by the number of times it repeats.
What would happen to AAAAAABBBBBCCC with RLE?
It would become A6B5C3
What is dictionary encoding?
A method of lossless compression in which frequently occurring pieces of data are replaced with an index. Each piece of data is matched to its index in a dictionary.
What is the disadvantage of run length encoding?
Relies on consecutive pieces of data being the same i.e. lots of repetition, otherwise there is little reduction in file size.
What is the disadvantage of dictionary encoding?
If the data is transferred, its dictionary must be transferred alongside it for the original file to be obtained.
What is encryption?
Scrambling data with a specific cipher algorithm so that it can not be understood unless reverted back to the original data with the correct decryption key/algorithm.
What are 2 types of encryption?
symmetric
asymmetric
How does symmetric encryption work?
The sender and receiver share the same private key which is distributed between them in a key exchange. This key is used to encrypt and decrypt the data.