From owner-freebsd-current Sat Jun 10 0:13:27 2000 Delivered-To: freebsd-current@freebsd.org Received: from grimreaper.grondar.za (grimreaper.grondar.za [196.7.18.138]) by hub.freebsd.org (Postfix) with ESMTP id E957037B66E; Sat, 10 Jun 2000 00:13:18 -0700 (PDT) (envelope-from mark@grondar.za) Received: from grimreaper.grondar.za (localhost [127.0.0.1]) by grimreaper.grondar.za (8.9.3/8.9.3) with ESMTP id JAA04771; Sat, 10 Jun 2000 09:13:30 +0200 (SAST) (envelope-from mark@grimreaper.grondar.za) Message-Id: <200006100713.JAA04771@grimreaper.grondar.za> To: "Andrey A. Chernov" Cc: Mark Murray , "Jeroen C. van Gelderen" , Kris Kennaway , current@FreeBSD.ORG Subject: Re: mktemp() patch References: <20000609155342.B33329@freebsd.org> In-Reply-To: <20000609155342.B33329@freebsd.org> ; from "Andrey A. Chernov" "Fri, 09 Jun 2000 15:53:42 MST." Date: Sat, 10 Jun 2000 09:13:30 +0200 From: Mark Murray Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > > Why not just XOR the whole lot into the current ${randomnumber}? > > That way, at least the effort of the whole calculation is not wasted > > as much. > > Why to XOR true random bits from arc4random() with non-random bits from > getpid()? It only weakens. Better way is just remove any getpid() code and > left arc4random() only. Rubbish. A XOR B is random if at least one of A or B is random. That is a pretty fundamental theorem of Cryptography. My suggestion _strengthens_ the random number. All you lose is one bit if it turns out that BOTH A and B are random, because they get combined into one. M -- Mark Murray Join the anti-SPAM movement: http://www.cauce.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message