Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between a keyed hash and a non-keyed hash?

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?

like image 676
maxp Avatar asked Feb 08 '10 00:02

maxp


1 Answers

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.
like image 157
caf Avatar answered Oct 08 '22 19:10

caf