Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Marko Rauhamaa Newsgroups: comp.lang.python Subject: Re: Make a unique filesystem path, without creating the file Date: Mon, 22 Feb 2016 23:22:24 +0200 Organization: A noiseless patient Spider Lines: 33 Message-ID: <87lh6cmodr.fsf@elektro.pacujo.net> References: <85r3gf55k4.fsf@benfinney.id.au> <85mvr26dij.fsf@benfinney.id.au> <87vb5gmtgj.fsf@elektro.pacujo.net> <87povomq95.fsf@elektro.pacujo.net> <874md04fsl.fsf@jester.gateway.pace.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="b7cb1518d23ec19d482dcc9c31d30fdd"; logging-data="4893"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19hi97/8hIsQBo7K2ZW0Ivo" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) Cancel-Lock: sha1:pqNduZShlY9NdCH2mU2bUEVeVAc= sha1:sKdAexdd0maKdPmJ2kjKg9VHKhE= Xref: csiph.com comp.lang.python:103364 Paul Rubin : >>> http://www.2uo.de/myths-about-urandom/ >> Did you post the link because you agreed with the Web pamphlet? > > I don't know what web pamphlet you mean, The only one linked above. Cryptography is tricky business, indeed. I know enough about it not to improvise too much. Infinitesimal weaknesses can make a difference between feasible and unfeasible attacks. > but the right thing to use now is getrandom(2). getrandom(2) is a good interface that distinguishes between the flag values 0 => /dev/urandom GRND_RANDOM => /dev/random GRND_RANDOM | GRND_NONBLOCK => /dev/random (O_NONBLOCK) However, although os.urandom() delegates to getrandom(), the documentation suggests it uses the flag value 0 (/dev/urandom). > The random/urandom interface was poorly designed and misleadingly > documented. It could be better I suppose, but I never found it particularly bad. The nice thing about it is that it is readily usable in shell scripts. Marko