Hashing Flashcards
What is hashing?
The process of taking an input of a variable length and mapping it to a fixed-size output value. The output of these functions is referred to as hashes
Where might hashing be used?
In hash maps or hash tables which are a type of data structure used in programming that use hashing algorithms to organise data
Used to generate checksums, which are used to identify errors when transmitting or storing data
For cryptographic hash functions for generating digital signatures, securely storing passwords or fingerprinting files
To identify potentially malicious files
How can cryptographic hashing be used to identify potentially malicious files?
Attackers can easily change the name of a file to successfully distribute the same malware using different file names. Hashes can be generated based on the content of a file and security experts can compare these hashes with other samples using services such as VirusTotal
What makes a cryptographic hash function?
- It consistently gives the same output for a given input (it’s deterministic)
- It’s relatively quick to compute the hash of a given input
- Different inputs should produce different outputs so there are no collisions
- Making a small change to input should produce a significant change to output (avalanche effect)
- It should be practically impossible to reverse the output to get the input, or produce an input that gives a known output
List some commonly used hashing algorithms
- MD5 (Message Digest 5)
- SHA-1 (Secure Hashing Algorithm 1)
- SHA-256
- CRC-16 and CRC-32 (Cyclic Redundancy Check (CRC)
What is MD5?
MD5 (Message Digest 5) Designed in 1991 by Ronald Rivest and was originally intended to be used as a cryptographic hash function but has since been found to suffer many vulnerabilities so more commonly used to generate checksums and verify data
What is SHA-1?
SHA-1 (Secure Hash Algorithm 1) is a cryptographic hash function which takes an input and produces a 40-character hexadecimal number. Used less frequently now due to risk of collisions
What is SHA-256?
SHA-256 (Secure Hash Algorithm 256) is one of six hashing functions which forms part of the Secure Hash Algorithm 2 (SHA-2) family. Designed by the NSA as a replacement for SHA-1. Used by a range of protocols including TLS, SSL and PGP
What is CRC-16 and CRC-32?
Cyclic Redundancy Check (CRC) is an error-detecting algorithm that is often used to identify errors which have occurred during storage and transmission.
CRC-32 is used by Ethernet and SATA compliant devices whereas CRC-16 is used in a range of applications such as Bluetooth and Modbus protocols