1.3.1: Compression, Encryption, and Hashing Flashcards
What is Lossy?
- Compressing files by deleting unnecessary metadata
What are the disadvantages of Lossy?
- Data is lost permanently
- Quality is sacrificed
What is an advantage of Lossy?
- File size reduces dramatically
How is Lossy implemented?
- Reducing number of colours or cropping an image
What is Lossless?
- Compressing files by temporarily reducing file size
What is an advantage of Lossless?
- No data is lost
- Quality is not sacrificed
- The original data can be retrieved
What is a disadvantage of Lossless?
- File size isn’t as reduced as with Lossy as all the original data is still present when the file is accessed
How is Lossless implemented?
- Run Length Encoding
- Dictionary Encoding
How does Run Length Encoding work?
- An algorithm will identify sequences of colours and replace them
How does Dictionary Encoding work?
- Repetitive characters or words are replaced
Where would Lossy be most beneficial?
- When uploading, downloading, or streaming off the internet
Where would Lossless be most beneficial?
- Compressing high quality photos over the internet, where the quality would be required to be uncompromised but the file would be originally too large to efficiently send over the internet
What is Run Length Encoding?
- A method of Lossless compression in which repeated values are removed and replaced with one occurrence of the data followed by the number of times it should be repeated
- Example: AAAAAABBBBBCCC could be represented as A6B5C3
What is required for Run Length Encoding to work well?
- Consecutive pieces of data being the same
- If there is little repetition, RLE doesn’t offer a great reduction in file size
What is Dictionary Encoding?
- A method of Lossless compression where frequently occurring pieces of data are replaced with an index and compressed data is stored alongside a dictionary matching frequently occurring data to an index
- The original size can be restored using the dictionary
What is Encryption?
- The process by which plaintext (data) is transformed into an unreadable file which can be deciphered using a key authorised by users
Why is Encryption used?
- To prevent unauthorised viewing of private and confidential files
- Used for protecting data when being sent across the internet
What is Symmetric Encryption?
- The process by which plaintext is encrypted is the method by which the ciphertext is decrypted
How does Symmetric Encryption work?
- Both the sender and receiver share the same private key distributed via key exchange
What is a disadvantage of Symmetric Encryption?
- Low security because of how easy it is to crack
- Even if the key doesn’t get intercepted during exchange, the patterns in the ciphertext render the scrambled message easy to crack
What is Asymmetric Encryption?
- The process of Encryption utilising 2 keys: A public and private key
How does Asymmetric Encryption work?
- The public key can be published anywhere so anyone can see
- The private key must be kept secret
- Together the keys are known as a key pair and are mathematically related to one another
What is an advantage of Asymmetric Encryption?
- A single key cannot be used to both encrypt and decrypt communication
- Messages encrypted with the recipient’s public key can only be decrypted with the recipient’s private key (that should only be in the possession of the recipient)
What is Hashing?
- The process by which an input (a ‘key’) is turned into a fixed size value (a ‘hash’) by one of many hash functions (algorithms that turn keys into hashes)