1.3.1 Compression, Encryption and Hashing Flashcards

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

what is the purpose of compression?

A
  • reduce file size
  • reduce download times
  • reduce storage requirements
  • make best use of bandwidth
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

why is making the best use of bandwidth important?

A
  • large amounts of data are streamed and sent over the internet so using bandwidth efficiently is critical
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is compression?

A

reduction of the overall size of a file

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

what are two methods of compression?

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

what needs to happen to a compressed file to read it?

A

it needs to be uncompressed

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

what is lossy compression?

A

reduction of file size by permanently deleting data/reducing the quality of the data

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

what is lossless compression?

A

reduction of the file size by storing the data in a different, more compressed way
this means the overall quality of the data does not change

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

which types of data cannot be compressed with lossy compression?

A

text documents
executable programs

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

what are two methods of lossless compression?

A
  • dictionary coding
  • run-length encoding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is dictionary coding good for?

A

text-based documents

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

what is run-length encoding more suited for?

A

images

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

how does dictionary coding work?

A
  • builds an index
  • every data item or entry in the file is recorded, along with an indexed reference or unique code
  • file consists of dictionary index + sequence of occurrences needed to recreate original file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

how does run-length encoding work?

A
  • if there are lots of contiguous pixels of the same colour, the number of pixels of that colour can be stored rather than storing them individually
  • it is stored in frequency/data pairs
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what is encryption?

A

the process of encoding a message so that it can be read only by the sender and the intended recipient

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

how does symmetric encryption work?

A
  • a single key is used to both encrypt and decrypt a message
  • both parties need to know the key and keep it secret
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

how can the message be cracked with symmetric encryption?

A
  • interception of the key
  • duplication of the key production process to acquire a copy of key
17
Q

How does asymmetric encryption work?

A
  • use two different keys
  • encrypt the message with the first key
  • message is then decrypted with the second key after it is sent
18
Q

What makes asymmetric encryption more secure?

A
  • the two keys are not the same
  • it is virtually impossible to derive one key from the other
19
Q

what are ‘key pairs’?

A

keys that are generated so anything encrypted with one of the keys can be decrypted with the other

20
Q

what is a public key as opposed to a private key?

A
  • public key can be made public (give it out or publish online)
  • anyone can have access to the public key
  • PRIVATE key - not sent/shared with anyone
21
Q

how does public/private key encryption work?

A
  • each party has their own public/private key pairs
  • sender + recipient exchange copies of their public keys
  • sender uses the recipient’s public key to encrypt before sending
  • recipient uses their private key to decrypt
22
Q

what is another advantage of the public/private key method for encryption?

A
  • someone can encrypt with their private key
  • it can then be decrypted by their public key
  • as the message can be decrypted with the public key, it must have originally been encrypted with the private key
  • this confirms the message as authentic
23
Q

what is a combined encryption key?

A
  • when the sender’s private key and the receiver’s public key are used to encrypt a message
  • it is then decrypted using the receiver’s private key and the sender’s public key
24
Q

what 3 things do you know about a message when it is encrypted using asymmetric encryption?

A
  1. the sender and receiver know no one else can read the message
  2. you can be sure the message is authentic
  3. you can be sure the message hasn’t been modified
25
Q

what is hashing/hashing function?

A

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

26
Q

what does a hashing function contain?

A

an algorithm that converts the input data
eg. SHA-1, MD5

27
Q

what happens to the hash value there is a slight change in the input message?

A
  • produces a totally different hash value
  • this is because the hash value is generated from the entire input message
28
Q

what is the difference between hashing and encryption?

A

hashing is a one-way process.
you cannot get back to the original value from the hashed value, even if you have access to the original hashing algorithm

29
Q

why is applying a hashing function to passwords secure?

A
  • you do not have to send the passwords in plain text to the online system
  • OR store the passwords in plain text in the online system
  • any hacker who accesses the password file will only be able to see the hashed values (will not be able to obtain actual passwords as hashing is a one way process)
30
Q

How are passwords verified if they have been hashed?

A
  • hashing function is applied to the password entered
  • system compares the hashed value to the one stored
31
Q

how can hashing be used in data manipulation?

A
  • used for quick searching, insertion and deletion of data in data structures
  • there is no need to search the data structure for an entry
  • just input what you are searching for and apply the hashing function to find item
32
Q

what is the time complexity of hashing?

A

average - O(1)