284 tamper with the counter; and obviously we also cannot encrypt |
284 tamper with the counter; and obviously we also cannot encrypt |
285 the key, lest we can solve an impossible chicken-and-egg |
285 the key, lest we can solve an impossible chicken-and-egg |
286 problem). So encryption seems to not solve the problem we face |
286 problem). So encryption seems to not solve the problem we face |
287 with the integrity of our counter. |
287 with the integrity of our counter. |
288 |
288 |
289 Fortunately, \emph{hash functions} seem to be more suitable |
289 Fortunately, \emph{cryptographic hash functions} seem to be |
290 for our purpose. Like encryption, hash functions scramble data |
290 more suitable for our purpose. Like encryption, hash functions |
291 in such a way that it is easy to calculate the output of a |
291 scramble data in such a way that it is easy to calculate the |
292 hash function from the input. But it is hard (i.e.~practically |
292 output of a hash function from the input. But it is hard |
293 impossible) to calculate the input from knowing the output. |
293 (i.e.~practically impossible) to calculate the input from |
294 Therefore hash functions are often called \emph{one-way |
294 knowing the output. This is often called \emph{preimage |
295 functions}\ldots you cannot go back from the output to the |
295 resistance}. Cryptographic hash functions also ensure that |
296 input (without some tricks, see below). There are several such |
296 given a message and a hash, it is computationally infeasible to |
|
297 find another message with the same hash. This is called |
|
298 \emph{collusion resistance}. Because of these properties hash |
|
299 functions are often called \emph{one-way functions}\ldots you |
|
300 cannot go back from the output to the input (without some |
|
301 tricks, see below). |
|
302 |
|
303 |
|
304 |
|
305 |
|
306 |
|
307 There are several such |
297 hashing function. For example SHA-1 would hash the string |
308 hashing function. For example SHA-1 would hash the string |
298 \pcode{"hello world"} to produce the hash-value |
309 \pcode{"hello world"} to produce the hash-value |
299 |
310 |
300 \begin{center} |
311 \begin{center} |
301 \pcode{2aae6c35c94fcfb415dbe95f408b9ce91ee846ed} |
312 \pcode{2aae6c35c94fcfb415dbe95f408b9ce91ee846ed} |