title: Is it possible to reverse a SHA-1?
body: <p>Is it possible to reverse a SHA-1?</p>
  <p>I'm thinking about using a SHA-1 to create a simple lightweight system to authenticate a small embedded system that communicates over an unencrypted connection.</p>
  <p>Let's say that I create a sha1 like this with input from a &quot;secret key&quot; and spice it with a timestamp so that the SHA-1 will change all the time.</p>
  <pre><code>sha1(&quot;My Secret Key&quot;+&quot;a timestamp&quot;)
  </code></pre>
  <p>Then I include this SHA-1 in the communication and the server, which can do the same calculation. And hopefully, nobody would be able to figure out the &quot;secret key&quot;.</p>
  <p>But is this really true?</p>
  <p>If you know that this is how I did it, you would know that I did put a timestamp in there and you would see the SHA-1.
  Can you then use those two and figure out the &quot;secret key&quot;?</p>
  <pre><code>secret_key = bruteforce_sha1(sha1, timestamp)
  </code></pre>
  <hr />
  <p><em>Note1</em>:
  I guess you could brute force in some way, but how much work would that actually be?</p>
  <p><em>Note2</em>:
  I don't plan to encrypt any data, I just would like to know who sent it.</p>