1.3.1 - Compression, Encryption and Hashing Flashcards
What is Compression?
The process of making a file smaller / take up less space in order to
- Reduce download times
- Make best use of bandwidth
- Reduce file storage requirements
What is Lossy Compression?
- A method of compression where files sizes are made smaller by permanently removing data and reducing file quality.
- File sizes become smaller than lossless but original files cannot be recreated
What is Lossless Compression?
- A method of compression used to retain all the information and quality of a file while reducing its size by reformatting it more efficiently.
- Original files can be recreated
Overall Advantages of Compression
- Can allow for quicker file downloads
- Can reduce the amount of data that needs to be sent/bandwidth needed
- Saves user money on data usage
- Less storage use
- (Videos) Can decrease buffers/pauses
Advantages of Lossy over Lossless
- Better for Images and Videos as differences in quality not as noticeable to naked eye
- Decreases file sizes more
- (Videos) buffer less with lossy
Advantages of Lossless over Lossy
- Better for text/worded documents as any data losses to text can make it unreadable
- Retains all original data and quality
- Can recreate original file
2 Types of Lossless Compression + Their best use
- Dictionary Coding - Ideal for text-based documents
- Run-length encoding - Ideal for Images
Describe Dictionary Coding
- Frequently occurring pieces of data / groups of characters are replaced by indexes.
- A dictionary is then used to say which indexes match with which groups of characters.
- When decompressed the dictionary is used to replace the indexes with the original text.
Describe Run-Length Encoding
- Run length encoding relies on consecutive pieces of data / characters being the same.
- Each set of consecutive symbols can be represented by the symbol and its number of occurrences
What is Encryption?
The process of scrambling data according to a specific algorithm so it cannot be read by third parties
Symmetric Encryption
- A method of encryption where the same key is used to encrypt and to decrypt.
- Both parties must know the key and must keep it secret
Dangers of Symmetric Encryption
- Interception of the key
- Duplication of the key production process to acquire a copy of the key
Asymmetric Encryption
- Public key used to encrypt message originally and private key used to decrypt message (Key Pair)
- Public key can be distributed freely but private key must be kept secret; it is also impossible to derive one key from the other
Why Asymmetric over Symmetric?
More Secure
Describe an exchange using Asymmetric Encryption (Person A and B)
- Person A and B exchange public keys
- A uses B’s public key to encrypt message
- B can use their private key to decrypt A’s message