1.3 Exchanging Data Flashcards
1.3.1 (a) Purpose of Compression
Reduces the size of files
Reduces download time
Reduce storage requirements
Makes the best use of bandwidth
Lossy or Lossless Compression
When a compressed file arrives it needs to be uncompressed to be read
1.3.1 (a) Bandwidth
Lots of data is sent and streamed over the internet everyday
Considerably speed up transmission times if compression is used
1.3.1 (a) Lossy Compression
Reduces the size of a file, by removing non essential data
Could store a lower number of colours (colour depth), or a larger area of pixels as a single colour, both reduce the quality of the compressed image
Usually used with images, audio and video, where loss in quality is not noticed -> Considered an acceptable compromise of quality vs file size
1.3.1 (a) Lossless Compression
Does not sacrifice any quality during compression
Store the binary number for the colour, followed by the number of pixels that occur in this colour consecutively
It can be restored to its original quality when uncompressed
Method is only effective on images with large areas of continuous colours
Ideal for vector style images like logos
Less ideal for full photos with few repeating colours
1.3.1 (a) File Types and Compression
File type determines which compression method is best, some are not suited for lossy compression
Text documents and executable programs must not loose any of the data during compression -> Lossless compression must be used
1.3.1 Compression Summary
Reduces the size of a file
Makes files quicker to transfer
Files take up less storage space
1.3.1 (a) Lossy Summary
Some data is lost
Slight reduction in quality
Large reduction in file size
Images, audio, video
1.3.1 (a) Lossless Summary
None of the original data is lost
Original file can be recreated when uncompressed
Suitable for executable files and text documents
1.3.1 (b) Dictionary Encoding
Lossless Compression
Ideal for text based documents
Builds an index (like a table)
Every data item or file entry is recorded, with an indexed reference or unique code
File contains a dictionary index, sequence of occurrences in the original file
1.3.1 (b) Run Length Encoding
Lossless compression
Compression of Images
Good for bitmap images (made up of discrete pixels)
We need to recreate every pixel for lossless compression
Store the image in frequency/data pairs
1 number represents the number of continuous pixels
Other number represents the colour of the pixel
1.3.1 (c) Encryption
Encoding a message so it can only be read by the sender and the intended recipient
1.3.1 (c) Caesar Cipher
Replaces each letter in the alphabet with another letter a fixed distance from the original letter
For decryption, the recipient needs to know how many places the alphabet has been shifted by (the key)
Can still be cracked without the key
1.3.1 (b) Symmetric Encryption
A single key is used to encrypt and decrypt the message
Both parties know the key and both parties must keep it a secret
The same key can be used multiple times - But using unique keys makes it more difficult to crack
Danger of cracking: Interception of the key
Duplication of the key production process to acquire a copy of the key
Less secure than asymmetric encryption
1.3.1 (c) Asymmetric Encryption
Two different keys are used to encrypt and decrypt the message, the keys are unique from each other
Virtually impossible to derive one key from the other making it more secure
Keys are generated so that anything encrypted with one of the keys can be decrypted with the other - Key pairs
One key is made our public key and distribute, other is private and not
Can be shared on key safes secure severs on the cloud, to be accessed
People send your encrypted message using your public key
You decrypt using your private key
1.3.1 (c) Digital Fingerprints
Asymmetric Encryption
You encrypt your message using your private key, anyone can decrypt using your public key
Shows where the message came from
1.3.1 (c) Final Encryption Solution
Combined Encryption Key: Your private key, their public key
Use the remaining keys to decrypt
No-one else can read the message, both people know it is secure
Confirmation of authenticity
Confirms message has not been modified
1.3.1 (d) Hashing Function
Transforms a string of character into a fixed length value or key that represents the original input string
E.g. SHA-1, MD5
1.3.1 (d) Hashing Features
A slight change in the original message produces a totally different hash value
One way process -> Cannot get to original value even with access to the original algorithm
1.3.1 (d) Use of hashing
Prevents passwords and pins from being read by a hacker
The hashing function value can be sent and stored in the online system - Cannot be interpreted
To check if the password is correct, the hashing value is compared to the stored value
1.3.1 (d) Other uses of Hashing
Used for quick searching, insertion and deletion of data from data structures
Data structure does not need to be searched
Hashing function applied to the input, finds the item immediately without sorting
Provides a constant time complexity
1.3.2 (a) Database
Organised collection of data
Organising data into a database allows for easy:
Adding
Modification
Deletion
Searching
1.3.2 (a) Electronic Databases Benefits
Easier to retrieve, add, delete, update and modify data
Easier backup and copies of data
Can be accessed by multiple people at the same time from different location
1.3.2 (a) Storing Data on a Database
Data is stored in: Table/Entity/File
A table contains: Rows/Records/Tuples
Table contains: Columns/Fields/Attributes
1.3.2 (a) Flat Files
Contains only a single table
Saved as a comma separated values file (CSV)
Quick to set up, little expertise to maintain
Suitable for storing small amounts of data
Simple
E.g. Contact Details
Ineffictient