During my research on a java application, I discovered that the nextInt(64) function of the java.Random() class is used to generate the encryption key.
The key size is 16 bytes. I know that this generator is not recommended because it is vulnerable. Especially in this case, the value of each byte of the key is selected from a short range from 0x0 to 0x40.
I already got acquainted with the fact that it is possible to predict the next values of the generator using the previous values. But in my case meyan has no data about the previous values (The key is encrypted and I don't have access to its values), so here we are talking about iterating over the key values. I don't understand how can I use the data that each next value depends on the previous one (oldseed parameter)?
protected int next(int bits) {
long oldseed, nextseed;
AtomicLong seed = this.seed;
do {
oldseed = seed.get();
nextseed = (oldseed * multiplier + addend) & mask;
} while (!seed.compareAndSet(oldseed, nextseed));
return (int)(nextseed >>> (48 - bits));
}
How to reduce the number of enumeration for such a 16-byte key?