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
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
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
4
Q
What are the 2 types of compression
A
- Lossy
- Lossless
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
6
Q
What is Lossless Compression
A
- Able to reduce a file’s size without losing any information.
- Original file can be perfectly restored
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
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
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
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
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
12
Q
Why is Caeser Cipher bad
A
- The shift cipher is weak
- Modern computers could use brute force hacking to crack it.
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)
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
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.