Hello Neeraj!
Greetings. Your application using DRBG instead of NativePRNG is most likely related to configuration settings and the security provider preferences of your Java environment. What Java version and K8 version you are using?
Below are few steps to diagnose this problem:
1. Check Java Security Configuration:
The Java security properties file (java.security) controls the default SecureRandom implementation. Ensure this file is configured correctly.
You can find the java.security file in your JDK's lib/security directory.
Look for the property securerandom.strongAlgorithms. It should list NativePRNG as one of the algorithms. If DRBG is listed first, that might be why it's being used.
securerandom.strongAlgorithms=NativePRNG,DRBG,....
2. Specify to Use NativePRNG:
Explicitly specify the algorithm when creating instances of SecureRandom.
SecureRandom secureRandom = SecureRandom.getInstance("NativePRNG");
If your UUID generation code does not allow for specifying the SecureRandom instance, consider setting the java.security.egd system property to point to a source that uses NativePRNG.
-Djava.security.egd=file:/dev/urandom
3. Check Docker and OS configuration:
Ensure that /dev/urandom or /dev/random is available and accessible within your Docker container.
Sometimes, containers might have restricted or different configurations for entropy sources.
4. Security Provider Logging:
Enable debugging for security providers to see detailed logs which might help in understanding why NativePRNG is not being used.
-Djava.security.debug=sun.security.provider.SecureRandom
By following these steps, you might be able to diagnose why NativePRNG is not being used.
Edit your Comment