Encryption and compression - 96 - 99 Flashcards
What is the trade-off between when compressing files?
The quality of the file and the amount of processing power that will be needed to compress/decompress
What does lossy compression involve?
- Reducing file size by removing non essential data
- original can’t be reconstructed
What does lossless compression involve?
Reducing file size in a way which results in no data loss
when is lossy compression used
sound and images
- in executable file, where all data is necessary
advantages of lossy compression
we can get a considerable reduction in file size and the user will notice no difference in quality
examples of lossy file formats
JPEG
MPEG
MP3
advantages of lossless compression
allows the original file to be recreated exactly
how does lossless compression work
- by using redundant data
- for example, if an item occurs multiple times, then the actual item will only be stored and sensed once
example of dictionary coding formats
- ZIP
GIF
PNG
examples of lossless compression
Dictionary coding and run length encoding
How does dictionary coding work?
substrings of original data are represented by
single tokens;
A dictionary is formed using the tokens as the keys;
The strings of symbols are used as the entries;
how does run length encoding work
- a run is a sequence of the same colour
- the number of consecutive pixels of the same colour would need to be counted
- eg 7 Yellow
when is run length encoding used
source code,images
what is encryption
converting a message into a form that is only understandable by the intended parties
summarise the method of encryption
the sender will apply an encryption key to a plaintext message, the recipient receives the encrypted message and uses a decryption key to see the plaintext
disadvantages of the caesar cypher
- easy cipher to crack
- only 25 possible shifts
- Very easy to break with modern techniques; brute-force or frequency analysis can quickly reveal the key.
how to provide perfect security
- if the encryption key (one time pad) is equal to or longer than the plaintext message
- if the key is truly random
- if the key is used only once and then destroyed
whats the difference between the Vernam cipher and all the others
nothing can be learnt about the plaintext using the ciphertext
- others are based on computational theory and can be cracked
what is compression
reducing file size
advantages of dictionary based compression
a pre existing dictionary may exist so the encoder might not have to make a new one
Why is the Vernam cipher considered as a cipher with perfect security?
- because if the key (one-time pad) is truly random, at least as long as the message, and never reused, then the cipher
How do you encrypt a plaintext message using the Caesar cipher?
each letter in the plaintext is shifted 5 places down the alphabet.
ciphertext
encrypted version of plaintext
plaintext
the original, readable text or message
difference between symmetric and asymmetric cyphers
- symmetric means the same key is used to encrypt and decrypt
- asymmetric is when different but related keys are used for encryption and decryption
explain the key difference between lossy and lossless compression
the original data can be fully recovered if lossless has been used
lossy compression cannot be reversed
how to compress text using dictionary based
- a dictionary is built that maps sequences of characters in the text onto tokens
- the characters are then replaced by the corresponding tokens in the dictionary
why would dictionary based compression not be very effective for compressing small amounts of text
- for small pieces of text, there is little repetition
- the dictionary will require storage space
what does it mean if a cipher is computationally secure
the cipher cannot be cracked in a polynomial amount of time
explain what the key exchange problem is
how to pass the key to the receiver without it being intercepted
explain how a computer (computer b) would decrypt a message using asymmetric encryption and verify it was sent by another computer (comp A)
- Bs private key is used to decrypt the message
- the message is rehashed
- As public key is used to decrypt the digital signature
- if both gashes match then the sender can be authenticated
if a picture contains a lot of different colours, why might run length encoding not be appropriate to compress the image
- runs will be of shorter length because colour depth is higher
- the additional run length data may cancel out the reduction in storage of pixel colour data