Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

A physicist is an atom's way of knowing about atoms. -- George Wald


devel / comp.lang.javascript / Re: How bad is Javascripts randomisation function?

SubjectAuthor
* Re: How bad is Javascripts randomisation function?John Stockton
`* Re: How bad is Javascripts randomisation function?Michael Haufe (TNO)
 `* Re: How bad is Javascripts randomisation function?John Stockton
  `- Re: How bad is Javascripts randomisation function?Jon Ribbens

1
Re: How bad is Javascripts randomisation function?

<9a5a922c-df27-4e3d-81a6-45d2eae4c958n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16977&group=comp.lang.javascript#16977

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:a37:418d:: with SMTP id o135mr23123509qka.418.1621785429121;
Sun, 23 May 2021 08:57:09 -0700 (PDT)
X-Received: by 2002:a9d:22a3:: with SMTP id y32mr7027562ota.274.1621785428806;
Sun, 23 May 2021 08:57:08 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sun, 23 May 2021 08:57:08 -0700 (PDT)
In-Reply-To: <if0bv9FbvtuU4@mid.individual.net>
Injection-Info: google-groups.googlegroups.com; posting-host=94.30.84.71; posting-account=jWrkcgoAAADHtaq4DIr9RtcEBEH6q0En
NNTP-Posting-Host: 94.30.84.71
References: <4166bb6e-0388-4ab1-ba1f-919ed718c43bn@googlegroups.com> <if0bv9FbvtuU4@mid.individual.net>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <9a5a922c-df27-4e3d-81a6-45d2eae4c958n@googlegroups.com>
Subject: Re: How bad is Javascripts randomisation function?
From: dr.j.r.stockton@gmail.com (John Stockton)
Injection-Date: Sun, 23 May 2021 15:57:09 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: John Stockton - Sun, 23 May 2021 15:57 UTC

On Thursday, 29 April 2021 at 19:24:49 UTC+1, Arno Welzel wrote:
> Jonas Thörnvall:
>
> [snip]
>
> Why not just this:
>
> <https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math/random>

Quite a lot bad, as I recall.

See
http://web.archive.org/web/20150510110440/http://www.merlyn.demon.co.uk/js-randm.htm
which links to
http://web.archive.org/web/20180611034551/https://github.com/nquinlan/better-random-numbers-for-javascript-mirror .
See also http://www.jibbering.com/faq/index.html#randomNumber
and see what https://en.wikipedia.org/wiki/Random_number says and cites.

According to
http://web.archive.org/web/20130127232731/http://www.merlyn.demon.co.uk/quotings.htm -
https://en.wikipedia.org/wiki/Donald_Knuth wrote/said
"Random numbers should not be generated with a method chosen at random".

--
(c) John Stockton, near London, UK. Using Google Groups. |
Mail: J.R.""""""""@physics.org - or as Reply-To, if any. |

Re: How bad is Javascripts randomisation function?

<1d7b7897-f8ed-4bb5-9263-58789eef717en@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=16985&group=comp.lang.javascript#16985

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ac8:4812:: with SMTP id g18mr28049675qtq.16.1621876937511;
Mon, 24 May 2021 10:22:17 -0700 (PDT)
X-Received: by 2002:a9d:6e09:: with SMTP id e9mr19215025otr.126.1621876937215;
Mon, 24 May 2021 10:22:17 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Mon, 24 May 2021 10:22:16 -0700 (PDT)
In-Reply-To: <9a5a922c-df27-4e3d-81a6-45d2eae4c958n@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:63e1:1820:986b:a383:c2e9:5f0d;
posting-account=hYRygAoAAABkmvJVmPilz9Q1TOjgPQAq
NNTP-Posting-Host: 2600:1700:63e1:1820:986b:a383:c2e9:5f0d
References: <4166bb6e-0388-4ab1-ba1f-919ed718c43bn@googlegroups.com>
<if0bv9FbvtuU4@mid.individual.net> <9a5a922c-df27-4e3d-81a6-45d2eae4c958n@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <1d7b7897-f8ed-4bb5-9263-58789eef717en@googlegroups.com>
Subject: Re: How bad is Javascripts randomisation function?
From: tno@thenewobjective.com (Michael Haufe (TNO))
Injection-Date: Mon, 24 May 2021 17:22:17 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Michael Haufe (TNO) - Mon, 24 May 2021 17:22 UTC

On Sunday, May 23, 2021 at 10:57:14 AM UTC-5, John Stockton wrote:
> On Thursday, 29 April 2021 at 19:24:49 UTC+1, Arno Welzel wrote:
> > Jonas Thörnvall:
> >
> > [snip]
> >
> > Why not just this:
> >
> > <https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math/random>
> Quite a lot bad, as I recall.
>
> See
> http://web.archive.org/web/20150510110440/http://www.merlyn.demon.co.uk/js-randm.htm
> which links to
> http://web.archive.org/web/20180611034551/https://github.com/nquinlan/better-random-numbers-for-javascript-mirror .
> See also http://www.jibbering.com/faq/index.html#randomNumber
> and see what https://en.wikipedia.org/wiki/Random_number says and cites.
>
> According to
> http://web.archive.org/web/20130127232731/http://www.merlyn.demon.co.uk/quotings.htm -
> https://en.wikipedia.org/wiki/Donald_Knuth wrote/said
> "Random numbers should not be generated with a method chosen at random".

If you want better random numbers use the following:

<https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues>

Re: How bad is Javascripts randomisation function?

<d970269c-d96f-47d5-a634-02df85b550a1n@googlegroups.com>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17039&group=comp.lang.javascript#17039

  copy link   Newsgroups: comp.lang.javascript
X-Received: by 2002:ac8:5fd5:: with SMTP id k21mr7224391qta.231.1622288263820;
Sat, 29 May 2021 04:37:43 -0700 (PDT)
X-Received: by 2002:a9d:12a5:: with SMTP id g34mr10400416otg.204.1622288263574;
Sat, 29 May 2021 04:37:43 -0700 (PDT)
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.lang.javascript
Date: Sat, 29 May 2021 04:37:43 -0700 (PDT)
In-Reply-To: <1d7b7897-f8ed-4bb5-9263-58789eef717en@googlegroups.com>
Injection-Info: google-groups.googlegroups.com; posting-host=94.30.84.71; posting-account=jWrkcgoAAADHtaq4DIr9RtcEBEH6q0En
NNTP-Posting-Host: 94.30.84.71
References: <4166bb6e-0388-4ab1-ba1f-919ed718c43bn@googlegroups.com>
<if0bv9FbvtuU4@mid.individual.net> <9a5a922c-df27-4e3d-81a6-45d2eae4c958n@googlegroups.com>
<1d7b7897-f8ed-4bb5-9263-58789eef717en@googlegroups.com>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <d970269c-d96f-47d5-a634-02df85b550a1n@googlegroups.com>
Subject: Re: How bad is Javascripts randomisation function?
From: dr.j.r.stockton@gmail.com (John Stockton)
Injection-Date: Sat, 29 May 2021 11:37:43 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: John Stockton - Sat, 29 May 2021 11:37 UTC

On Monday, 24 May 2021 at 18:22:22 UTC+1, Michael Haufe (TNO) wrote:
> On Sunday, May 23, 2021 at 10:57:14 AM UTC-5, John Stockton wrote:
> > On Thursday, 29 April 2021 at 19:24:49 UTC+1, Arno Welzel wrote:
> > > Jonas Thörnvall:
> > >
> > > [snip]
> > >
> > > Why not just this:
> > >
> > > <https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Math/random>
> > Quite a lot bad, as I recall.
> >
> > See
> > http://web.archive.org/web/20150510110440/http://www.merlyn.demon.co.uk/js-randm.htm
> > which links to
> > http://web.archive.org/web/20180611034551/https://github.com/nquinlan/better-random-numbers-for-javascript-mirror .
> > See also http://www.jibbering.com/faq/index.html#randomNumber
> > and see what https://en.wikipedia.org/wiki/Random_number says and cites..
> >
> > According to
> > http://web.archive.org/web/20130127232731/http://www.merlyn.demon.co.uk/quotings.htm -
> > https://en.wikipedia.org/wiki/Donald_Knuth wrote/said
> > "Random numbers should not be generated with a method chosen at random"..
> If you want better random numbers use the following:
>
> <https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues>

That link says "The Crypto.getRandomValues() method lets you get cryptographically strong random values.". That sentence implies that random values exist which are not cryptographically strong, and so are not given. Therefore, the method does not give values in the range randomly. It may suit Jonas; but it does not provide full randomness, and is badly named.

Theorem : Any group producing things and giving them new names needs to include a hard-core PEDANT who is experienced not only in things of that nature but also in all languages, natural and artificial, which may be significantly involved. // Remember the story (probably true) of the luxury English car which sold unexpectedly badly in Germany - because its name included Rot13("Zvfg").

I would prefer to trust random code such as by Johannes Baagøe and associates/rivals; see for example his "Math.random" and the following discussion - https://groups.google.com/g/comp.lang.javascript/c/u8oCu7eNvUI/m/775xVCV_aAsJ?pli=1 (CLJ, Jun 2009).

AFAIR, those are better than https://en.wikipedia.org/wiki/Lehmer_random_number_generator ; but the latter or its modifications should I think usually suffice for non-crypto work.

--
(c) John Stockton, near London, UK. Using Google Groups. |
Mail: J.R.""""""""@physics.org - or as Reply-To, if any. |

Re: How bad is Javascripts randomisation function?

<slrnsb4beu.1q1s.jon+usenet@raven.unequivocal.eu>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=17040&group=comp.lang.javascript#17040

  copy link   Newsgroups: comp.lang.javascript
Path: i2pn2.org!i2pn.org!eternal-september.org!reader02.eternal-september.org!.POSTED!not-for-mail
From: jon+usenet@unequivocal.eu (Jon Ribbens)
Newsgroups: comp.lang.javascript
Subject: Re: How bad is Javascripts randomisation function?
Date: Sat, 29 May 2021 12:04:46 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 16
Message-ID: <slrnsb4beu.1q1s.jon+usenet@raven.unequivocal.eu>
References: <4166bb6e-0388-4ab1-ba1f-919ed718c43bn@googlegroups.com>
<if0bv9FbvtuU4@mid.individual.net>
<9a5a922c-df27-4e3d-81a6-45d2eae4c958n@googlegroups.com>
<1d7b7897-f8ed-4bb5-9263-58789eef717en@googlegroups.com>
<d970269c-d96f-47d5-a634-02df85b550a1n@googlegroups.com>
Injection-Date: Sat, 29 May 2021 12:04:46 -0000 (UTC)
Injection-Info: reader02.eternal-september.org; posting-host="22b73713a206901a292a0b07cc1b7788";
logging-data="2321"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18K6azYETFga7b0zoqLu9eD3YQFosJ0B8w="
User-Agent: slrn/1.0.3 (Linux)
Cancel-Lock: sha1:e9Im6T/Kwc3kHFhJbhI7/cbfZ8E=
 by: Jon Ribbens - Sat, 29 May 2021 12:04 UTC

On 2021-05-29, John Stockton <dr.j.r.stockton@gmail.com> wrote:
> That link says "The Crypto.getRandomValues() method lets you get
> cryptographically strong random values.". That sentence implies that
> random values exist which are not cryptographically strong, and so are
> not given. Therefore, the method does not give values in the range
> randomly. It may suit Jonas; but it does not provide full randomness,
> and is badly named.

This paragraph is so confused it's difficult to know where to start.
It seems like you think that some numbers are more random than others
and getRandomValues() avoids returning the "less random" numbers.

"Cryptographically-strong random number generators" are a subset of
"random number generators" (for example, excluding those methods that
produce low-quality randomness) so your statement above is like saying
"Fido is not a mammal because he is a dog".


devel / comp.lang.javascript / Re: How bad is Javascripts randomisation function?

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor