1.3.1 - Compression, Encryption and Hashing
No description yet. This curated deck is ready for daily study.
Card preview (20)
What is compression?
A way of reduceing data and file sizes
What factors need to be taken into account when using compression?
The available bandwidth The expected processing power of the user’s computer The expected storage requirements.
What are the two types of compression?
Lossy Compression Lossless Compression
What is lossy compression?
An algorithm that REMOVES DATA from the file to make file storage space or size smaller but the accuracy with which it represents. The data and information that is reduced is lost in the process and is not recoverable. Assumes there is enough data remaining to be acceptable and similar to before hand (ei readable or still looks like the same image) Commonly used for sound and image files: - JPEG - MPEG - MP3.
What is lossless compression?
An algorithm is used to retain all the information in a file while reducing its size. Files are stored and transmitted intact so the original can be reconstructed from this data. Commonly used for the following files: - program code - ZIP - GIF - PNG.
What is run length encoding? (RLE)?
Is an algorithm that will loop through data. It then uses dictionaries to store the number of like data. For example here is some data: aaaabbbbcccccddddddeee Here it would create a dictionary of an integer and a string with the integer being the amount of strings in the data set: 4a4b5c6d3e In simpler terms: A dictionary is used to store items such as pixels, words or other groupings of bits. Repeated occurrences are stored in a dictionary or table, plus their number of occurrences, e.g. 100 blue pixels can be stored as B100. Used in TIFF and BMP files.
What is dictionary coding?
Dictionary coding replaces recurring sequences with shorter, unique codes A ‘dictionary’ is compiled to map original sequences to special codes This method is effective for both text and binary data The phrase “for example” could be coded as ‘FE’ if ‘FE’ doesn’t appear in the original text A sequence of binary numbers ‘1010’ could be replaced by a shorter unique code It may map two strings together, say the sentence is Hello world Hello: H World: W So the compressed message is HW
What is a dictionary?
Is a data structure that maps values to a key. e.g “Fun”: 1 “Two”: 2
What are the advantages and disadvantages of dictionary coding and run length encoding?
RLE: More effective when data has lots of repetition but may create larger files when input is too complex (ieofgignhfdikdfhbgui) will make a longer message as there are more single units. Dictionary Coding: More versatile but may require more computational resources
What are the uses of encryption?
Widely used when transmitting information on the internet and in networks because data can be intercepted. Protects files so that if unauthorised access is gained the data is unintelligible. It is Important in VPNs because of the number of users sharing the physical network.
What is encryption?
Is used to protect data from being stolen, changed, or compromised and works by scrambling data into a secret code that can only be unlocked with a unique digital key.
What is an encryption key?
Keys are long random numbers which have the information needed to encrypt and decrypt messages.
What are the two types of encryption keys?
Public key is publicly available to all. Private key is kept confidential to its owner.
What are two types of encryption?
Symmetric encryption Asymmetric encryption
What is symmetric encryption?
The same key is used to encrypt and to decrypt. Requires both parties to have a copy of the key. Can’t be transmitted over the Internet or an eavesdropper monitoring the message may see it.
What is asymmetric encryption?
Different keys are used to encrypt and to decrypt – this is more secure. The public key encrypts the data. The private key decrypts the data.
What is hashing?
Hashing is a method to convert any data into a fixed-size string of characters This fixed-size output is often called a digest
What are some advantages of hashing?
Same input will always produce the same hash, providing consistency Even a minor change in input produces a radically different hash, giving it sensitivity to data changes
What are three examples of hashing algorithms?
MD5 (Message Digest 5) - Widely used but considered weak due to vulnerabilities to collision attacks SHA-1 (Secure Hash Algorithm 1) - Previously used in SSL certificates and software repositories, now considered weak due to vulnerabilities SHA-256 (Part of the SHA-2 family )- Commonly used in cryptographic applications and data integrity checks. Considered secure for most practical purposes
What are 7 differences between encryption and hashing?
Purpose Encryption = Securing data for transmission or storage; reversible Hashing = Data verification, quick data retrieval, irreversible Reversibility Encryption = Can be decrypted to the original data Hashing = It cannot be reversed to the original data Keys Encryption = Uses keys for encryption and decryption Hashing = Doesn’t use keys Processing Speed Encryption = Generally slower for strong encryption methods Hashing = Generally faster Use Cases Encryption = Secure communications, file storage Hashing = Password storage, data integrity checks Security Encryption = Varies; potentially strong but dependent on key management Hashing = One-way function makes it secure but susceptible to collisions Data Length Encryption = Output length varies; could be same or longer than input Hashing = Fixed length output