Questions tagged [hash]

A cryptographic hash algorithm is a function which takes a variable size input and produces a fixed size output. The algorithm makes it difficult to find two inputs with the same output or reconstruct the input from the output.

A cryptographic hash algorithm, also called a cryptographic hash function, is a function which takes a variable size input and produces a fixed size output.

As of 2012, the biggest news in cryptographic hash algorithms is the ongoing NIST hash function competition for .

People who design hash algorithms attempt to make it difficult to predict the output for a given input, find two inputs with the same output (a ), or reconstruct the input from the output.

Alas, some popular hash algorithms are not as good at this as their designer had hoped.

Many diverse sub-fields in cryptography use cryptographic hash algorithms:

A particular output value generated by such an algorithm is given various names in various contexts: the cryptographic hash, the hash value, the message digest, the digital fingerprint, etc.

  • and its predecessor use for message authentication, which in turn uses the (fast) cryptographic hash .
  • validation usually uses a deliberately-slow cryptographic hash for password hashing (sometimes misleadingly called "password encryption"), such as , , or .
  • Most high-quality hardware random number generators use a cryptographic hash to "whiten" the raw data sample measurements
  • etc.

Wikipedia: cryptographic hash function

3103 questions
251
votes
2 answers

What are the differences between a digital signature, a MAC and a hash?

A message may be accompanied with a digital signature, a MAC or a message hash, as a proof of some kind. Which assurances does each primitive provide to the recipient? What kind of keys are needed?
Flimm
  • 2,818
  • 4
  • 16
  • 17
179
votes
7 answers

Why can't we reverse hashes?

First off, I know hashes are 1 way. There are an infinite number of inputs that can result in the same hash output. Why can't we take a hash and convert it to an equivalent string that can be hashed back to the original hash output? eg: string:…
Hello World
  • 1,907
  • 2
  • 11
  • 3
150
votes
5 answers

What is a cryptographic "salt"?

I'm a beginner to cryptography and looking to understand in very simple terms what a cryptographic "salt" is, when I might need to use it, and why I should or should not use it. Can I get a very simple and clear (beginner level) explanation? If you…
Bhavik Ambani
  • 1,631
  • 2
  • 15
  • 12
133
votes
7 answers

Are there two known strings which have the same MD5 hash value?

Is there an example of two known strings which have the same MD5 hash value (representing a so-called "MD5 collision")?
Adban
104
votes
2 answers

What is the new attack on SHA-1 "SHAttered" and how does it work?

There's a new recent Attack on SHA-1 named "SHAttered" by Google and some researchers. I understand that it uses some fancy new techniques, but not the details. My question is: How? How does the attack work (on a high level)? How does it compare to…
SEJPM
  • 46,697
  • 9
  • 103
  • 214
101
votes
3 answers

What is the difference between a digest and a hash function?

I was wondering about the difference between these two terms... What is the difference between a digest and a hash function?
Francesco Mari
  • 1,121
  • 2
  • 7
  • 7
96
votes
4 answers

Has SHA256 been broken by Treadwell Stanton DuPont?

In a recent press release issued by Treadwell Stanton DuPont, the claim is made that their research laboratories have successfully broken all 64 rounds of the SHA256 hashing algorithm. They further claim that they achieved this milestone a year ago…
Gary
  • 873
  • 1
  • 6
  • 12
89
votes
8 answers

Guarding against cryptanalytic breakthroughs: combining multiple hash functions

Assume I want to design a protocol (or data format or similar) including some cryptographic hash, and want it to be as future-proof as possible, i.e. I want to avoid that breakthroughs in cryptography make my old data insecure. If I use only one…
Paŭlo Ebermann
  • 22,946
  • 7
  • 82
  • 119
78
votes
6 answers

SHA-512 faster than SHA-256?

I'm getting this strange result that SHA-512 is around 50% faster than SHA-256. I'm using .net's SHA512Managed and SHA256Managed classes. The code is similar to the one posted here but I'm referring to tests taking caching into account (from the…
ispiro
  • 2,085
  • 2
  • 18
  • 29
69
votes
2 answers

Is truncating a SHA512 hash to the first 160 bits as secure as using SHA1?

I am from a web development background (I don't know an awful lot about cryptography or how the algorithms themselves work), so I am asking this question in simple terms. Consider a hash of the word 'test' using…
BadHorsie
  • 823
  • 1
  • 9
  • 11
63
votes
2 answers

Why is $H(k\mathbin\Vert x)$ not a secure MAC construction?

If $H(m)$ is a secure hash function, can't we implement a MAC using $H(k\mathbin\Vert m)$? However, it seems the more widely used MACs, such as NMAC and HMAC (both originally defined in Keying hash functions for message authentication) use a much…
Anne Nonimus
  • 733
  • 1
  • 5
  • 4
62
votes
4 answers

Why hash the message before signing it with RSA?

The diagram below illustrates the process of digitally signing a message with RSA: As diagram shows, the message is first hashed, and the signature is then computed on the hash, rather than on the full message. Why hash the data before signing it?…
evening
  • 1,383
  • 3
  • 15
  • 22
61
votes
3 answers

Hashing or encrypting twice to increase security?

Over on the bitcoin forums I asked why the bitcoin client computes SHA-256(SHA-256(x)) as its cryptographic hash for a variety of purposes. The leading theory--since the bitcoin author has disappeared--seems to be that from a security standpoint it…
maaku
  • 711
  • 1
  • 5
  • 4
61
votes
2 answers

Understanding the length extension attack

I have been trying to understand exactly how a length extension attack works on SHA-1. I'll detail below what I've understood so far so that I can convey my understanding of the same and hopefully get advice on where I'm going wrong. Let's assume…
user114
61
votes
2 answers

What makes a hash function good for password hashing?

Using a cryptographic hash to store e.g. passwords in a database is considered good practice (as opposed to storing them plaintext), but is subject to attacks on said cryptographic hash, assuming the database is compromised. Which properties of a…
You
  • 713
  • 1
  • 5
  • 9
1
2 3
99 100