1.3.1 Compression, Encryption and Hashing Flashcards

1
Q

What is Compression

A
  • Reducing the amount of storage space (bits) a given file takes up
  • Removes unnecessary bits to reduce the overall size of the file
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the advantages of compressing files

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

How is the level of compression measured

A
  • Compression ratio
  • Size of the compressed file/ size of original file
  • Number between 0 and 1. The closer to 0 the better
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the 2 types of compression

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

What is Lossy Compression

A
  • File is compressed to a smaller size bust some information is lost during the process
  • The original file can’t be perfectly reconstructed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Lossless Compression

A
  • Able to reduce a file’s size without losing any information.
  • Original file can be perfectly restored
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

When is lossy and lossless sutiable

A
  • Lossy provides better compression ratio - better if lost data isnt important - good for compressing images. unnoticeable reduction in quality
  • Text documents and executable programs - can’t lose data during compression - use lossless
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Run length encoding

A
  • Method of lossless compression
  • When a single character will be repeated many times
  • R.L.E replaces a sequence of repeated characters with a flag character, (£,$) character itself, number of times its repeated
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Dictionary Encoding

A
  • Another form of lossless compression best for text-based documents
  • Works by building an index that we visualise as a table - dictionary index
  • Sequence of occurences of characters is created
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Huffman Encoding

A
  • One of the easiest dictionary encoding methods.
  • Huffman encoding uses a dictionary to store all the letters that occur in text.
  • Each letter is given a unique code, most common letters given a shorter code
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Encryption and Decryption and name an example of a encryption algorithm

A
  • Encryption: The act of scrambling a piece of plain text into cipher text so it cant be easily understood
  • Decryption: Unscrambling encrypted message to reveal original text.
  • Piece of information needed to decrypt message is the key.
  • Caeser Cipher
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is Caeser Cipher bad

A
  • The shift cipher is weak
  • Modern computers could use brute force hacking to crack it.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is Symmetric Encryption

A
  • The process of decryption is simply the opposite of the process used to encrypt
  • e.g Caeser Cipher : replacing letters with letters a set number of places down the alphabet
  • They are quick to set up and easy to execute but they are very weak (easily cracked)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Asymmetric Encryption

A
  • The encryption and decryption keys are different
    • If someone knows the encryption key they can encrypt the information but not decrypt it
    • If someone has decryption key - can read info but not encrypt their response using the same algorithm.
  • Also known as public key encryption
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is a key pair

A
  • In assymetric encryption - the keys are generated so anything encrypted with 1 key can be decrypted with the other - key pair
  • 1 key needs to be made into a public key and the other becomes the private key
  • The public key can be published online and the private key should not be given to anyone.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a problem of using public key encryption and how should you solve this

A
  • Someone could intercept Adam’s message and randomly remove chunks of the encoded message before passing it on to Charlotte. She wouldnt know if she had recieved the right message
17
Q

Describe an example of using the asymmeric encryption

A
  • Paul wants to send a message to Sarah
  • Sarak keeps her decryption key secret (private key) and publishes her encryption key (public key)
  • Paul uses the public key to encrypt the message
  • Sarah uses her private key to decrypt the message
18
Q

What is the RSA cipher and who invented it

A
  • The asymmetric key was invented by American Computer Scientist Whitfield Diffie in 1975
  • Ron Rivest, Adi Sharmir and Leonard Adelman developed the function for the encryption called the RSA Cipher and became the foundation for all ancryption techniques
19
Q

What is Hashing

A
  • A hash is a unique string of data
  • Transforms a string of characters into a fixed length value or key that represents the original input string.
  • In public key encryption, the hash is unique to the original message sent and can be used to confirm the integrity of information
20
Q

What is the difference between encryption and hashing

A
  • The difference is that hashing is a one-way process
    • you can’t get back to the original value from the hashed value even if you have access to the original hashing algorithm.
    • A slight change in the input message generates a different hash value
21
Q

What are the 2 algorithms that a hash uses and what are the advantages of hashing

A
  • SHA-1 and MD5
  • Preventing information like passwords from being read
    • Harder to access as they are unreadable
    • As hash is 1 way, the hacker can’t obtain any actual passwords from the information in the file.
22
Q

What is a digital signature

A
  • Commonly used for software distribution, financial transactions
  • 1 of the most common digital signature mechanisms is the digital signature algorithm (DSA)
    • DSA lets 1 person with the private key sign the document so that others with a matching public key can verify that it was signed by the holder of the private key
    • Digital signatures are usually applied to the hash of a message to add more security.
23
Q

Exam Question) Explain why asymmetric encryption is more suited to transactions over the internet that symmetric encryption

A
  • Symmetric encryption would require both parties to have a copy of the key
  • This couldn’t be transmitted over the internet or an eavesdropper monitoring the message may see it
  • Asymmetric gets round this requirement as there are 2 different keys.
    • One key encrypts which can be publicly distributed
    • And a different key to decrypt it which is kept private.
24
Q

Exam Question) Explain the difference between lossy and lossless compression

A
  • Lossy compression achieves a higher compression ratio but some data is lost
  • Lossless compression retains all the original data but compression ratios are lower
25
Q

Exam Question) What is meant by Symmetric Encryption and give an example of a symmetric encryption algorithm

A
  • Type of encryption where the same key is used to encrypt and decrypt the data.
  • The substitution or Ceaser Cipher
26
Q

Exam Question) What is meant by asymmetric encryption

A
  • The encryption and decryption keys are different
  • For example RSA Cipher
27
Q

Exam Question

  1. Other than encryption give 1 use of a hash function
  2. Describe what is meant by the term “hash”
A
  1. Hash functions can be used to create digital signatures
  2. A result generated by applying an algorithm/ numeric process to a value
28
Q

Exam Question) Describe 1 advantage to storing passwords as a hash

A
  • Hash functions are 1 way/ can’t be reversed
  • If someone gains access to the database they cant access user’s password
29
Q

Exam Question: Explain 2 characteristics of the hashing algorithm

A
  • Low chance of collision (i.e. different inputs giving same output) (1 – AO1.2)
    • to reduce risk of different files being marked as the same (1 – AO2.1)
  • Quick to calculate (1 – AO1.2)
    • as lots of files need to be hashed / needs to be quicker than a bitwise comparison to make it worthwhile (1 – AO2.1).
  • Provides a smaller output than input (1 – AO1.2)
    • so quicker to compare hashes than original data (1 – AO2.1).