<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom"><title>Simon Willison's Weblog: sha1</title><link href="http://simonwillison.net/" rel="alternate"/><link href="http://simonwillison.net/tags/sha1.atom" rel="self"/><id>http://simonwillison.net/</id><updated>2010-01-24T13:30:58+00:00</updated><author><name>Simon Willison</name></author><entry><title>Don't Hash Secrets</title><link href="https://simonwillison.net/2010/Jan/24/benlog/#atom-tag" rel="alternate"/><published>2010-01-24T13:30:58+00:00</published><updated>2010-01-24T13:30:58+00:00</updated><id>https://simonwillison.net/2010/Jan/24/benlog/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://benlog.com/articles/2008/06/19/dont-hash-secrets/"&gt;Don&amp;#x27;t Hash Secrets&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
A well written explanation from 2008 of why you must use hmac instead of raw SHA-1 when hashing against a secret.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/cryptography"&gt;cryptography&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hmac"&gt;hmac&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sha1"&gt;sha1&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/signing"&gt;signing&lt;/a&gt;&lt;/p&gt;



</summary><category term="cryptography"/><category term="hmac"/><category term="security"/><category term="sha1"/><category term="signing"/></entry><entry><title>Design and code review requested for Django string signing / signed cookies</title><link href="https://simonwillison.net/2010/Jan/4/codereview/#atom-tag" rel="alternate"/><published>2010-01-04T13:24:50+00:00</published><updated>2010-01-04T13:24:50+00:00</updated><id>https://simonwillison.net/2010/Jan/4/codereview/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://groups.google.com/group/django-developers/browse_thread/thread/297e8b22006f7f3a"&gt;Design and code review requested for Django string signing / signed cookies&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Do you know your way around web app security and cryptography (in particular signing things using hmac and sha1)? We’d appreciate your help reviewing the usage of these concepts in Django’s proposed string signing and signed cookie implementations.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/code-review"&gt;code-review&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cryptography"&gt;cryptography&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hashing"&gt;hashing&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hmac"&gt;hmac&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sha1"&gt;sha1&lt;/a&gt;&lt;/p&gt;



</summary><category term="code-review"/><category term="cryptography"/><category term="django"/><category term="hashing"/><category term="hmac"/><category term="python"/><category term="security"/><category term="sha1"/></entry><entry><title>Django snippets: Sign a string using SHA1, then shrink it using url-safe base65</title><link href="https://simonwillison.net/2008/Aug/27/snippets/#atom-tag" rel="alternate"/><published>2008-08-27T22:18:49+00:00</published><updated>2008-08-27T22:18:49+00:00</updated><id>https://simonwillison.net/2008/Aug/27/snippets/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://www.djangosnippets.org/snippets/1004/"&gt;Django snippets: Sign a string using SHA1, then shrink it using url-safe base65&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
I needed a way to create tamper-proof URLs and cookies by signing them, but didn’t want the overhead of a full 40 character SHA1 hash. After some experimentation, it turns out you can knock a 40 char hash down to 27 characters by encoding it using a custom base65 encoding which only uses URL-safe characters.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/base65"&gt;base65&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cookies"&gt;cookies&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/cryptography"&gt;cryptography&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django"&gt;django&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/django-snippets"&gt;django-snippets&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hashes"&gt;hashes&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/python"&gt;python&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/security"&gt;security&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sha1"&gt;sha1&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/signedcookies"&gt;signedcookies&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/urls"&gt;urls&lt;/a&gt;&lt;/p&gt;



</summary><category term="base65"/><category term="cookies"/><category term="cryptography"/><category term="django"/><category term="django-snippets"/><category term="hashes"/><category term="python"/><category term="security"/><category term="sha1"/><category term="signedcookies"/><category term="urls"/></entry><entry><title>hash</title><link href="https://simonwillison.net/2008/Mar/30/hash/#atom-tag" rel="alternate"/><published>2008-03-30T18:34:22+00:00</published><updated>2008-03-30T18:34:22+00:00</updated><id>https://simonwillison.net/2008/Mar/30/hash/#atom-tag</id><summary type="html">
    
&lt;p&gt;&lt;strong&gt;&lt;a href="http://blog.360.yahoo.com/blog-TBPekxc1dLNy5DOloPfzVvFIVOWMB0li?p=789"&gt;hash&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;
Douglas Crockford: “Any HTML tag that accepts a src= or href= attribute should also be allowed to take a hash= attribute”—to protect against file tampering and (more importantly) provide a truly robust caching mechanism.


    &lt;p&gt;Tags: &lt;a href="https://simonwillison.net/tags/caching"&gt;caching&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/douglas-crockford"&gt;douglas-crockford&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/hash"&gt;hash&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/html"&gt;html&lt;/a&gt;, &lt;a href="https://simonwillison.net/tags/sha1"&gt;sha1&lt;/a&gt;&lt;/p&gt;



</summary><category term="caching"/><category term="douglas-crockford"/><category term="hash"/><category term="html"/><category term="sha1"/></entry></feed>