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