Compression, encryption and hashing Flashcards

Exchanging data

1
Q

Define compression

A

The process of making files smaller by representing then using less data. Making data quicker to transmit over a connection

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

What is lossy compression

A
  • Info is removed
  • Usually used in video/audio files (changes might include removing frequencies of sound the human ear won’t notice)

The higher the compression ratio the smaller the file has been made

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

What is lossless compression

A
  • No info is removed
  • The reconstructed version of the compressed file will be the same bit for bit
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the two types of lossless compression

A
  • Run-length encoding (RLE)
  • Dictionary coding
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Describe how run length encoding works

A

This makes use of redundant data
- If a data item occurs more than once consecutively the item is stored once in an index along with how many times it is repeated

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

Describe how dictionary coding works

A

An index is built where each data item is recorded along with an index reference

The compressed file contains the dictionary and the sequence of occurrences

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

Define encryption

A

The process of making data unreadable to third parties

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

What is a key

A

A value that needs to be provided to encrypt/decrypt data

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

How does encryption generally work

A
  • Apply the encryption algorithm to the original data using the key so it is no longer readable
  • The recipient applies the decryption algorithm using the key to decrypt the data

The key is kept secret

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

Define symmetric encryption

A

Encryption where the same key is used to encrypt and decrypt the data

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

Define asymmetric encryption

A

Encryption, where one key (the public key) is used to encrypt the data and another (the private key), Is used to decrypt it

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

What is a Hash function

A

A function that takes in data of any size and returns a fixed-length output

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

What are the properties of a hash function

A
  • Irreversibility
  • Determinism
  • Collision resistance
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Define Irreversibility (hashing)

A

It is impossible to calculate what data was put into the hash function given its output

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

define Determinism (hashing)

A

The same input will always give the same output

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

Define Collision resistance (hashing)

A

Reduced probability that two or more inputs will give the same output

17
Q

describe some of the uses of hashing

A

Protects passwords stored on a database in case it gets hacked
- The password entered and compared to the stored hash
- If they are the same access is granted

Proof of state
- This can be used in police investigations to see if a database has been tampered with

18
Q

What are hash tables

A

A data structure designed for fast access of data. Each piece of data is stored using a key

  • The key is hashed into a memory location
  • When they need to retrieve the data they hash the key again to get the location in which the data is stored