Compression, encryption and hashing Flashcards
Define compression
The process of making files smaller by representing them using less data
Describe lossy compression
Removes non-critical data from the data set. These may be frequencies of sound the human ear won’t notice or changing very similar colours to the same colour e.g. JPEG, MP3
Describe lossless compression
No data is removed from the data set. The original file that is reconstructed from the compressed version will be exactly the same before. e.g. ZIP, PNG
Name 2 methods of lossless compression
Run-length encoding and Dictionary coding
What is run-length encoding
Makes use of redundant data, so that if a data item occurs multiple times consecutively, the item is stored once in an index along with the number of repetitions
What is dictionary coding
An index is built where each data item is recorded along with an index reference. The compressed file then consists of the dictionary and the sequence of occurrences
Define encryption
The process of making data unreadable to third parties
What is symmetric encryption
Encryption where the same key is used to encrypt and decrypt data
What is asymmetric encryption
Encryption where the public key is used to encrypt data and the private key is used to decrypt it
What is a hash function
A function that takes in data of any size and returns a fixed-length output
Name the properties hash functions should have
- Irreversibility
- Determinism => Same input will always give the same output
- Collision resistance => A collision is when two or more inputs give the same outputs.
Name uses of hashes
Passwords and proof of state