1.3.1 - Compression, Encryption and Hashing Flashcards
(12 cards)
Define compression and when it is useful
- The process of making a file smaller/take up less storage.
- Particularly useful when transferring data via the internet
Define lossy compression and what types of files it would and wouldn’t be suited to.
- Takes away some information from the original - Information is permanently lost in the process (irreversible)
- Used on images as some loss of detail is acceptable and unlikely to be noticeable
- It is unsuitable for text as the loss of small amounts of information will make it unreadable.
Define lossless compression and what types of files it would and wouldn’t be suited to.
- Preserves all the information from the original (No data is lost)
- Used on files where losing data would not be an option, such as code and written texts.
- Rewrites data in a more efficient format.
State the two examples of lossless compression
Run Length Encoding
Dictionary Coding
Define run-length encoding and what types of scenarios it would and wouldn’t be suited to.
- Not suited to natural language
- More likely to be used in simple images
- Relies on consecutive pieces of data
- Each set of consecutive symbols can be represented by the symbol and its number of occurrences e.g. AAAABBBBBCCC could be represented as 4A5B3C
Define dictionary coding
- Frequently occurring pieces of data or groups of characters are replaced by tokens.
- A dictionary is then used to say which tokens match which groups of characters.
- When decompressed the dictionary is used to replace the tokens with the original text.
- The dictionary needs to be transmitted with the file.
Define encryption
When data is scrambled so that if it is intercepted, it cannot be understood
Define symmetric encryption and its drawbacks
- The same key is used to decrypt and encrypt data
- Key exchange is required
- The key couldn’t be transmitted over the internet as an eavesdropper monitoring the message may see it.
Define asymmetric encryption and give an example of where it could be used
- One public key encrypts the data, and a different private key is used to decrypt
- No key exchange required
- Good for internet traffic as it gets around the requirement of the key being sent as there are two different keys. Used for secure online transactions (e.g. Banks)
Define the term hash
A result that is generated by applying a hashing algorithm to a value.
Define the term hashing and give an example of where it could be used.
- An algorithm used to convert data into a hash - one-way process
- Used for storing passwords in databases
What main criteria can be used to judge the suitability of a hashing algorithm?
- Low chance of collisions
- Quick to calculate
Where possible, have a shorter output than input