Why is SHA-1 no longer secure?
SHA-1 is a key derivation function, ie, it takes a random input (eg, a salt) and produces a short bit string which is meant to be a hash of the input. The most common reason for us to use a key derivation function is to make sure that the hash algorithm we choose will never be cracked by an attacker. That's way more than the age of the universe, and way longer than any feasible timeline an attacker can reasonably hope to mount a distributed denial of service attack. But there's more to SHA-1 than just being an encryption scheme. The SHA-1 hash algorithm is also a key derivation function, which means that you can use the resulting hash as a one-time password that you must input to unlock your phone. The security of this approach depends on a number of assumptions about your attacker:
The attacker can't mount a successful brute force attack against your key derivation function. The attacker can't store the stolen passwords for future access. The attacker doesn't have other means to obtain the password. The attacker can't mount an offline dictionary attack. The attacker can't get ahold of the stored credentials of other users. The attacker can't modify the client software so it stores passwords. The attacker can't modify the system so it stores passwords. The attacker can't obtain a copy of the stolen credentials of other users. For every attack scenario, there is some level of security by obscurity which will defend against that attack scenario.
What is the safe hashing algorithm?
Safe hashing refers to an algorithm which will never produce a collision for a hash table.
That is to say, no string can hash to the same number as another string in the hash table, and vice-versa.
The main use of safe hashing is to avoid wasting buckets. That is, to avoid creating an extra pair of buckets, because you already know that there will never be a collision. For example, if you have a hash table where every bucket takes one byte to represent its key, then you could make the assumption that for a hash table of size 128, at least 1 byte is wasted per bucket, because at least 128 buckets are never needed. With safe hashing, you avoid this problem because it is mathematically proven that you will never create collisions.
So how does a safe hashing algorithm work? And how does it do it? There are two basic strategies for implementing safe hashing: the linear search strategy and the quadratic search strategy. In this post, we will explore both of them. First, let's look at the linear search algorithm.
Hash Function. A hash function takes some input and outputs a numeric value. The input may be a string, or it may be something else, like a page number. It may also output a list of values rather than just one, but I'm not going to talk about that here.
In this tutorial, we'll just focus on getting a single value, usually a string or a number. For example, the hash function for a simple hash table of size N, would take a string of length N and output a single value between 0 and N - 1. If the input string is longer than N, it will hash more bits and will output more values (and the value of the final hash will depend on the order in which the input is broken up into chunks).
Related Answers
What is client Hello Wireshark?
Client Hello Wireshark is the first step in the TLS handshake. Client Hello...
Can hide.me VPN unblock Netflix?
You can use a version of this approach for hiding your IP address while us...
How do I view certificate details in Wireshark?
This is a frequently asked question and TLS certificates are not...