Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!tudelft.nl!txtfeed1.tudelft.nl!multikabel.net!newsfeed20.multikabel.net!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; '*not*': 0.05; 'modified': 0.05; 'terry': 0.07; 'wrapper': 0.07; '(sorry,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'am,': 0.14; 'wrote:': 0.14; '3.3.': 0.16; '7:35': 0.16; 'ctypes.': 0.16; 'predictable': 0.16; 'subject:security': 0.16; 'guess': 0.19; 'header:In-Reply-To:1': 0.21; 'so.': 0.22; 'url:wiki': 0.23; 'library.': 0.25; 'modules': 0.26; "i'm": 0.27; 'random': 0.28; "python's": 0.29; 'subject:How': 0.30; 'one)': 0.30; "skip:' 10": 0.32; 'header:X-Complaints-To:1': 0.32; 'to:addr:python-list': 0.33; 'asking': 0.33; 'header:User-Agent:1': 0.35; 'using': 0.35; 'too.': 0.37; 'sequence': 0.37; 'url:en': 0.37; 'received:org': 0.38; 'url:org': 0.38; 'strong': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'header:Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'generate': 0.60; 'forget': 0.61; 'url:secure': 0.73; 'generator,': 0.84; 'robin': 0.84; 'schrieb': 0.84; 'url:wikimedia': 0.84; 'subject:good': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Christian Heimes Subject: Re: How good is security via hashing Date: Wed, 08 Jun 2011 00:08:03 +0200 References: <4DEDFAEB.4050006@chamonix.reportlab.co.uk> <4DEE0CF9.6020508@chamonix.reportlab.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: f048037143.adsl.alicedsl.de User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110424 Lightning/1.0b2.102ipre2 Thunderbird/3.1.10 In-Reply-To: X-Enigmail-Version: 1.1.2 OpenPGP: id=AD16AB1B; url=http://cheimes.de/heimes.asc X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 16 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307484500 news.xs4all.nl 49181 [::ffff:82.94.164.166]:51490 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7199 Am 07.06.2011 20:26, schrieb Terry Reedy: > On 6/7/2011 7:35 AM, Robin Becker wrote: > >> I guess what I'm asking is whether any sequence that's using random to >> generate random numbers is predictable if enough samples are drawn. > > Apparently so. random.random is *not* 'cryptographically secure'. > https://secure.wikimedia.org/wikipedia/en/wiki/Cryptographically_secure_pseudorandom_number_generator > > One of Python's crypto wrapper modules (sorry, forget which one) was > recently modified to expose the crypto rng functions in the wrapped C > library. It should be mentioned in What New for 3.3. You might be able > to get at the same functions with ctypes. PyCrypto has a strong pseudorandom number generator, too.