Compression, encryption and hashing Flashcards

(33 cards)

1
Q

why is data compressed?

A
  • to reduce storage space of files on disk
  • to send data faster
  • use less bandwidth - eg. if the ISP sets bandwidth limits/charges
  • less buffering on audio/video streams
  • webpages load quicker with compressed images
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what is lossy compression?

A

non-essential information is removed permanently from the data
eg. different shades of the same colour are removed from an image, sound frequencies outside human hearing range are removed

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

what is lossless compression?

A

patterns in data are spotted and summarised in a shorter format without permanently removing any information

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

how is an image compressed using bitmapping?

A
  • the image is made up of pixel of different colours arranged in rows and columns
  • file size is reduced by reducing the variety of colours shown
  • the image is reconstructed without the missing data
  • leads to much smaller file size but also lower quality
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

how does lossy audio/video compression work in an MP3 file?

A
  • removes sounds of frequencies too high for most ppl to hear
  • removes quieter sounds played at the same time as loud sounds
  • resulting file is about 10% of original size - 1 min = 1MB
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

where is lossy compression used vs lossless?

A
  • lossy: in images, audio and video where one slightly different/missing pixel/note wouldnt make that much difference
  • lossless: in text files/program files where one missing letter could cause an error/loss of critical information
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

how does compression compare between lossy and lossless compression?

A
  • lossy: very significant file size reduction
  • lossless: not as much reduction as lossy, but still a pretty significant reduction
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what is run length encoding and how does it work?

A
  • a form of lossless compression
  • works by summarising consecutive patterns of data
  • good for where there is lots of repeated data eg. pixels in an image
  • eg. in an image: records the number of times a pixel colour is repeated consecutively and the colour repeated, all in the correct order of it appearing
  • eg. in sound: 1000s of indentical samples are taken of the same note played for a longish time - one sample of a note is taken and applied everywhere
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what is dictionary compression and how does it work?

A
  • a form of lossless compression
  • best used for long passages of text
  • repeated patterns/words are identified
  • a dictionary is created consisting of all the words in the passage
  • the passage is now stored as numbers that correspond to the correct word in the dictionary - uses up significantly less space, even when including the size of the dictionary
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

how could dictionary compression of a passage of text become even more efficient?

A

instead of storing words in the dictionary, store repeated phrases

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

what is encryption?

A

the transformation of data from one form to another to prevent an unauthorised third party from being able to understand it

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

what is plaintext?

A

the original unencrypted text/data

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

what is ciphertext?

A

the encrypted text/data

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

what is the cipher?

A

the encryption method or algorithm

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

what is the key?

A

the secret information to lock/unlock the message

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

how does the Caesar cipher and the Vernam cipher compare in terms of level of security?

A
  • Caesar: very weak security - easily broken with little to no computational power (eg. by brute force attack)
  • Vernam: perfect security
  • all other ciphers are in between
17
Q

what is the Caesar cipher and how does it work?

A
  • a substitution cipher
  • all the letters of the alphabet are shifted along by a constant amount - indicated in the key
  • very basic encryption + the most insecure
  • made a teeny bit more secure by removing spaces to mask word length
18
Q

what is a brute force attack?

A

attempts to apply every possible key to decrypt the ciphertext until one works

19
Q

what is the Vernam cipher and how does it work?

A

the only cipher that is still proven unbreakable
1) one time pad
2) bitwise exclusive - xor operation

20
Q

how does the one time pad work in the Vernam cipher?

A
  • its the encryption key
  • must be at least as long in characters as the plaintext
  • can only be used once
  • sender + recipient are both party to the key - they meet in person to securely share the key + destroy it immediately after decryption
  • it is random - character distribution is random = no cryptoanalysis will give any meaningful results
21
Q

what is the xor operation carried out in the Vernam cipher?

A
  • the second step
  • xor operation done between binary character value of first character of plaintext + first character of the one-time pad
  • often produces strange/unprintable symbols as ASCII ciphertext but this isnt normally an issue since the message is transmitted in binary
  • to decrypt: XOR operation carried out on ciphertext using the one-time pad, restoring to plaintext
22
Q

how is perfect security guaranteed with the Vernam cipher?

A
  • the key is generated using a truly random source - eg. white noise, the timing of a hard disk read/write head, radioactive decay
  • this is mathematically impossible to break
  • computer generated random keys arent actually random - they are mathematically generated so just have the illusion of being random
23
Q

what is frequency analysis?

A
  • you use facts about the english language to try and work out the key and decrypt ciphertext
  • not all letters in the english language are used equally often - most common: E,T,A,O,I,N,S,R,H
  • least common: Z,J,K,Q,X
  • most commonly used words depend on the language
24
Q

what is symmetric encryption?

A
  • aka private key encryption
  • same key is used to encrypt + decrypt data
  • key must also be exchanged to the same destination as ciphertext (key exchange)
  • this is a security problem - the key can be intercepted as easily as the ciphertext to decrypt data
25
what is asymmetric encryption?
- uses 2 separate but related keys - public key is made public - used by others to encrypt data they want to send you - private key is only known by you - the only way to decrypt encrypted data - impossible to deduce private key from public key - messages are digitally signed to authenticate sender - prevents malicious third party from sending messages using your public key
26
what is hashing?
a method to convert any data into a fixed-size string of characters - a digest
27
how consistent is hashing?
- the same input will always produce the same hash - even a minor change in input provides a radically different hash - very sensitive to data changes
28
what are some common hashing algorithms?
- MD5 - widely used but weak - vulnerable to collision attacks - SHA-1 - previously used in SSL certificates + software repositories - now weak due to vulnerabilities - SHA-256 - used for cryptographic applications + data integrity checks - secure enough for most practical purposes - SHA-3 - most recent member of Secure Hash Algorithm family - designed to provide higher levels of security
29
how fast is hashing compared to encryption?
generally faster processing speed esp compared to stronger encryption methods
30
how secure is hashing?
irreversible so very secure but vulnerable to collisions
31
how is hashing used in password storage?
- when a user creates an account, their password is stored as a hash (in a database) - when a user logs in they enter their username + password - entered password is hashed during login attempt - hashed password is compared against stored hash in the database - if the hashes match, the user is authenticated, otherwise access is denied
32
why is it a good idea to store passwords as hashes?
- it adds an extra layer of security - hackers can't use passwords directly even if the database is compromised because they are hashed - better than storing passwords in plaintext - minimises risk + potential legal repercussions - raw passwords are not exposed - reduces impact - hashing function always produces same output - quick password verification
33
how can hashed data be used to verify data integrity ?
- when data is tranferred over a network it is possible for there to be packet loss/malicious interference - if 2 hashes are compared and are identical then data integrity has been maintained - comparing 2 fixed length hashes is less computationally intensive than string comparison