RE: Generating a lot of randomness...

2005-06-25 Thread David Schwartz

 I see things for adding entropy, loading files, etc. I don't see
 anything about generating random numbers. Am I missing something so
 obvious if it was a snake it would have bitten me by now?

RAND_bytes

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread Ken Goldman
 Date: Thu, 23 Jun 2005 12:22:30 -0400
 From: C Wegrzyn [EMAIL PROTECTED]
 
 I have to generate quite a few random keys (and iv's) during a days. It
 comes out to about 1 million keys (16 bytes each) and 1 million iv's (16
 bytes each).
 
 I tried using /dev/random and /dev/urandom but in one case it blocks too
 much of the time and in the other seems to run pretty slow. I tried
 using EGAD et al to no avail. So I decided to take a different
 approach.  I am hoping to hear from others how they might have solved
 the problem.
 
 I thought I would take a hash of the message and using it as the salt
 call EVP_BytesToKey.  I was wondering what others think of this solution.

I've seen this approach: Use the hardware random number generator HRNG
to seed a pseudorandom number generator PSRG.  Use PSRG to generate
random numbers.  Each n random numbers, reseed PSRG from HRNG.

-- 
Ken Goldman   [EMAIL PROTECTED]   914-784-7646
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread C Wegrzyn
I can't add anything beyond what is available on a AMD or Intel
motherboard. So is there a built-in HRNG that I can get to (if so, where
is the driver for it)?

Thanks again,
Chuck Wegrzyn


Ken Goldman wrote:

Date: Thu, 23 Jun 2005 12:22:30 -0400
From: C Wegrzyn [EMAIL PROTECTED]

I have to generate quite a few random keys (and iv's) during a days. It
comes out to about 1 million keys (16 bytes each) and 1 million iv's (16
bytes each).

I tried using /dev/random and /dev/urandom but in one case it blocks too
much of the time and in the other seems to run pretty slow. I tried
using EGAD et al to no avail. So I decided to take a different
approach.  I am hoping to hear from others how they might have solved
the problem.

I thought I would take a hash of the message and using it as the salt
call EVP_BytesToKey.  I was wondering what others think of this solution.



I've seen this approach: Use the hardware random number generator HRNG
to seed a pseudorandom number generator PSRG.  Use PSRG to generate
random numbers.  Each n random numbers, reseed PSRG from HRNG.

  


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Generating a lot of randomness...

2005-06-23 Thread David Schwartz

 I can't add anything beyond what is available on a AMD or Intel
 motherboard. So is there a built-in HRNG that I can get to (if so, where
 is the driver for it)?

Use /dev/urandom to seed your own PRNG. Or use it to seed OpenSSL's 
PRNG.

Why are you asking on this list anyway? Did you try OpenSSL's PRNG and 
find
it insufficient?

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread C Wegrzyn
Generating one or two random numbers over a period of time isn't a big
deal. Generating 100,000+  128 bit random numbers an hour taxes
/dev/random and /dev/urandom. Even the use of EGAD doesn't help.

If you re-read the thread you will see that I wrote what I thought was a
reasonable approach and looking for concrete criticism of it or other ways.

C


David Schwartz wrote:

I can't add anything beyond what is available on a AMD or Intel
motherboard. So is there a built-in HRNG that I can get to (if so, where
is the driver for it)?



   Use /dev/urandom to seed your own PRNG. Or use it to seed OpenSSL's 
 PRNG.

   Why are you asking on this list anyway? Did you try OpenSSL's PRNG and 
 find
it insufficient?

   DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


  


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Generating a lot of randomness...

2005-06-23 Thread David Schwartz

 Generating one or two random numbers over a period of time isn't a big
 deal. Generating 100,000+  128 bit random numbers an hour taxes
 /dev/random and /dev/urandom. Even the use of EGAD doesn't help.

Right.
 
 If you re-read the thread you will see that I wrote what I thought was a
 reasonable approach and looking for concrete criticism of it or 
 other ways.

But why not the obvious approach -- using OpenSSL's RNG?

DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread C Wegrzyn
I see things for adding entropy, loading files, etc. I don't see
anything about generating random numbers. Am I missing something so
obvious if it was a snake it would have bitten me by now?

Chuck  Wegrzyn

David Schwartz wrote:

Generating one or two random numbers over a period of time isn't a big
deal. Generating 100,000+  128 bit random numbers an hour taxes
/dev/random and /dev/urandom. Even the use of EGAD doesn't help.



   Right.
 
  

