gnu.crypto.prng

Class Fortuna

public class Fortuna extends BasePRNG implements Serializable, RandomEventListener

The Fortuna continuously-seeded pseudo-random number generator. This generator is composed of two major pieces: the entropy accumulator and the generator function. The former takes in random bits and incorporates them into the generator's state. The latter takes this base entropy and generates pseudo-random bits from it.

There are some things users of this class must be aware of:

Adding Random Data
This class does not do any polling of random sources, but rather provides an interface for adding random events. Applications that use this code must provide this mechanism. We use this design because an application writer who knows the system he is targeting is in a better position to judge what random data is available.
Storing the Seed
This class implements Serializable in such a way that it writes a 64 byte seed to the stream, and reads it back again when being deserialized. This is the extent of seed file management, however, and those using this class are encouraged to think deeply about when, how often, and where to store the seed.

References:

Nested Class Summary
static classFortuna.Generator
The Fortuna generator function.
Field Summary
static StringSEED
Constructor Summary
Fortuna()
Method Summary
voidaddRandomByte(byte b)
voidaddRandomBytes(byte[] buf, int offset, int length)
voidaddRandomEvent(RandomEvent event)
voidfillBlock()
voidsetup(Map attributes)

Field Detail

SEED

public static final String SEED

Constructor Detail

Fortuna

public Fortuna()

Method Detail

addRandomByte

public void addRandomByte(byte b)

addRandomBytes

public void addRandomBytes(byte[] buf, int offset, int length)

addRandomEvent

public void addRandomEvent(RandomEvent event)

fillBlock

public void fillBlock()

setup

public void setup(Map attributes)
Copyright © 2001, 2002, 2003 Free Software Foundation, Inc. All Rights Reserved.