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
Advantages of Combined Encryption Key (A’s Public Key and B’s Private Key) and Asymmetric Encryption
- Private key can be used to ENCRYPT message to confirm authenticity as public is able to decrypt it
- Both parties know message cannot be read by 3rd parties
- Guarantee message hasn’t been modified
Hashing Function
- Transforms a string’s characters into a fixed-length value
- Contains an algorithm that converts input data
- Commonly used for Passwords and PINs
How does Hashing and Encryption differ?
Hashing is One Way but Encryption is 2 Way (Encryption and Decryption)
Features of Hashing/Hashing Functions
- Difficult to regenerate the original from the hash value.
- Easy to check – the login attempt is hashed again.
- Vulnerable to brute-force attacks.
- Low chance of collision to reduce the risk of different files being marked as the same.
- Provides a smaller output than input so quicker to calculate and compare hashes than original data.
What is a Hash?
A result generated by applying an algorithm / numeric process to a value.