views:

113

answers:

1

I've read a few articles about cryptography in .net, which leads me to the following question, what is the difference between a keyed hash and a non-keyed hash?

+1  A: 

A non-keyed hash produces an output that depends only on the input data. If it is cryptographically secure, then there are no ways known that are faster than bruteforce to find:

  • An input that hashes to a particular output;
  • Two inputs that hash to the same output.

A keyed hash produces an output that depends both on the input data, and a key. If it is cryptographically secure, then it satisfies the above properties of a non-keyed hash, and in addition:

  • There are no known ways faster than bruteforce to find the key used, given a set of input and output pairs produced with that key;
  • There are no known ways better than random chance to find the correct output for any input under a particular key, without knowledge of the key.
caf