Cryptology: Hash functions Flashcards

1
Q

What are hash functions?

A

Hash functions are algorithms capable of accepting any binary input of arbitrary length and producing a fixed length output. Any one sequence of bytes will always produce the same output (hash). Hash functions are frequently used as signatures in security as they provide a simple method for determining whether a given file (image, program) has been seen before.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the key security requirement for hash functions?

A

Hash functions must be difficult to crack. In short, flipping a single bit in the output should ideally flip half of the bits of the output. Such high levels of diffusion makes cracking the hash function very computationally expensive.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the difference between keyed and unkeyed hashes?

A

Unkeyed hashes simply accept some input and produce the hash. This is commonly used in applications where no level of secrecy is required, i.e., shared malware signatures on virustotal or hashes provided by software distributers to allow users to verify whether they have installed a legitimate version of the software. SHA-1, SHA-3, and MD5 are examples of unkeyed hashing algorithms.

Keyed hashes utilise encryption mechanisms to secure the hash. HMAC is a well known hashing algorithm utilising a key k and encryption algorithm E. As HMAC is a block cipher hashing algorithm, it simply begins by encrypting the first message block with the provided key. Then it proceeds to XOR the previous block with the next block until the entire input is exhausted. Finally, the hash is encrypted with the key k.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does SHA-1 work?

A

As SHA-1 is an unkeyed hashing algorithm it requires more complexity (compared to keyed algorithms like HMAC) to obtain the desired level of diffusion.

SHA-1 is a block cipher algorithm which works on 512-bit large ciphers and returns a 160-bit (20 character long output).

Every 512-bit message block is partitioned into 16 blocks containing 32-bits. The procedure which allows for diffusion is carried out on every message block and is a set of operations carried out 80 times.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly