Re: [fpc-pascal] quality of FPC random

2015-08-27 Thread Michael Schnell
Thinking more about the issue: As said, the quality of a random number generator is more a matter of taste than a subject to in-depth discussion (as nearly everything that is influenced by the way infinity word). Obviously a perfect random number generator (for integer numbers 0...n) *needs

Re: [fpc-pascal] quality of FPC random

2015-08-20 Thread David W Noon
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On Thu, 20 Aug 2015 22:50:05 +0200, Klaus Hartnegg (hartn...@gmx.de) wrote about Re: [fpc-pascal] quality of FPC random (in 55d63d7d.6040...@gmx.de): Am 14.08.2015 um 15:38 schrieb Xiangrong Fang: I need to generate random numbers to be used as IV

Re: [fpc-pascal] quality of FPC random

2015-08-20 Thread Peter
http://www.2uo.de/myths-about-urandom/ ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Re: [fpc-pascal] quality of FPC random

2015-08-20 Thread Klaus Hartnegg
Am 14.08.2015 um 15:38 schrieb Xiangrong Fang: I need to generate random numbers to be used as IV of block ciphers. My question is: is FPC built-in PRNG good enough as comparing to /dev/urandom? NO!!! For crypto always use /dev/urandom On the other hand, /dev/urandom in my impression is

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Michael Van Canneyt
On Mon, 17 Aug 2015, Peter wrote: On 17/08/15 09:05, Michael Schnell wrote: Unfortunately Randomize (in Linux in System) just does randseed:=longint(Fptime(nil)); if it would use /dev/urandom, Perhaps that is worthy of a bug report? Don't bother. It's just a default. You can

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Mark Morgan Lloyd
Michael Schnell wrote: On 08/14/2015 04:38 PM, Mark Morgan Lloyd wrote: It seeds itself with entropy from the intervals between LAN packets, intervals between typed characters and so on. Unfortunately Randomize (in Linux in System) just does randseed:=longint(Fptime(nil)); if it would

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Peter
On 17/08/15 09:05, Michael Schnell wrote: Unfortunately Randomize (in Linux in System) just does randseed:=longint(Fptime(nil)); if it would use /dev/urandom, Perhaps that is worthy of a bug report? ___ fpc-pascal maillist -

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Adriaan van Os
Michael Van Canneyt wrote: In short: People interested in crypto grade randomness should use specialized routines, not the built-ins provided by FPC. So, why not provide an FPC CryptoRandom function, calling into /dev/urandom on UNIX and CryptGenRandom

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Michael Schnell
On 08/17/2015 11:15 AM, Michael Van Canneyt wrote: In short: People interested in crypto grade randomness should use specialized routines, not the built-ins provided by FPC. +1 As said: random numbers are a matter if taste (or of the application) e.g. : I once did a project where we such a

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Jonas Maebe
Adriaan van Os wrote on Mon, 17 Aug 2015: So, why not provide an FPC CryptoRandom function, calling into /dev/urandom on UNIX and CryptGenRandom https://msdn.microsoft.com/en-us/library/aa379942(v=vs.85).aspx on Windows ? Proper cryptography requires much more than just unpredictable

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Michael Schnell
On 08/14/2015 04:38 PM, Mark Morgan Lloyd wrote: It seeds itself with entropy from the intervals between LAN packets, intervals between typed characters and so on. Unfortunately Randomize (in Linux in System) just does randseed:=longint(Fptime(nil)); if it would use /dev/urandom, the

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Michael Schnell
On 08/14/2015 04:27 PM, Xiangrong Fang wrote: Well, practically, how can I get totally unpredictable numbers? Nothing is totally unpredictable :-) I would set randseed via randseed and after this you can just use rand() for at least 2 gig numbers without any perceptible predictability.

Re: [fpc-pascal] quality of FPC random

2015-08-17 Thread Michael Schnell
On 08/17/2015 10:14 AM, Michael Schnell wrote: I would set randseed via randseed Grrr. I would set randseed via /dev/urandom -Michael ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org

Re: [fpc-pascal] quality of FPC random

2015-08-14 Thread Jonas Maebe
Xiangrong Fang wrote on Fri, 14 Aug 2015: I need to generate random numbers to be used as IV of block ciphers. My question is: is FPC built-in PRNG good enough as comparing to /dev/urandom? No PRNG is suited for that purpose, because every PRNG is by definition predictable and you need

[fpc-pascal] quality of FPC random

2015-08-14 Thread Xiangrong Fang
Hi All, I need to generate random numbers to be used as IV of block ciphers. My question is: is FPC built-in PRNG good enough as comparing to /dev/urandom? On the other hand, /dev/urandom in my impression is fairly slow, how is the speed of Random() comparing to that? Thanks! Xiangrong

Re: [fpc-pascal] quality of FPC random

2015-08-14 Thread Michael Schnell
On 08/14/2015 03:47 PM, Jonas Maebe wrote: My question is: is FPC built-in PRNG good enough as comparing to /dev/urandom? No PRNG is suited for that purpose, because every PRNG is by definition predictable and you need unpredictable numbers for IVs. How should /dev/urandom not be

Re: [fpc-pascal] quality of FPC random

2015-08-14 Thread Mark Morgan Lloyd
Michael Schnell wrote: On 08/14/2015 03:47 PM, Jonas Maebe wrote: My question is: is FPC built-in PRNG good enough as comparing to /dev/urandom? No PRNG is suited for that purpose, because every PRNG is by definition predictable and you need unpredictable numbers for IVs. How should

Re: [fpc-pascal] quality of FPC random

2015-08-14 Thread Xiangrong Fang
2015-08-14 21:47 GMT+08:00 Jonas Maebe jonas.ma...@elis.ugent.be: Xiangrong Fang wrote on Fri, 14 Aug 2015: I need to generate random numbers to be used as IV of block ciphers. My question is: is FPC built-in PRNG good enough as comparing to /dev/urandom? No PRNG is suited for that

Re: [fpc-pascal] quality of FPC random

2015-08-14 Thread Jonas Maebe
Xiangrong Fang wrote on Fri, 14 Aug 2015: 2015-08-14 21:47 GMT+08:00 Jonas Maebe jonas.ma...@elis.ugent.be: No PRNG is suited for that purpose, because every PRNG is by definition predictable and you need unpredictable numbers for IVs. ​Well, practically, how can I get totally