Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
Change personalization string to timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
StrangerCoug committed Nov 4, 2023
1 parent 76a96c7 commit c876eef
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import com.github.strangercoug.freecasino.objs.Player;
import lombok.extern.java.Log;

import java.nio.ByteBuffer;
import java.security.DrbgParameters;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
Expand All @@ -64,10 +65,12 @@ public class FreeCasino {

static {
RandomGenerator rng1;
byte[] personalizationString = ByteBuffer.allocate(Long.BYTES).putLong(System.currentTimeMillis()).array();

log.info("Getting SecureRandom instance for the backup RNG...");
try {
rng1 = SecureRandom.getInstance("DRBG",
DrbgParameters.instantiation(256, PR_AND_RESEED, "FreeCasino".getBytes()));
DrbgParameters.instantiation(256, PR_AND_RESEED, personalizationString));
log.info("Successfully got defined SecureRandom instance for the backup RNG.");
} catch (NoSuchAlgorithmException e) {
log.warning("Unable to get the defined SecureRandom instance for the backup RNG; using the default " +
Expand Down

0 comments on commit c876eef

Please sign in to comment.