Compression, Encryption and Hashing Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is Compression

A

The process used to reduce the storage space required by a file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why do we use Compression

A
  • The larger a file, the longer it takes to transfer
  • By compressing files it increases the number of files that can be transferred in a given time
  • This reduces buffering and enables files to be loaded faster
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are the Two Types of Compression

A
  • Lossy
  • Lossless
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Lossy Compression

A

Reduces the size of a file by removing some of its information so less data needs to be stored

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe Examples of Lossy Compression

A
  • Music - removes frequencies in the sound file that are too high for humans to hear
  • Movie - dropping of quality makes it more compressed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Lossless Compression

A

A type of compression that reduces the file sizes in such a way that no data is lost so the original file can be recovered from the compressed version

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How is Lossless Compression Achieved

A

Makes use of repeating data so that if a data item occurs multiple times the item is stored once along with the number of repetitions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe Examples of Lossless Compression

A
  • Run-length Encoding - repeated values are removed and replaced with one occurence followed by the number of times it should be repeated,
  • However relies on repeated data being identical and doesn’t give a good reduction if there is little repetition
  • Dictionary Encoding - replace the most common pieces of data with an index
  • Compressed data is stored alongside a dictionary that macthes the frequently occuring data to an index, this means the original data can be restored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the purpose of Encryption

A

To keep data secure when it’s being transmitted

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the are Two types of Encryption Technologies

A
  • Symmetric Encryption
  • Assymetric Encryption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Symmetric Encryption

A
  • Both sender and receiver share the same private key
  • The key is distributed in a process called a key exchange
  • This key is used for both encrypting and decrypting data
  • The key must be kept secret
  • If the key is intercepted then any communications sent can be intercepted
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Asymmetric Encryption

A
  • Two keys are used: public and private
  • The public key can be published anywhere
  • The private key must be kept secret
  • Together, the keys are known as a key pair
  • Messages encrypted with the public key can only be decrypted with the corresponding private key
  • Encrypting a message using your private key verifies that the message was sent by you. If your public key can decrypt a message, then it must have been encrypted with your private key, which only you have access to.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Describe the Process of a Digital Signature

A
  • Digital Signatures show that a message has been sent by you
  • You can encrypt a message using your private key.
  • This means that anyone can decrypt it (as your public key is available to anyone) and by doing so, can guarantee that you encrypted the message, as only you have access to the private key
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Hashing

A

The process in which an input (called a key) is turned into a fixed size value (called a hash)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the features of hashing

A
  • Cannot be reversed
  • Gives a fixed size value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a hash table and what is it used for

A
  • A data structure which holds key-value pairs
  • Hash tables can be used to lookup data in an array in constant time
17
Q

What is a collison and how can it be avoided

A
  • If two keys produce the same hash
  • This can be avoided by storing items together in a list under the hash value and using a second hash function to generate a new hash
18
Q

Describe two different ways hashing could be used in a database

A
  • Security - to hide passwords or credit card details in a database so it cannot be seen by people who look at the database
  • Speed of Search - hashing is used on secondary keys so when using the hashing table records can be found quicker
19
Q

What properties should a good hashing algorithm have

A
  • Low chance of collision
  • Quick to calculate
  • Output smaller than input