9: Compression, encryption and hashing Flashcards
What is the purpose of compression?
- Reduce the size of files
- Reduce download times
- Reduce storage requirements
- Make best use of bandwidth
What are the two methods of compression?
Lossy
Lossless
What happens during lossy compression?
- Some data is lost when the file is compressed
- Slightly reduces quality but significantly reduces file size
- Suitable for images, audio and videos
What happens during lossless compression?
- None of the original data is lost
- The original file can be recreated when it is uncompressed
- Suitable for executable files and documents
What are the two methods of lossless compression?
- Run-length encoding
- Dictionary coding
What is dictionary coding suitable for?
Compression of text-based documents
What is run-length encoding suitable for?
Compression of images
How does dictionary coding work?
- builds an index that is visualised as a table
- every data item is recorded, along with an indexed reference or unique code
- The compressed file now consists of the dictionary index and the sequence of occurrences needed to recreate the original file.
How does run-length encoding work?
Stores the number of pixels followed by the colour of those contiguous pixels
For example 22 0 could be 22 white pixels.
What is meant by encryption?
The process of encoding a message so it can be read only by the sender and the intended recipient
how does symmetric encryption work?
- A single key is used to both encrypt and decrypt a message.
- both parties need to know the key and keep it secret
What are the dangers of symmetric encryption?
A message can be cracked by either:
- Interception of the key
- Duplication of the key production process to acquire a copy of the key
How does asymmetric encryption work?
- uses two different keys
-1. the unencrypted message is encrypted with the first key
2. Once the message is sent, the recipient then decrypts the message with the second key