|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--iaik.security.random.SeedGenerator | +--iaik.security.random.MetaSeedGenerator
This seed generator generates new seeds given an initial seed. Often an application will need a number of seed generators. There is no need to seed each one separately from e.g. new user events, it is secure to generate a random seed only once and deduct further seeds from it using deterministic methods. This is what this class is for, it internally uses the system's default PRNG. The JDK SecureRandom uses a very similar mechanism.
To use it, first set the initial seed via one of the static setSeed() methods. Then create as many instances as you like using the constructors. It is anticipated that this seed generator will often be used as the default seed generator following an initialisation from user input.
NOTE: For obvious reasons, the initial seed should be as least as long as the longest seed that later is to be deducted from it. Also, as this classes uses the system's default PRNG (usually SHA1Random), so it can never generate true random seeds longer than the PRNG digest (160 bits for SHA1Random).
SeedGenerator
,
SHA1Random
Fields inherited from class iaik.security.random.SeedGenerator |
seedGenListener |
Constructor Summary | |
MetaSeedGenerator()
Initialize generation of a seed with the default amount of randomness (160 bit). |
|
MetaSeedGenerator(int numBits)
Initialize generation of a seed with the specified amount of randomness. |
Method Summary | |
byte[] |
getSeed()
Get the seed. |
int[] |
getStatus()
Return the status of seed generation. |
static void |
setSeed(byte[] seed)
Set the initial seed to this byte array. |
Methods inherited from class iaik.security.random.SeedGenerator |
callSeedGenListener, getDefault, getDefaultSeedGenerator, longToBytes, seedAvailable, setDefault, setDefaultSeedGenerator, setSeedGenListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public MetaSeedGenerator()
public MetaSeedGenerator(int numBits) throws RandomException
setSeed()
.
See the notes at the top of this class
about the value of this number.Method Detail |
public static void setSeed(byte[] seed)
public int[] getStatus()
{numBits, numBits}
, i.e. it is always ok to call getSeed().getStatus
in class SeedGenerator
public byte[] getSeed()
getSeed
in class SeedGenerator
|
This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |