OCR A Level Computer Science: Compression, Encryption, and Hashing

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play

1/22

flashcard set

Earn XP

Description and Tags

Comprehensive practice flashcards on lossy and lossless compression, dictionary coding, run length encoding, symmetric and asymmetric encryption, and hashing.

23 Terms

1
New cards

What is encryption as defined in the lecture?

The process of encoding a message so it can be read only by the sender and the intended recipient.

2
New cards

How does a Caesar cipher operate, and what is its "key"?

It replaces each letter of the alphabet with another letter a fixed distance away from the original; the key is the number of places the alphabet has been shifted.

3
New cards

What is symmetric encryption and what are its primary security risks?

An encryption method where a single key is used to both encrypt and decrypt the message; risks include interception of the key or duplication of the key production process.

4
New cards

What is asymmetric encryption?

An encryption method that uses a key pair consisting of two different keys (a public key and a private key), where data encrypted with one key is decrypted with the other and it is virtually impossible to derive one key from the other.

5
New cards

What are key safes?

Secure servers in the cloud where public keys are often stored.

6
New cards

In asymmetric encryption, how does a sender transmit a private message to a recipient?

The sender encrypts the message using the recipient's public key; the recipient then decrypts it using their own private key.

7
New cards

What is the purpose of a sender encrypting a message using their private key?

To authenticate the message; since it can be decrypted using the sender's public key, it confirms the message originated from that sender and not someone else.

8
New cards

What four guarantees are established when using a combined encryption key (sender's private key and recipient's public key)?

  1. The sender knows no one else can read the message.
  2. The recipient knows no one else can read the message.
  3. The recipient is sure the message is authentic.
  4. The recipient is sure the message has not been modified in transit.
9
New cards

What is a 256-bit encryption key physically, and how many possible combinations does it possess?

It is a sequence of alphanumeric characters (often represented in hexadecimal) with 22562^{256} possible combinations (a 78-digit number).

10
New cards

What is a hashing function?

A function that transforms a string of characters into a fixed-length value or key that represents the original input string.

11
New cards

Which two popular hashing algorithms are highlighted in the lecture?

SHA-1 and MD5.

12
New cards

What is the fundamental difference between hashing and encryption?

Hashing is a one-way process; it is impossible to recover the original value from the hashed value even if you have access to the original hashing algorithm.

13
New cards

How does hashing protect passwords during login verification?

The system applies the hashing function to the user-entered password and compares the result to the stored hash value, preventing the plain text password from ever being transmitted or stored.

14
New cards

What is the average time complexity provided by hashing for searching, inserting, and deleting items in data structures?

An average constant time complexity of O(1)O(1).

15
New cards

Which file types are best suited for dictionary coding versus run length encoding?

Dictionary coding is ideal for text-based documents, whereas run length encoding is ideal for bitmap images.

16
New cards

What two components comprise a file compressed using dictionary coding?

The dictionary index and the sequence of occurrences needed to recreate the original file.

17
New cards

In the lecture's dictionary coding example, how was the text compressed from 840 bits down to 230 bits?

The original text had 105 characters at 8 bits8\text{ bits} per character (840 bits840\text{ bits}). The compressed version used 46 numbers (values 1 to 17, requiring 5 bits5\text{ bits} each), totaling 230 bits230\text{ bits} or 27%27\% of its original size.

18
New cards

How does run length encoding store repeating pixel data in bitmap images?

It stores data in frequency-data pairs (for example, "22 0" represents 22 contiguous white pixels).

19
New cards

What are the four primary purposes of compressing files?

To reduce file size, reduce download times, reduce storage requirements on secondary media, and make best use of available bandwidth when transmitting data.

20
New cards

What is color depth in bitmap images?

The number of bits required for each pixel to store combinations of colors (e.g., 1 bit1\text{ bit} for 2 colors, 2 bits2\text{ bits} for 4 colors, and 3 bits3\text{ bits} for 8 colors).

21
New cards

What two lossy compression techniques can reduce the file size of an image?

Storing a lower number of colors or storing larger areas of pixels as a single color.

22
New cards

Why must text documents and executable program files use lossless compression rather than lossy compression?

They cannot lose any data during compression without becoming corrupted or unusable, meaning the original file must be reconstructed in its entirety.

23
New cards

Why is run length encoding effective for vector-style images but ineffective for full-color photographs?

Vector-style images (cartoons, logos, icons) contain large areas of continuous repeating color, whereas full-color photographs have very few blocks of continuous repeating color.