Compression, Encryption and Hashing Flashcards

1
Q

What is compression?

A

Reducing file sizes.

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

What are the impacts of Compression?

A

Faster download times
Reduces storage requirements
Reduces network traffic

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

What is Loss Compression?

A

Permanently removing some of the original data
Impossible to reconstruct exact copy.

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

What is Lossless Compression?

A

Removes unnecessary meta data.
File can be reconstructed without any data loss.

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

What are the uses of Lossy Compression

A

When a file can “afford” to lose some data, whilst still being acceptable to the user.
For example, an image or audio file on a website

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

Which Image files use Lossy compression?

A

JPEG and GIF

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

Which video files use Lossy Compression?

A

MPEG, AVC, HEVC

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

Which audio files use Lossy Compression?

A

MP3, MP4, AAC

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

Advantages of Lossy Compression?

A

Uses less bandwidth on websites
Lots of tools, plugins and software to support it.

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

Disadvantages of Lossy Compression?

A

Quality degrades due to higher compression rate

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

What are the uses of Lossless compression?

A

When file information loss is unacceptable, such a historic piece of literature like Shakespear.

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

Which image files use Lossless compression?

A

PNG, BMP

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

Which audio files use Lossless compression?

A

WAV, FLAC

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

Advantages of Lossless compression?

A

Original file can be completely restored from compressed data.
Slight decrease in file size

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

Disadvantages of Lossless compression?

A

Compressed files are larger than lossy files
Increased bandwidth when used on websites.

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

What is Run-Length Encoding? (RLE)

A

Sequences of repeating data are replaced with a single value that states how many times it occurs.

e.g. AAAABBBC = 4A, 3B, 1C

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

What form of compression is Run-Length Encoding?

A

Lossless

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

What is Dictionary-Based Compression?

A

Stores each unique word in a piece of text as their own codes, instead of each individual character.

E.g. The text below contains 4 words, but only 3 are unique and 1 repeats. “Hello, Tom. Hello, Dan”
0001 = “Hello”, 0010 = “Tom”, 0011 = “Dan”.

19
Q

What is the formula for compression ratio?

A

Original data size / Compressed data size

20
Q

What is Encryption?

A

The process of scrambling data in such a way that only legitimate users can read it

21
Q

BEFORE a message/data has been encrypted, what is it known as?

A

Plain Text

22
Q

AFTER a message/data has been encrypted, what is it known as?

A

Cipher Text

22
Q

AFTER a message/data has been encrypted, what is it known as?

A

Cipher Text

23
Q

How is Plain text encrypted?

A

Using a Cipher (algorithm) and Encryption Key.

The key is a very large digital value that is used together with a cipher to encrypt or decrypt messages - almost like a password that allows you to get the correct output.

24
Q

What is Decryption?

A

The process of converting cipher text into plain text.

25
Q

What is Symmetric Encryption?

A

The same key is used to encrypt and decrypt, meaning the key must be shared between the sender and receiver.

26
Q

What is Asymmetric Encryption?

A

Uses different keys that are mathematically linked to encrypt and decrypt, meaning they do not need to be shared.

Makes use of public and private keys.

27
Q

What is a Cipher?

A

An algorithm (set of instructions) for encrypting plain text.

28
Q

How do you measure the security of an Encryption scheme?

A

The cipher complexity
Size of the encryption key
Process of exchanging encryption keys

29
Q

What are 3 issues with a Symmetric Encryption scheme?

A

Since both the sender and receiver must keep it secure.

The key must be long enough that a normal sized computer can crack it in a reasonable amount of time.

If more and more people are added to the scheme, the key itself will need to be transferred over the network in an encrypted format!

30
Q

How do you determine the strength of an Encryption key?

A

Its bit length.

e.g. A 128 bit symmetric key would take a maximum of 2^128 brute force attempts to guess it.

31
Q

Give an example of a Cipher?

A

The Caesar Cipher.

Each letter of the alphabet was pushed a number of spaces back or forth to represent another.

e.g. “Hello” (shift 1 place forward) = “Ifmmp”

32
Q

How does Asymmetric Encryption use public and private keys?

A

Both sender and receiver will have their own public and private keys.

Public key to encrypt the message.
Private key + Public key to decrypt the message.

Private key is NEVER sent across a network, so remains secret.

33
Q

Give an example of Encryption in the real world

A

Transport Layer Security (TLS) (“https://”)
Used for privacy between a browser and server.

Symmetrical scheme to set up connection.
Asymmetrical scheme to authenticate.

34
Q

What are some problems with Encryption?

A

Uses a lot of processing time to encrypt and decrypt.
The shorter the key, the less processing time, but this makes it easier for hacker to break.

Symmetric keys are much stronger than asymmetric keys of the same length, but asymmetric is more secure.
However, Symmetric keys are harder to exchange safely.

35
Q

What is Hashing?

A

Hashing is the process of transforming any given string of characters into another fixed-size value, known as a Hash.

It does this using an algorithm known as a Hash Function

36
Q

How is Hashing different to Encryption?

A

Hashing is designed to be 1 way, meaning the hash cannot be easily reconstructed to the original data.

37
Q

How does Hashing maintain data integrity if you were, for example, worried someone might modify it during transit?

A

Create a hash before sending the data.
Create a hash of the retrieved data.
Compare the two hashes.

If the file has been modified, the hashes will be different.

38
Q

What are the uses of Hashing?

A

Encrypting passwords, email addresses, credit card numbers, etc

Digital authentication

Fast searching

Database indexing

Data integrity management

39
Q

Explain how hashing might be used to authenticate a user’s login?

A

The password will be put through a hash function and compared to a hash key within a database for the same username.

If they are the same, it means they are correct.

40
Q

Why are hashes stored in password databases instead of the actual password?

A

If someone, like a hacker for example, were to look in the database, they wouldn’t be able to tell what the passwords are.

This is why you need to reset your password if you forget it - they cant just send it back

41
Q

What are Digital signatures used for?

A

To encrypt information and create a check-sum of the information being sent.

The check-sum is sent with the encrypted data.
Once received, the check-sum is calculated and compared with the received check-sum.
If different = data tampered with

42
Q

What are 3 characteristics of a good Hash function?

A

Low chance of collision (different inputs giving same output)

Quick to calculate, as lots of values might need to be hashed.

Provides a smaller output than input, so quicker to compare hashes to original data