1.3.1 Compression, encryption and hashing Flashcards
What is Lossy compression?
A compression method where non essential data is permanently removed
- Deletes the data when its compressed
- It deletes unnecessary data
- Usually normally on images, videos and audio
Benefits of Lossy Compression
- It results in significantly smaller file size, smaller than lossless
- Quicker transmission speed
Drawbacks of Lossy Compression
-Loss image/video quality
-
What is Lossless Compression?
Patterns in data are spotted and summarised in a shorter format
- With lossless the size of the image can be reduced, but also the image can be restored
- It is ideal for vector images such as cartoons
- It records the patterns instead of the data
Benefits of Lossless Compression
- No loss of quality
- Slight decrease in image file size
- Full restoration of data is available after transmission
Drawbacks of Lossless Compression
- Larger files than using lossy
- Slower loading speeds
What are the methods of Lossless Compression?
- Dictionary Encoding
2. Run Length Encoding
What is Encryption?
The process of protecting data so that once it has been sent over a network the data is no longer identifiable
What is Symmetric encryption
The same key is used to encrypt and decrypt
–This means that the key must be sent to the recipient
The key can be intercepted and the data can then be stolen
What is Asymmetric Encryption?
- This uses two different but related keys
- One key, known as the public key, is made public so that others wishing to send you data can use this key to encrypt it
- The public key cannot decrypt the data
- Only the private key can be used to decrypt the data
What is Hashing?
This is the process of encryption that makes use of a hash function to give the data a hash value.The value can then be used to identify the data inside a hash table.
The use of hashing for encryption
- Hashing can not be undone, so the original data can not be returned.
- Hashing is useful for storing PIN codes and passwords
- To verify a user’s password, the software applies the hash function to the user input and compares the hashed result with the one stored
What is a Collision in Hashing?
- A collision happens when an algorithm generates the same address for different primary keys
- A collision is sometimes referred to as a synonym
- However good the hashing algorithm is, it is impossible to avoid collisions
How to deal with a collision
- The easiest method is too put the item into next free slot available
- A disadvantage is that it causes a clustering of items
- An alternative algorithm is to increment the ‘skip’ value by adding 1,3, 5, 7 etc. instead of repeatedly incrementing by 1 to find a free space.
- Note that the size of the skip value must be such that all slots in the table will eventually be reached, or part of the table will be unused