Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.security.crypto.core
Class SpinnerEntropySource

`java.lang.Object
oracle.security.crypto.core.EntropySource
oracle.security.crypto.core.SpinnerEntropySource`

All Implemented Interfaces:
  java.lang.Runnable

public class SpinnerEntropySource
extends EntropySource
implements java.lang.Runnable

A source of seeding entropy based on the presumption of intrinsic randomness in JVM thread scheduling, comparable to the "generateSeed" method in `java.security.SecureRandom`.

IMPORTANT: This class uses an experimental algorithm, which does not meet strong cryptographic standards for scalable entropy sources, which can only be provided by dedicated hardware or external signal sources. However, as such it is probably comparable to other software-only entropy-gathering techniques commonly in use, e.g. AWT- or keyboard-based entropy extractors, so-called entropy generating daemons (EGDs) based on periodic hashing of running system states, etc., and should be considered susceptible to similar vulnerabilities and performance constraints.

Also note that, since this is an experimental algorithm, its real entropy-gathering effectiveness is not well understood. Therefore, estimates of the entropy gathered should be very conservative. For example, if a lower bound of 1 bit of "true" randomness per byte generated is assumed, and if 160 bits of entropy are needed for secure seeding, then 160 bytes should be generated as PRNG seed material.

See Also:
  `RandomBitsSource`

Constructor Summary
`SpinnerEntropySource()` Create a new `SpinnerEntropySource` that will use the default thread sleep time (100 ms).
`SpinnerEntropySource(int sleepTime)` Create a new `SpinnerEntropySource` that will use the given thread sleep time.

Method Summary
`void` | `clear()` Overrides the corresponding abstract method in the `EntropySource` class, but has no effect since there is no sensitive state data contained here for the JVM's thread scheduler.
`byte` | `generateByte()` Generate a byte of seeding material, obtained by casting the lowest 8 bits of a raw counter value.
`int` | `getSleepTime()` Return the delay parameter for the timeslice counter.
`void` | `run()`
`void` | `setSleepTime(int sleepTime)` Set the delay parameter for the timeslice counter.
`java.lang.String` | `toString()`

Methods inherited from class oracle.security.crypto.core.EntropySource
`generateBytes, getDefault, setDefault`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Constructor Detail

### SpinnerEntropySource

    public SpinnerEntropySource()

  Create a new `SpinnerEntropySource` that will use the default thread sleep time (100 ms).

### SpinnerEntropySource

    public SpinnerEntropySource(int sleepTime)

  Create a new `SpinnerEntropySource` that will use the given thread sleep time.
Parameters:
  `sleepTime` - The thread sleep time, in milliseconds, that the spinner algorithm will use. Must be greater than 0, and should be greater than 10 for statistical reliability.

Method Detail

### setSleepTime

    public void setSleepTime(int sleepTime)

  Set the delay parameter for the timeslice counter. (Default is 100 milliseconds.)
  Parameters:
    `sleepTime` - The thread sleep time, in milliseconds, that the spinner algorithm will use. Must be greater than 0, and should be greater than 10 for statistical reliability.

### getSleepTime

    public int getSleepTime()

  Return the delay parameter for the timeslice counter.

### generateByte

    public byte generateByte()

  Generate a byte of seeding material, obtained by casting the lowest 8 bits of a raw counter value.
  Specified by:
    `generateByte` in class `EntropySource`

### run

    public void run()

  Specified by:
    `run` in interface `java.lang.Runnable`

### clear

    public void clear()

  Overrides the corresponding abstract method in the `EntropySource` class, but has no effect since there is no sensitive state data contained here for the JVM's thread scheduler.
  Specified by:
    `clear` in class `EntropySource`

### toString

    public java.lang.String toString()

Overview | Package | Class | Tree | Deprecated | Index | Help
| Oracle Security Developer Tools Crypto Java API Reference 10g Release 3 (10.1.3) B25378-01
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2005, 2006 , Oracle. All rights reserved.