1. need details on random number generator

I developed, a while back, an encryption algorithm.  It relies on random
number seeds fed to the random number generator in Euphoria.  What is thi=
s
generator, the rand() function?  Is it built-in machine language, or is i=
t
a C thing?  Details are needed if people *including myself) are to "trust=
"
this algorithm for serious use.  Thanks.

--Alan
 =

new topic     » topic index » view message » categorize

2. Re: need details on random number generator

Alan Tu writes:
> I developed, a while back, an encryption algorithm.  It relies on
> random number seeds fed to the random number generator in
> Euphoria.  What is this generator, the rand() function?  Is it built-in
> machine language, or is it a C thing?  Details are needed if
> people *including myself) are to "trust" this algorithm for
> serious use. Thanks.

The algorithm used by Euphoria comes from a paper written
several years ago. I'd have to dig around to find it. Euphoria's
algorithm is much better than the one supplied with most
C compilers, including WATCOM.

If you are using it for encryption, you probably don't want me
to reveal all the details. Suffice it to say, the numbers generated
are more "random" than most generators, and the length of
the sequence before it repeats is *much* longer than most.
All pseudo-random, software generators will repeat after
a long while (millions or billions).

It's easy to do tests to see if rand() is reasonably random.
One test is to pick two random numbers
and plot them as {x,y} on a pixel graphics screen with
some color. If the texture appears lumpy, or shows
a noticable pattern, then there may be something wrong
with the random number generator.

include graphics.e

integer x, y

if graphics_mode(18) then
end if

for i = 1 to 100000 do  -- try more!
    x = rand(640)-1
    y = rand(480)-1
    pixel(WHITE, {x,y})
end for

if getc(0) then
end if

if graphics_mode(-1) then
end if

Regards,
     Rob Craig
     Rapid Deployment Software
     http://members.aol.com/FilesEu/

new topic     » goto parent     » topic index » view message » categorize

3. Re: need details on random number generator

Robert Craig wrote:

<snip>

>
> It's easy to do tests to see if rand() is reasonably random.
> One test is to pick two random numbers
> and plot them as {x,y} on a pixel graphics screen with
> some color. If the texture appears lumpy, or shows
> a noticable pattern, then there may be something wrong
> with the random number generator.
>

<code snip>



        I'm not so shure, I wrote a routine to text
some random stuff I wa working on a while back and I got
lumps all over the place in it.
The routine graphically showed how many times each
possible number showed up, after several thousand
itterations the  graph, which shoul've been a near perfect
straight line. showed peaks and valleys, thes peaks
and valleys showed up early and just kept growing throughout
the run.
        Maybee it was due to an error in my code, but i don't
really see how.  I'll see if i can find it and post it here.
        it occures to me the x,y thing won't necessarily show some
non-random situations, you only see it the first time a particular
co-ordinate pair is picked, what if one pair is picked every tenth
time? won't show because the point is already drawn




> Regards,
>      Rob Craig
>      Rapid Deployment Software
>      http://members.aol.com/FilesEu/

                        Kasey

new topic     » goto parent     » topic index » view message » categorize

4. Re: need details on random number generator

>>>>>
        I'm not so shure, I wrote a routine to text
some random stuff I wa working on a while back and I got
lumps all over the place in it.
The routine graphically showed how many times each
possible number showed up, after several thousand
itterations the  graph, which shoul've been a near perfect
straight line. showed peaks and valleys, thes peaks
and valleys showed up early and just kept growing throughout
the run.
<<<<<

Bob, that's OK.  Few of us, if any, are experts in the crypto field.  I'v=
e
been in this stuff for a while.  Knowledgeable people I know have advised=

me that such random number generators (including Euphoria's) are not
suitable for cryptographic use, as you may have just re-inforced, which i=
s
fine with me.

--Alan
 =

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu