1.3.1 Compression, Encryption and Hashing

Cards (18)

  • Compression is used to reduce the storage space required by a file, allowing for more files to be stored with the same amount of storage space
  • Compression is crucial for sharing files over networks or the Internet
  • Apps like Google Photos compress files for quick search and download purposes
  • Lossy compression reduces the size of a file while removing some information, potentially resulting in a more pixelated image or less clear audio recording
  • Lossless compression reduces the size of a file without losing any information, allowing the original file to be recovered from the compressed version
  • Run Length Encoding (RLE) is a method of lossless compression where repeated values are replaced with one occurrence of the data followed by the number of times it should be repeated
  • Run Length Encoding relies on consecutive pieces of data being the same for effective compression
  • Dictionary Encoding is a method of lossless compression where frequently occurring pieces of data are replaced with an index and stored alongside a dictionary
  • Data compressed using dictionary compression must be transferred alongside its dictionary for proper restoration
  • Symmetric encryption involves both the sender and receiver sharing the same private key for encrypting and decrypting data
  • If the private key in symmetric encryption is intercepted during the key exchange, communications can be intercepted and decrypted
  • Asymmetric encryption uses two keys - a public key for encryption and a private key for decryption, providing a more secure method than symmetric encryption
  • In asymmetric encryption, messages encrypted with the recipient's public key can only be decrypted with the recipient's private key
  • Hashing is a process where an input (key) is turned into a fixed-size value (hash) using hash functions
  • The output of a hash function cannot be reversed to obtain the original key, making hashing useful for storing passwords securely
  • Hash tables are data structures that hold key-value pairs and are used for quick data lookup in constant time
  • If two pieces of data produce the same hash in a hash table, a collision occurs, which can be managed by various methods like storing items together in a list under the hash value
  • A good hash function should have a low chance of collision, be quick to calculate, and provide an output smaller than the input for efficient searching