1.3.1 Compression, Encryption and Hashing Flashcards
What is compression?
The process used to reduce the storage space required by a file
Compression allows more files to be stored in the same amount of space and is important for file sharing over networks.
What are the two categories of compression?
Lossy and lossless
Lossy compression reduces file size by removing information, while lossless compression retains all original information.
What is lossy compression?
A method that reduces file size by removing some information
This can result in lower quality, such as pixelated images or unclear audio.
What is lossless compression?
A method that reduces file size without losing any information
The original file can be fully recovered from the compressed version.
What is run length encoding (RLE)?
A method of lossless compression that replaces repeated values with one occurrence and a count
Example: AAAAAABBBBBCCC can be represented as A6B5C3.
What is dictionary encoding?
A method of lossless compression where frequently occurring data is replaced with an index
The original data can be restored using a dictionary of indices.
What is encryption?
The process used to keep data secure during transmission
It scrambles data before transmission and deciphers it upon arrival.
What is symmetric encryption?
A method where both sender and receiver share the same private key
The key is used for both encrypting and decrypting data.
What is asymmetric encryption?
A method that uses two keys: a public key and a private key
Only the recipient’s private key can decrypt messages encrypted with their public key.
What is hashing?
The process of converting an input into a fixed size value called a hash
The output of a hash function cannot be reversed to form the original input.
What is a hash table?
A data structure that holds key-value pairs
It uses a bucket array and a hash function for constant time data lookup.
What is a collision in hashing?
When two pieces of data produce the same hash value
Methods to handle collisions include storing items in a list or using a second hash function.
Fill in the blank: A good hash function should have a low chance of ______.
collision
It should also be quick to calculate and provide a smaller output than the input.