Integrated crypto

Adrian Fisher mobiletiw at fishersinter.net
Thu Apr 1 08:24:53 PST 2004


Here are someexample links for you:

http://www.thinkage.ca/english/gcos/expl/c/lib/seed48.html
http://wwwwbs.cs.tu-berlin.de/user-taipan/kraxel/gnuinfo/libc/ANSI_Random.html

Take care.

A


Adrian Fisher wrote:

> It has been a long time since i have used C but shouldn't you seed it 
> first?
>
> A
>
> Robert Connolly wrote:
>
>> Anyway. This is an example in http://www.xs4all.nl/~hanb/software/
>> arc4random.tar.bz2
>>
>> #include <stdlib.h>
>> int main(void) {
>>     int byte1, byte2, byte3;
>>         byte1 = random() % 256;
>>         byte2 = random() % 256;
>>         byte3 = random() % 256;
>>         printf("#%02x%02x%02x\n", byte1, byte2, byte3);
>>  }
>>
>> random() can be replaced with rand() too. The output from this is not 
>> random, its the same over and over. Why isn't rand() random?
>>
>>  
>>
>




More information about the hlfs-dev mailing list