java.lang.Object
java.util.Random
mindbright.security.SecureRandom
- All Implemented Interfaces:
- java.io.Serializable
- public class SecureRandom
- extends java.util.Random
This class uses the scheduler to generate random numbers. It counts the
number of times a loop is repeated before a thread has slept for a specified
number of milliseconds. These numbers are then fed to a hash function to mask
any possible correlations.
| Fields inherited from class java.util.Random |
|
|
Method Summary |
protected int |
next(int bits)
Generates the next random number. |
void |
nextPadBytes(byte[] bytes,
int len)
|
void |
nextPadBytes(byte[] bytes,
int off,
int len)
|
void |
startUpdater()
|
protected void |
update()
Get new unused bytes. |
static void |
writeBytes(long a,
byte[] dest,
int i,
int length)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
md5
MD5 md5
t
private int t
updater
public java.lang.Thread updater
secureLevel
public static int secureLevel
unused
byte[] unused
- unused[unusedPos..15] is unused pseudo-random numbers.
unusedPos
int unusedPos
unusedLock
java.lang.Object unusedLock
poolSweep
int poolSweep
SecureRandom
public SecureRandom()
SecureRandom
public SecureRandom(byte[] seed)
update
protected void update()
- Get new unused bytes.
next
protected int next(int bits)
- Generates the next random number.
startUpdater
public void startUpdater()
nextPadBytes
public void nextPadBytes(byte[] bytes,
int len)
nextPadBytes
public void nextPadBytes(byte[] bytes,
int off,
int len)
writeBytes
public static final void writeBytes(long a,
byte[] dest,
int i,
int length)