Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:72126 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 44558 invoked from network); 3 Feb 2014 21:26:22 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2014 21:26:22 -0000 Authentication-Results: pb1.pair.com smtp.mail=yohgaki@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=yohgaki@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.169 as permitted sender) X-PHP-List-Original-Sender: yohgaki@gmail.com X-Host-Fingerprint: 209.85.217.169 mail-lb0-f169.google.com Received: from [209.85.217.169] ([209.85.217.169:34803] helo=mail-lb0-f169.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 33/E4-35654-D7900F25 for ; Mon, 03 Feb 2014 16:26:21 -0500 Received: by mail-lb0-f169.google.com with SMTP id q8so5815713lbi.14 for ; Mon, 03 Feb 2014 13:26:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=VgXCboIqC7hnIPG5t1pAAsN4pChAhdWxCSN0PQF1u80=; b=f7faLEB/ueNsvPW7azaEEYvvJQ6TsRHkWmtGGLK9VCQdCuLK9GXwgpWkl4Jkbwkxu8 Thgpj7IxeVWD5b0A0YsOMcOsYa+epH72rILNsJv3xQnDDZpzkJXAbup2Dn3+Do3u1eGr qR18xzK55PngHavpOXeNKpwc1NTrKPvIcpDQOgnHcHNP5wosLyO+3vtDoZunqJvbSjgM TIEnVNq5uniczzA3Gfezx580WHqvNBDOWjm4SPOWdlFrJhn+GrjGzObBzqliEuyGc9B0 nQA7c9T0yXMigh3KgOeNAVDN9RNw11SscyGILAUWsTl+DnhOrxFa2itrFN1mNC2jd7Hv R8Ow== X-Received: by 10.112.148.104 with SMTP id tr8mr2952933lbb.42.1391462778197; Mon, 03 Feb 2014 13:26:18 -0800 (PST) MIME-Version: 1.0 Sender: yohgaki@gmail.com Received: by 10.112.199.37 with HTTP; Mon, 3 Feb 2014 13:25:38 -0800 (PST) In-Reply-To: References: Date: Tue, 4 Feb 2014 06:25:38 +0900 X-Google-Sender-Auth: 1PxhyxrAGPs3MJS4sEHkJUgbs2w Message-ID: To: Derick Rethans Cc: "internals@lists.php.net" Content-Type: multipart/alternative; boundary=047d7b3a83009cdc6604f1872c2d Subject: Re: [PHP-DEV] Extending uniqid() or not? From: yohgaki@ohgaki.net (Yasuo Ohgaki) --047d7b3a83009cdc6604f1872c2d Content-Type: text/plain; charset=UTF-8 Hi Derick, On Mon, Feb 3, 2014 at 7:08 PM, Derick Rethans wrote: > > uniqid() is producing unique ID for the system which is good for email's > > message ID etc. Many users are using uniqid() as secure unique ID which > is > > very bad thing to do for security. > > > > It may be extend to produce safe unique ID > > > > string uniqid(TRUE) - Returns random ID string which is safe to use > > security purposes. > > I have always been of the opinion that function's internal workings > should not be affected by an option like this. To be honest, I don't like it neither :) That's the reason why I did not write RFC for it. > > My concern is that uniqid() return both safe and unsafe ID which may > > not be good. We may better to have new function, perhaps > > > > string safe_uniqid([ing $length=64]) > > Yes, I agree - but we should not make the mistake of calling the > function "safe_" ... firstly because it reminds me of "safe_mode", but > more importantly is that *we* still can't guarantee it's safe. The > underlaying RNG sources are not under out control. I agree. The name is stupid ;) I would like to have 'default' secure ID generator which we do not have currently. This is my point. Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net --047d7b3a83009cdc6604f1872c2d--