1.3.1 Encryption Compression Hashing Flashcards

1
Q

Compression

A

Reducing the storage space required by a file.

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

Benefits of compression

A
  • Store more files with the same amount of storage space
  • Reduces the time taken to share files over networks or the internet, as larger files require a longer time to transfer
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Lossy Compression

A

Reduces the size of a file while permanently removing of its information. This could result in a more pixelated image, or less clear audio recording.

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

Lossless compression

A

Reducing the size of a file without losing any information.

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

How can lossy compression be used on an audio file?

A

Removing the very high or very low frequencies which are less noticeable to the ear.

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

Which compression method allows you to still be able to recover the original file?

A

Lossless

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

How does Run Length Encoding work?

A

Repeated values are replaced with one occurrence of the data, followed by the number of times it should be repeated.

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

Is RLE a form of lossy or lossless compression?

A

Lossless.

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

Apply RLE to the following string.
AAAAABBCCC

A

A5B2C3

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

In order for RLE to work well, what does it rely on?

A

Consecutive pieces of data being the same. If there’s little repitition, RLE doesn’t offer a great reduction in file size.

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

How does Dictionary Encoding work?

A
  • Frequently occuring pieces of data are replaced with an index.
  • Compressed data is stored alongside a dictionary which matches the frequently occuring data to an index.
  • The original data can then be restored using the dictionary.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Is Dictionary Encoding a method of lossy compression or lossless compression?

A

Lossless.

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

What is an important thing to remember about data compressed using dictionary compression?

A

The data must be transferred alongside its dictionary.

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

What is encryption useful for?

A

Keeping data secure when its being transmitted.

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

Symmetric encryption

A

Both the sender and receiver share the same private key, which they distribute to each other in a process called a key exchange. This key is used for both encrypting and decrypting data.

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

For symmetric encryption, it is important to keep the private key secret. Why?

A

If the key is intercepted during the key exchange, then any communications sent can be intercepted and decrypted using the key.

17
Q

Asymmetric Encryption

A

A public and private key are used. The public key can be published anywhere, but the private key must be kept secret. Messages encrypted with the recipient’s public key can only be decrypted with the recipient’s private key.

18
Q

Person A wants to send a message to Person B using asymmetric encryption. What must Person A do?

A

They need to find Person B’s public key, so they can encrypt their message with it.

19
Q

How can asymmetric encryption be used to prove that a message has been sent by you?

A

Encrypt the message using your private key. Anyone can decrypt it using your public key. This shows you encrypted the message as only you have your private key.

20
Q

Hashing

A

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

21
Q

What is the difference between hashing and encryption?

A

The output cant be reversed to form a key. This makes hashing useful for storing passwords.

22
Q

Where are hash tables used?

A

In situations where lots of data needs to be stored with constant access times.
(Databases, caches)

23
Q

Two pieces of data produce the same hash. What is this called?

A

A collision.

24
Q

What are qualities of a good hash function?

A
  • Low chance of collision
  • Quick to calculate
  • Provides output smaller than the input
25
Q

Why is it important that a good hash function provides an output smaller than the input?

A

If it wasn’t, then searching for the hash could take longer than simply searching for the key.