Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!feeder.news-service.com!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed5.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.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; ':-(': 0.09; 'filename': 0.09; 'length.': 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; 'output': 0.11; 'wrote:': 0.14; 'fname': 0.16; 'simplest': 0.16; 'slashes': 0.16; 'subject:security': 0.16; 'must.': 0.19; 'guess': 0.19; 'writes:': 0.19; 'header:In-Reply-To:1': 0.21; 'stuff': 0.22; 'skip:b 20': 0.23; 'junk': 0.26; 'paul': 0.28; 'random': 0.28; 'subject:How': 0.30; 'adds': 0.32; 'header:X-Complaints-To:1': 0.32; 'to:addr :python-list': 0.33; 'that,': 0.34; 'header:User-Agent:1': 0.35; 'using': 0.35; 'received:org': 0.38; 'problem.': 0.38; 'subject:: ': 0.38; 'should': 0.39; 'unless': 0.39; 'it!': 0.39; 'header :Mime-Version:1': 0.39; 'to:addr:python.org': 0.39; 'more': 0.60; 'robin': 0.84; 'subject:good': 0.93 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Robin Becker Subject: Re: How good is security via hashing Date: Wed, 08 Jun 2011 10:13:25 +0100 References: <4DEDFAEB.4050006@chamonix.reportlab.co.uk> <7xfwnl1ihk.fsf@ruckus.brouhaha.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: fpc2-nmal8-0-0-cust4.croy.static.cable.virginmedia.com User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: <7xfwnl1ihk.fsf@ruckus.brouhaha.com> 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: 15 NNTP-Posting-Host: 82.94.164.166 X-Trace: 1307524422 news.xs4all.nl 49039 [::ffff:82.94.164.166]:43121 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:7225 On 07/06/2011 21:42, Paul Rubin wrote: > geremy condra writes: >> # adds random junk to the filename- should make it hard to guess >> rrr = os.urandom(16) >> fname += base64.b64encode(rrr) > > Don't use b64 output in a filename -- it can have slashes in it! :-( > > Simplest is to use old fashioned hexadeimal for stuff like that, unless > the number of chars is a significant problem. Go for a more complicated > encoding if you must. we have been using base62 ie 0-9A-Za-z just to reduce the name length. -- Robin Becker