1.3 Exchanging data Flashcards
What is compression?
the process used to reduce storage space required by a file
What is the purpose of compression? (4)
-reduce file sizes
-reduce download times
-reduce storage requirements
-make best use of bandwidth (amount of data sent at a time)
What are the two categories of compression?
-lossy
-lossless
What do we mean by lossy compression?
a type of compression that reduces sizes of files by removing some of its information e.g. a more pixelated image/less clear audio recording
What type of files are used for lossy compression?
-sound files
-image files
What do we mean by lossless compression?
a type of compression where the original file can be recovered
What type of files are used for lossless compression?
-text files
-executable files
What are the two methods to use lossless compression?
-run length encoding
-dictionary encoding
What is run length encoding?
a form of lossless compression where repeated values are removed and replaced with the single data item followed by the number of times it should be repeated
e.g. AAAAABCCC would give A5B1C3
What is an inefficiency when using run length encoding?
-relies on consecutive pieces of data being the same
- little repetition = little reduction in file size
What is dictionary encoding?
a form of lossless compression which replaces commonly repeated data with an index and saves the compressed data together with a dictionary that links the frequently repeated data to their corresponding index
e.g. I 1
went 2
to 3
the 4
park 5
. 6
[space] 7
this dictionary would then help decode 17273747576
What is something to remember about dictionary encoding?
if the compressed data isn’t transferred alongside its dictionary, the data cannot be used
What do we mean by encryption?
the process of encoding a message so it can be read only the sender and the intended recipient
What do we mean by encoding a message?
converting the message from plain text to cyphertext
What are the two types of encryption?
-symmetric
-asymmetric
How does symmetric encryption work?
-both sender and receiver share the same private key
- key is used for both encrypting and decrypting data
How can symmetric encryption by intercepted? (2)
-interception of the key
-duplicating the key to have a copy
How does asymmetric encryption work?
-two keys used: public & private
-public key can be published anywhere but private must be secret (together known as a key pair)
-messages encrypted with public key can only be decrypted with the corresponding private key
What is hashing?
a process where an input (called a key) is turned into a fixed sized value (a hash)
How are keys turned into a hash?
uses algorithms called hash functions
What is something to know about hashing?
-one way process: the output of a hash function cant be reversed to form the key
-the key cant be reversed to gain the passwords
What are hash tables?
a data structure which holds key-value pairs
What do we mean by a collision?
when two keys produce a same hash
How can we overcome collisions?
-storing items in a list under a new hash value
-using a second hash function to generate a new hash
tag do?