Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!nntp-feed.chiark.greenend.org.uk!ewrotcd!news.nosignal.org!newsgate.cistron.nl!newsgate.news.xs4all.nl!194.109.133.86.MISMATCH!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.042 X-Spam-Evidence: '*H*': 0.92; '*S*': 0.00; 'that?': 0.05; 'length.': 0.09; 'def': 0.10; 'digits.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'hashes': 0.16; 'mathematics.': 0.16; 'md5': 0.16; 'wed,': 0.16; 'wrote:': 0.17; 'jan': 0.18; 'equivalent': 0.20; 'produces': 0.22; 'this:': 0.23; "haven't": 0.23; 'header:In-Reply-To:1': 0.25; 'rules': 0.27; 'message- id:@mail.gmail.com': 0.27; 'decimal': 0.29; 'hash': 0.29; 'function': 0.30; 'could': 0.32; 'to:addr:python-list': 0.33; 'received:google.com': 0.34; 'pm,': 0.35; 'received:209.85.220': 0.35; 'received:209.85': 0.35; 'but': 0.36; 'ones': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'several': 0.39; 'to:addr:python.org': 0.39; 'think': 0.40; 'chance': 0.61; 'subject: & ': 0.67; 'secure': 0.67; '2013': 0.84; 'digits?': 0.84; 'insecure': 0.84; 'often,': 0.84; 'understood.': 0.84; 'angel': 0.93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:content-type; bh=6xUHlzr+J0iqxSwBy81uzDpEFx0OwrEE1Acfg6kzs0c=; b=TRR6/sjrTo5c2BBZg/DqN4a6NRFAACQ4QPhvJnBWSN8vr/oMRbc+Qlxu+fygaaeBel hFHZsG8o/DMYxCRSHhRemXFRRzKmW+nefkphKUQi94KxEFErc3izQHQVlJKWxSPduM2N ckn50aLRNEpxJZ0ldz5gdn5+4oktdw5TeKTvFbsLoX+0qv0vWvxfsdK+kxtk2HSAjxi5 28XTsk5Vdn7/hsvzRpSDU8jXQoQ7+E1C31j2iP1I37Wvz7s4gcVLtnPqf2OwLgwPk8mR a2F0qRBeKpgVj9hROuQ48ZXZPls8P79dT2VFdTjgkg66zlJwoGY9f6fH/T0O5Kx+ExH0 jT/A== MIME-Version: 1.0 X-Received: by 10.52.29.109 with SMTP id j13mr3035152vdh.111.1358983558646; Wed, 23 Jan 2013 15:25:58 -0800 (PST) In-Reply-To: <50FFD9B8.3090304@davea.name> References: <8deb6f5d-ff10-4b36-bdd6-36f9eed58e1e@googlegroups.com> <5dd4babd-716d-4542-ad36-e6a841b73ec3@googlegroups.com> <03581a24-9330-4019-bde9-61a607000d3d@googlegroups.com> <187d77e0-e948-46bf-acc5-668c446cf3aa@googlegroups.com> <239abe33-fa5b-41a9-ae80-5260b9b1bd9c@googlegroups.com> <2391171e-e170-4647-8924-8e446ea1c6b1@googlegroups.com> <9d9b287c-ca2a-49c1-a16b-e42cb2a5db38@q16g2000pbt.googlegroups.com> <6f3e7d20-3005-4d1e-b949-d90a78e7bbf6@googlegroups.com> <50FFD9B8.3090304@davea.name> Date: Thu, 24 Jan 2013 10:25:58 +1100 Subject: Re: Uniquely identifying each & every html template From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1358983561 news.xs4all.nl 6877 [2001:888:2000:d::a6]:43967 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:37518 On Wed, Jan 23, 2013 at 11:38 PM, Dave Angel wrote: > You think it's an accident that md5 size is roughly equivalent to 39 decimal > digits? Or that the ones that haven't been proven insecure are much larger > than that? The sha512 hash is roughly equivalent to 154 decimal digits. Proving a hash function secure or not is orthogonal to its length. You could have a cryptographically secure hash function that produces a single byte; you'd get collisions pretty often, but that's understood. Conversely, you could have an insecure hash that produces a value several orders of magnitude longer than SHA512. Look at this: def big_long_hash(val): return sum(bytes(str(val),"utf-8"))*12345678901234567890 But longer hashes do reduce the chance of collisions, by the fundamental rules of mathematics. ChrisA