Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Allen Wirfs-Brock
but we're now talking about a pure ECMAScript function so DOM conventions shouldn't be applicable. But consistency with common JavaScript practices should be. If you want to apply it to an already allocated array then making it method on Array.prototype would be a more internally consistent wa

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Glenn Maynard
On Mon, Feb 14, 2011 at 7:20 PM, Shabsi Walfish wrote: > Hmm... if there is a guarantee that /dev/urandom was successfully seeded at > some point in the past, then I'm happy with it. Is there such a guarantee? I > don't see that documented anywhere, and I'm not sure how it would be > provided. Si

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Bill Frantz
[wha...@lists.whatwg.org removed from cc list because I'm not on it and MarkM suggested dropping it.] On 2/14/11 at 4:20 PM, sha...@google.com (Shabsi Walfish) wrote: Hmm... if there is a guarantee that /dev/urandom was successfully seeded at some point in the past, then I'm happy with it. Is

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Brendan Eich
On Feb 14, 2011, at 4:47 PM, Brendan Eich wrote: > The IDL's use of an array inout parameter Er, in parameter, of course -- but with an in ArrayBufferView parameter (a reference to a mutable object), there's an "out" channel too, via effects on the viewed data in the buffer. Which is why I wrot

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Brendan Eich
On Feb 14, 2011, at 3:03 PM, Allen Wirfs-Brock wrote: > And why overwrite the elements of an existing array? Why not just creating a > new Array and use the argument to specify the desired length? Just to respond to this, I believe the reusable buffer is an optimization (premature? perhaps not

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
On Mon, Feb 14, 2011 at 4:15 PM, Glenn Maynard wrote: > On Mon, Feb 14, 2011 at 6:43 PM, Shabsi Walfish wrote: > >> OpenSSL is not exactly a reliable source of cryptographic best practices. >> :) In any case, see here http://linux.die.net/man/4/urandom : > > > No single implementation is; neithe

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Glenn Maynard
On Mon, Feb 14, 2011 at 6:43 PM, Shabsi Walfish wrote: > OpenSSL is not exactly a reliable source of cryptographic best practices. > :) In any case, see here http://linux.die.net/man/4/urandom : No single implementation is; neither are Linux manpages. The question is whether there are security

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Brendan Eich
On Feb 14, 2011, at 1:29 PM, Adam Barth wrote: > On Mon, Feb 14, 2011 at 12:49 PM, Brendan Eich wrote: > On Feb 14, 2011, at 12:26 PM, Adam Barth wrote: >> On Mon, Feb 14, 2011 at 11:56 AM, Brendan Eich wrote: >> On Feb 14, 2011, at 11:31 AM, Adam Barth wrote: >>> What's non-interoperable about

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
On Mon, Feb 14, 2011 at 3:49 PM, Bill Frantz wrote: > On 2/14/11 at 2:46 PM, sha...@google.com (Shabsi Walfish) wrote: > > This depends on what you consider to be the basic use case. Generating >> long-lived cryptographic keys absolutely requires high quality entropy... >> if >> you are only gen

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Bill Frantz
On 2/14/11 at 2:46 PM, sha...@google.com (Shabsi Walfish) wrote: This depends on what you consider to be the basic use case. Generating long-lived cryptographic keys absolutely requires high quality entropy... if you are only generating short-lived authenticators (that are not used for encryptio

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
OpenSSL is not exactly a reliable source of cryptographic best practices. :) In any case, see here http://linux.die.net/man/4/urandom : When read, the */dev/random* device will only return random bytes within the estimated number of bits of noise in the entropy pool. */dev/random* should be suitab

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Glenn Maynard
On Mon, Feb 14, 2011 at 5:46 PM, Shabsi Walfish wrote: > This depends on what you consider to be the basic use case. Generating > long-lived cryptographic keys absolutely requires high quality entropy... if > you are only generating short-lived authenticators (that are not used for > encryption)

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Allen Wirfs-Brock
If the intent is to get ECMAScript implementations to quickly provide this function then I would suggest that it be specified only in terms of things that are already in ES5. That would preclude use of anything from the Harmony binary data strawman. I don't particularly see why a "binary array

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread David Bruant
[adding Cameron McCormack, Web IDL editor, to the discussion] Le 14/02/2011 22:29, Adam Barth a écrit : > On Mon, Feb 14, 2011 at 12:49 PM, Brendan Eich wrote: >> On Feb 14, 2011, at 12:26 PM, Adam Barth wrote: >> >> On Mon, Feb 14, 2011 at 11:56 AM, Brendan Eich wrote: >> Extending the old windo

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
This depends on what you consider to be the basic use case. Generating long-lived cryptographic keys absolutely requires high quality entropy... if you are only generating short-lived authenticators (that are not used for encryption) then you could get away with weaker entropy. You will get the mos

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
It'd be nice if there was at least a way to explicitly detect if you were getting "weaker" entropy... In linux, for example, there is a /proc filesystem entry (/proc/sys/kernel/random/entropy_avail) that indicates how much entropy is available in the pool. Shabsi On Mon, Feb 14, 2011 at 2:30 PM,

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Glenn Maynard
On Mon, Feb 14, 2011 at 5:08 PM, Adam Barth wrote: > On Mon, Feb 14, 2011 at 12:49 PM, Brendan Eich > wrote: > > On Feb 14, 2011, at 12:26 PM, Adam Barth wrote: > > > Ok. I'll write up a spec later today. > > > > Thanks. > > Done: http://wiki.whatwg.org/wiki/Crypto > > Feedback appreciated. >

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Mark S. Miller
While we're waiting for Adam to subscribe to es-discuss and repost his messages on this thread, this one seems worth pre-posting. Changes needed for this to become an EcmaScript strawman: Replace references to ArrayBufferView with appropriate abstractions from < http://wiki.ecmascript.org/doku.ph

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Brendan Eich
On Feb 14, 2011, at 12:26 PM, Adam Barth wrote: > On Mon, Feb 14, 2011 at 11:56 AM, Brendan Eich wrote: > On Feb 14, 2011, at 11:31 AM, Adam Barth wrote: >> What's non-interoperable about filling an ArrayBuffer with random bytes? >> I'm not sure I understand your question. > The question is wha

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
On Mon, Feb 14, 2011 at 12:01 PM, Shabsi Walfish wrote: > > > On Mon, Feb 14, 2011 at 11:31 AM, Adam Barth wrote: > >> On Mon, Feb 14, 2011 at 8:31 AM, Mark S. Miller wrote: >> >>> On Mon, Feb 14, 2011 at 2:47 AM, Adam Barth wrote: >>> That's a pretty long time horizon. You're going to st

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Mark S. Miller
Everyone, Before posting on this thread, please subscribe at < https://mail.mozilla.org/listinfo/es-discuss> to es-discuss. The es-discuss list drops posts by non-subscribers, and thus seems to have dropped posts by Adam Barth and Shabsi Walfish that were sent after es-discuss was added to the thr

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
Re-posting for es-discuss On Mon, Feb 14, 2011 at 12:01 PM, Shabsi Walfish wrote: > > > On Mon, Feb 14, 2011 at 11:31 AM, Adam Barth wrote: > >> On Mon, Feb 14, 2011 at 8:31 AM, Mark S. Miller wrote: >> >>> On Mon, Feb 14, 2011 at 2:47 AM, Adam Barth wrote: >>> That's a pretty long time h

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Shabsi Walfish
Re-posting for es-discuss On Mon, Feb 14, 2011 at 8:30 AM, Shabsi Walfish wrote: > I think a good source of cryptographically secure entropy is _much_ higher > priority than any other crypto related APIs you might consider > standardizing... given a good source of entropy, everything else is alr

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Brendan Eich
On Feb 14, 2011, at 11:31 AM, Adam Barth wrote: > What's non-interoperable about filling an ArrayBuffer with random bytes? I'm > not sure I understand your question. The question is what OSes fail to provide enough random bits these days. This may just be a sanity-checking step (my sanity, at

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Brendan Eich
On Feb 14, 2011, at 8:40 AM, Boris Zbarsky wrote: > On 2/14/11 11:31 AM, Mark S. Miller wrote: >> On Mon, Feb 14, 2011 at 2:47 AM, Adam Barth > > wrote: >> >>That's a pretty long time horizon. You're going to start discussing >>it in 2-4 months? That seems a b

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Boris Zbarsky
On 2/14/11 11:31 AM, Mark S. Miller wrote: On Mon, Feb 14, 2011 at 2:47 AM, Adam Barth mailto:w...@adambarth.com>> wrote: That's a pretty long time horizon. You're going to start discussing it in 2-4 months? That seems a bit overwrought for what amounts to four lines of code. For

Re: [whatwg] Cryptographically strong random numbers

2011-02-14 Thread Mark S. Miller
On Mon, Feb 14, 2011 at 2:47 AM, Adam Barth wrote: > That's a pretty long time horizon. You're going to start discussing > it in 2-4 months? That seems a bit overwrought for what amounts to > four lines of code. > The committee meets once every two months. Between meetings, we discuss things o