Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15027
| From | Ole Tange <tange@gnu.org> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: $RANDOM not Cryptographically secure pseudorandom number generator |
| Date | 2019-01-02 02:29 +0100 |
| Message-ID | <mailman.6674.1546392582.1284.bug-bash@gnu.org> (permalink) |
| References | (5 earlier) <4bc5800d-0dfb-17a5-0b20-9f4bef5a60b6@case.edu> <CA+4vN7yTJRqc=8eCJWQMXu7nZu7ZreLTEp56SC-LTavSVW-d1A@mail.gmail.com> <CAOSMAus5OvX91r-y8K3Bw7e-T1aj9U72+uE64iM346AV+uSwAA@mail.gmail.com> <CA+4vN7wS_PPH60j_gw2t_2kokds0eZxCzgqAydqiNz5=JLTMxw@mail.gmail.com> <8d46616b-7618-be59-3651-1a01bc3bf7e6@case.edu> |
On Mon, Dec 31, 2018 at 8:12 PM Chet Ramey <chet.ramey@case.edu> wrote: : > Thanks for the patch. I'll take a look after I release bash-5.0. One > question: can you reproduce the same random sequence by using the same > seed? That's for backwards compatibility, even if the sequences themselves > differ. Yes. Seeding with a value will give the same sequence: $ RANDOM=4; echo $RANDOM $RANDOM 21584 22135 $ RANDOM=4; echo $RANDOM $RANDOM 21584 22135 For backwards compatibility integers are supported, but they are really parsed as strings. Strings make it easier to seed with more than 64-bits: RANDOM=`cat GPLv3.txt` So these give the same value on 4.4.23, but differs with the patch applied: RANDOM=$(echo 2^64 | bc );echo $RANDOM RANDOM=$(echo 2^65 | bc );echo $RANDOM RANDOM="foo"; echo $RANDOM RANDOM="bar"; echo $RANDOM RANDOM=2; echo $RANDOM RANDOM=" 2.0"; echo $RANDOM RANDOM=" 2.0noise"; echo $RANDOM /Ole
Back to gnu.bash.bug | Previous | Next — Next in thread | Find similar | Unroll thread
Re: $RANDOM not Cryptographically secure pseudorandom number generator Ole Tange <tange@gnu.org> - 2019-01-02 02:29 +0100 Re: $RANDOM not Cryptographically secure pseudorandom number generator Luuk <luuk@invalid.lan> - 2019-01-02 12:01 +0100
csiph-web