1.3.1 - Compression, Encryption and Hashing Flashcards
What is compression?
Compression is the process used to reduce the storage space required by a file, meaning
you can store more files with the same amount of storage space.
Why is compression useful in apps?
Apps like Google Photos compress files so that they can quickly be searched for and
downloaded. Downloading a compressed file over the Internet is faster than downloading
the full version of the file.
What does lossy compression do?
Lossy compression reduces the size of a file while also removing some of its information. This
could result in a more pixelated image or less clear audio recording.
What does lossless compression do?
Lossless compression reduces the size of a file without losing any information. The original file can be recovered from the compressed version.
What is run length encoding?
Run length encoding is a method of lossless compression in which repeated values are removed and replaced with one occurrence of the data followed by the number of times it should be repeated.
When does run length encoding work?
Run length encoding relies on consecutive pieces of data being the same - if there’s little repetition, run length encoding doesn’t offer a great reduction in file
size.
What is dictionary encoding?
Dictionary encoding is another example of a method of lossless compression. Frequently occurring pieces of data are replaced with an index and compressed data is stored alongside a dictionary which matches the frequently occurring data to an index. The
original data can then be restored using the dictionary.
What is encryption?
Encryption is used to keep data secure when it’s being transmitted
How does symmetric encryption work?
In symmetric encryption, both the sender and receiver share the same private key, which they distribute to each other in a process called a key exchange.
This key is used for both
encrypting and decrypting data.
Why should the private key be kept secret?
If the key is intercepted during the key
exchange then any communications sent can be intercepted and decrypted using the key.
How does asymmetric encryption work?
Two keys are used: one public
and a second, private, key. The public key can be published anywhere, free for the world
to see, while the private key must be kept secret. Together, these keys are known as a key
pair and are mathematically related to one another.
How are messages encrypted and decrypted?
A single key cannot be used to encrypt and decrypt communication. Instead, messages encrypted with the recipient’s public key can only be decrypted with the recipient’s private key. So, someone can find your public key on a website and send you a message only you can decode.
How can you prove a message was sent by you?
You can encrypt it using your private key, meaning anyone can decrypt it with your public key. This guarantees you encrypted the message, and forms the basis of a system called digital signatures.
What is hashing?
Hashing is the name given to a process in which an input (called a key) is turned into a
fixed size value (called a hash). There are a vast number of functions, called hash functions, which do this.
What is the difference between encryption and hashing?
The output of a hash function can’t be reversed to form the key.