1.3.1 Compression and hashing Flashcards
What is compression?
-Process used to reduce the storage space required by a file so you can store more files with the same amount of storage space
-Particularly important for sharing files over the internet
Lossy compression
Reduces the size of a file while also removing some of its information
(Could result in a more pixelated image or less clear audio recording)
Lossless compression
-Reduces the size of a file without losing any information
-Original file can be recovered from the compressed version
Run length encoding
-Method of lossless compression in which repeated values are removed and replaced with one occurrence of the data followed by the number of times it should be repeated
i.e. AAABBBBCC = 3A4B2C
-Relies on consecutive pieces of data being the same
Dictionary encoding
-Method of lossless compression where frequently occurring pieces of data are replaced with an index and compressed data is stored alongside a dictionary which matches the data to an index
-Original data can then be restored using the dictionary
Symmetric encryption
-Both the sender and receiver share the same private key used for both encrypting and decrypting data
Asymmetric encryption
-Two keys used; private and public
-Public key can be published anywhere while private key is kept secret
-Messages encrypted with the sender’s public key can only be decrypted with the recipient’s private key
What is hashing?
-An input is turned into a fixed size value (a hash)
-Output of a hash cannot be reversed to form the key
-Useful for storing passwords
What is a hash table?
-Data structure which holds key-value pairs
-Can be used to lookup data in an array in constant time