✅1.3.1 Compression, Encryption and Hashing Flashcards

1
Q

What name is given to the public and private keys used in asymmetric encryption?

A

Key pair

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

Why is Compression needed in Data Transfer?

A

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.

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

What are 2 pros and cons of lossy compression?

A

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

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

What are 2 pros and cons of lossless compression?

A

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

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

Which form of compression is best for an application if it requires data integrity?

A

Lossless compression

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

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?

A

Lossy compression

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

Name the two categories of compression

A

Lossy and lossless

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

In which type of compression is the quality of a file not degraded?

A

Lossless

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

Name one type of lossless compression

A

One from:
● Run length encoding
● Dictionary coding

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

In which form of encryption do the sender and receiver share the same private key?

A

Symmetric encryption

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

What are keys in encryption?

A

Specialised programs designed to scramble or unscramble data

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

How many keys are used in asymmetric encryption?

A

Two (one public and one private)

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

When does a collision occur in a hash table?

A

When the hash function produces the same hash value for two or more keys.

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

What does hashing do?

A

Transforms a string of characters into a fixed-length value or key that represents the original input string.

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

What is a similarity of encryption and hashing?

A

Both turn readable data into an unreadable format

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

Which data structure uses hashing to store information with constant lookup time?

A

Hash table

17
Q

What is a hash function?

A

An algorithm that converts a hash key to a hash value

18
Q

What are the main requirements of a hash function?

A
  1. Always produce the same hash value for the same key.
  2. Provide a uniform distribution of hash values. This means that every value has an equal probability of being generated.
  3. Be very fast to compute
19
Q

What are 2 methods of handling collisions?

A
  1. Linear probing (open addressing)
  2. Chaining (closed addressing)
20
Q

How does linear probing work?

A

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

21
Q

What is Run Length Encoding?

A

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.

22
Q

What is dictionary encoding?

A

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.

23
Q

What is Symmetric encryption?

A

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.

24
Q

What is asymmetric encryption?

A

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.

25
What is encryption?
The process of converting a message from plain text into cipher text. To make sure that data cannot be understood if intercepted.
26
What is decryption?
The process of converting cipher text back into plain text.
27
What is a cipher?
A set of instructions (an algorithm) for encrypting plain text
28
What is one difference between symmetric and asymmetric encryption?
1. Symmetric encryption is faster than asymmetric encryption because it uses less complex mathematical operations. 2. Asymmetric encryption allows the sender to be authenticated, increasing security but symmetric encryption doesn't. 3. Symmetric encryption uses the same key for encryption and decryption, while asymmetric encryption uses two different keys
29
What happens when you rehash?
When you rehash, a new hash table is created (larger if needed). The key for each item in the existing table will be rehashed and the item will be inserted into the new hash table.
30
Describe one advantage to storing a password as a hash?
Hash functions are one way/can't be reverse (1) If someone gains access to the database they cannot access user's password. (1)
31
State an advantage to a website's visitors of a text file of all of Shakespeare's work on the website being compressed.
Downloads quicker. (1) Saves user money by using less bandwidth / on data usage. (1)