1.3.1 Compression, Encryption and Hashing

Cards (26)

  • What is the purpose of compression?
    To reduce storage space required by a file
  • Why is compression important for sharing files?
    It allows more files to be transferred quickly
  • What is a benefit of downloading compressed files?
    Faster download speeds
  • What are the two categories of compression?
    • Lossy compression
    • Lossless compression
  • What happens to a file during lossy compression?
    Some information is removed from the file
  • How does lossless compression differ from lossy compression?
    Lossless preserves all original information
  • What is run length encoding (RLE)?
    A method of lossless compression
  • How does run length encoding work?
    It replaces repeated values with one occurrence
  • What is the RLE representation of AAAAAABBBBBCCC?
    A6B5C3
  • When does run length encoding not work well?
    When there’s little repetition in data
  • What is dictionary encoding in lossless compression?
    • Replaces frequently occurring data with an index
    • Compressed data stored alongside a dictionary
    • Original data can be restored using the dictionary
  • What must be transferred alongside data compressed using dictionary encoding?
    The dictionary for data restoration
  • What is the purpose of encryption?
    To keep data secure during transmission
  • What are the two types of encryption methods?
    • Symmetric encryption
    • Asymmetric encryption
  • What is shared in symmetric encryption?
    A private key between sender and receiver
  • What is a risk of symmetric encryption?
    If the private key is intercepted
  • How does asymmetric encryption differ from symmetric encryption?
    It uses a public and a private key
  • What is a key pair in asymmetric encryption?
    A public key and a private key
  • What happens to messages encrypted with a public key?
    Only the recipient's private key can decrypt
  • How can you prove a message was sent by you?
    Encrypt it with your private key
  • What is hashing?
    • Process of turning input into a fixed size value
    • Uses algorithms called hash functions
    • Output cannot be reversed to form the key
  • Why is hashing useful for storing passwords?
    It can't be reversed to reveal passwords
  • What is a hash table?
    • Data structure holding key-value pairs
    • Formed from a bucket array and a hash function
    • Used for constant time data lookup
  • What happens when two keys produce the same hash?
    A collision occurs
  • What should a good hash function provide?
    Low chance of collision and quick calculation
  • Why should the output of a hash function be smaller than the input?
    To ensure efficient searching for the hash