On Thu, Apr 5, 2012 at 12:07 AM, Prashanth kumar N
<[email protected]> wrote:
> You can use the below API's
>
>  RAND_bytes()
>
> RAND_pseudo_bytes()
Sorry to nitpick. Its gets old auditing high integrity code where the
damn programmers ignore return values as if every succeeds.

 #include <openssl/rand.h>

 int RAND_bytes(unsigned char *buf, int num);
 int RAND_pseudo_bytes(unsigned char *buf, int num);
 ...

RAND_bytes() returns 1 on success, 0 otherwise. RAND_pseudo_bytes()
returns 1 if the bytes generated are cryptographically strong, 0
otherwise. Both functions return -1 if they are not supported by the
current RAND method.

Jeff



> On Thu, Apr 5, 2012 at 12:33 AM, Jeremy Farrell <[email protected]>
> wrote:
>>
>> http://lmgtfy.com/?q=openssl+random+number
>>
>> > From: Alex Chen [mailto:[email protected]]
>> >
>> > There is a 'rand' command in the openssl command line tool to generate
>> > 'pseudo' random number generator.  But I cannot find the API from
>> > either the 'ssl' or 'crypto' man pages.
>> > Can someone point me to the API page if it is available?
>> >
>> > Is this RNG implementation different in the regular distribution  and
>> > the FIPS Object module?
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [email protected]
Automated List Manager                           [email protected]

Reply via email to