1.3.1.Compression, Encryption and Hashing (chp7)
No description yet. This curated deck is ready for daily study.
Card preview (12)
What is Compression?
• reducing the amount of storage space required by a file. - it removes unnecessary bits to reduce overall size.
Why is compression used?
• increases the number of files that can transmitted in a given time • reduces download times • better performance • reduces storage requirements
How to work out Compression Ratio
Compressed size/ original size
Lossy Compression
• reduces file size but some of the information is lost during the process. • The original file cannot be perfectly reconstructed.
Lossless Compression
• reduces file size without losing any information. • the original file can always be perfectly restored. • With text documents and executable programs, use lossless because we need to be able to restore the file entirely.
Run Length Encoding
(method of lossless compression) • repeated values are removed and replaced with one occurrence followed by the number of times it should be repeated. • relies on consecutive pieces of data being the same. • doesn’t offer a great reduction in file size if there’s little repetition.
Dictionary Encoding
• frequently occurring pieces of data replaced with an index. • Compressed data stored alongside a dictionary which matches frequently occurring data to an index. • Original data can be restored using the dictionary. • its important to remember that data compressed using dictionary compression must be transferred alongside its dictionary. Without the dictionary, data cannot be used.
Encryption
• the act of scrambling a piece of plain data into cipher text so that it can’t be immediately understood. • used to keep data secure when being transmitted.
Symmetric Encryption
• requires both sender and receiver to have the same key. • the key is distributed by key exchange • key is used for both encrypting and decrypting data • the key must be kept secret • if key is intercepted then communications can be intercepted and understood • Example: Caesar Cipher
Asymmetric Encryption
• two keys are used: one private (must be kept secret) and one public (can be published anywhere) • keys are mathematically related to each other • messages encrypted with public key can only be decrypted using private key • Example: RSA Cipher
Explain why asymmetric is more suited to transactions over the internet than symmetric encryption. [4]`
symmetric encryption would require both parties to have a copy of the key [1] This couldn’t be transmitted over the internet as it could be intercepted by anyone monitoring [1]. Asymmetric gets around this requirement as there are two different keys [1] . One key encrypts the data [1] which can be publicly distributed [1] and a different key to decrypt it [1] which is kept private [1]
Hashing
• transforms a string of characters (input) into a fixed length value/ key. • contains algorithm that converts the input into a totally different hash value • one way process so cannot get back to the original value • ideal fro preventing info like passwords and PINs from being read by a hacker. • Hash functions can be used to create digital signatures