✅1.3.1 Compression, Encryption and Hashing Flashcards
What name is given to the public and private keys used in asymmetric encryption?
Key pair
Why is Compression needed in Data Transfer?
Compression is crucial for reducing file size to enable efficient data transfer over the Internet.
Smaller files have faster transmission times and require less bandwidth consumption.
What are 2 pros and cons of lossy compression?
Pros:
1. Greatly reduced file sizes
2. Suitable for media streaming where some data loss is acceptable
Cons:
1. Irreversible loss of data quality
2. Not suitable for text or archival storage
What are 2 pros and cons of lossless compression?
Pros:
1. Maintains original data
2. Best for text and data that require integrity
Cons:
1. Larger file sizes than lossy
2. Requires high bandwidth when streaming
Which form of compression is best for an application if it requires data integrity?
Lossless compression
Which form of compression is best for an application if it prioritises achieving a small file size or quick data transfer and some data loss is acceptable?
Lossy compression
Name the two categories of compression
Lossy and lossless
In which type of compression is the quality of a file not degraded?
Lossless
Name one type of lossless compression
One from:
● Run length encoding
● Dictionary coding
In which form of encryption do the sender and receiver share the same private key?
Symmetric encryption
What are keys in encryption?
Specialised programs designed to scramble or unscramble data
How many keys are used in asymmetric encryption?
Two (one public and one private)
When does a collision occur in a hash table?
When the hash function produces the same hash value for two or more keys.
What does hashing do?
Transforms a string of characters into a fixed-length value or key that represents the original input string.
What is a similarity of encryption and hashing?
Both turn readable data into an unreadable format
Which data structure uses hashing to store information with constant lookup time?
Hash table
What is a hash function?
An algorithm that converts a hash key to a hash value
What are the main requirements of a hash function?
- Always produce the same hash value for the same key.
- Provide a uniform distribution of hash values. This means that every value has an equal probability of being generated.
- Be very fast to compute
What are 2 methods of handling collisions?
- Linear probing (open addressing)
- Chaining (closed addressing)
How does linear probing work?
When a key creates a hash value that references a position that is already occupied, you must place the data in the next free position in the hash table. You can probe sequentially or use an interval
What is Run Length Encoding?
A lossless compression technique which finds runs of repeated binary patterns and replaces them with a single instance of the pattern and a number that specifies how many times the pattern is repeated.
What is dictionary encoding?
A lossless compression where frequently occurring pieces of data are replaced with an index and compressed data is stored alongside a dictionary which matches the frequently occurring data to an index. The original data can then be restored using the dictionary.
What is Symmetric encryption?
A type of encryption in which the sender uses a key to encrypt the data before transmission and the receiver uses the same key to decrypt the data. This means that the key must also be transferred (known as key exchange) to the same destination as the ciphertext.
What is asymmetric encryption?
An encryption method which the sender and recipient use a pair of keys, one public and one private that are mathematically linked. One key is used to encrypt and the other key is used to decrypt.