If you re-read the thread you will see that I wrote what I thought was a
reasonable approach and looking for concrete criticism of it or 
other ways.



   But why not the obvious approach -- using OpenSSL's RNG?

   DS


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


  


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread Michael Sierchio

C Wegrzyn wrote:

I have to generate quite a few random keys (and iv's) during a days. It
comes out to about 1 million keys (16 bytes each) and 1 million iv's (16
bytes each).

I tried using /dev/random and /dev/urandom but in one case it blocks too
much of the time and in the other seems to run pretty slow. I tried
using EGAD et al to no avail. So I decided to take a different
approach.  I am hoping to hear from others how they might have solved
the problem.

I thought I would take a hash of the message and using it as the salt
call EVP_BytesToKey.  I was wondering what others think of this solution.


I would say that qualifies as close to the definition of bad from
a cryptographic standpoint. ;-)

Use /dev/random to seed Yarrow, or another PRNG, if you need a lot of
random material.  Don't make it a function of anything that isn't
a nonce.

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Generating a lot of randomness...

2005-06-23 Thread Ted Mittelstaedt


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of C Wegrzyn
Sent: Thursday, June 23, 2005 10:14 AM
To: Ken Goldman
Cc: openssl-users@openssl.org
Subject: Re: Generating a lot of randomness...


I can't add anything beyond what is available on a AMD or Intel
motherboard. So is there a built-in HRNG that I can get to (if so, where
is the driver for it)?


What operating system are you using?

Ted

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread C Wegrzyn
Linux (gentoo variant).

C.

Ted Mittelstaedt wrote:

  

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of C Wegrzyn
Sent: Thursday, June 23, 2005 10:14 AM
To: Ken Goldman
Cc: openssl-users@openssl.org
Subject: Re: Generating a lot of randomness...


I can't add anything beyond what is available on a AMD or Intel
motherboard. So is there a built-in HRNG that I can get to (if so, where
is the driver for it)?




What operating system are you using?

Ted

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


  


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


Re: Generating a lot of randomness...

2005-06-23 Thread Michael Sierchio


This is a few years old, but may be useful.   The code illustrates the
use of the HMAC variant on ANSI X9.17 key generation as described in the
paper, used to generate random byte strings.  It uses the hash functions
in the OpenSSL libraries.

Paper:
http://www.tenebras.com/papers/SecureRandom.html

Code:
http://www.tenebras.com/code/hmac-prng.tar.gz
__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


RE: Generating a lot of randomness...

2005-06-23 Thread Ted Mittelstaedt

I thought that Linux's random device now supports the HRNG's
for Intel, AMD and Via.  Here's the docs on the Intel HRNG:

http://www.linuxhq.com/kernel/v2.4/3/Documentation/i810_rng.txt

What does menuconfig say?  

The Linux driver used to be built on the old
Theodore Ts'o code, which is not sufficiently random for 
very high crypto.  Maybe your Linux distribution still
uses this code?

An overview of the VIA Technologies HRNG is here:

http://www.via.com.tw/en/initiatives/padlock/hardware.jsp

FreeBSD 5.x has a driver for this in it's /dev/random device.

An overview of the HRNG in the Intel CPU's (P3 and later) is here:

http://www.cryptography.com/resources/whitepapers/IntelRNG.pdf

Another very good technique is to use a simple PC cam with
the lenscap on.  Here's the link:

http://www.lavarnd.org/what/index.html

Have fun!

Ted

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of C Wegrzyn
Sent: Thursday, June 23, 2005 4:14 PM
To: openssl-users@openssl.org
Cc: Ken Goldman
Subject: Re: Generating a lot of randomness...


Linux (gentoo variant).

C.

Ted Mittelstaedt wrote:

  

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of C Wegrzyn
Sent: Thursday, June 23, 2005 10:14 AM
To: Ken Goldman
Cc: openssl-users@openssl.org
Subject: Re: Generating a lot of randomness...


I can't add anything beyond what is available on a AMD or Intel
motherboard. So is there a built-in HRNG that I can get to 
(if so, where
is the driver for it)?




What operating system are you using?

Ted

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]


  


__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]

__
OpenSSL Project http://www.openssl.org
User Support Mailing Listopenssl-users@openssl.org
Automated List Manager   [EMAIL PROTECTED]