This is an automated email from the ASF dual-hosted git repository.

asf-gitbox-commits pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-rng.git


The following commit(s) were added to refs/heads/master by this push:
     new e558d169 Document unsuitability for use in a cryptographic or security 
purposes
e558d169 is described below

commit e558d169304fc2768ef6c5b4fc911badb36958b9
Author: Alex Herbert <[email protected]>
AuthorDate: Sat Aug 22 11:58:25 2026 +0100

    Document unsuitability for use in a cryptographic or security purposes
---
 .../apache/commons/rng/core/source32/ISAACRandom.java | 19 ++++++++++++++-----
 .../org/apache/commons/rng/simple/RandomSource.java   |  7 +++++++
 src/changes/changes.xml                               |  5 +++++
 3 files changed, 26 insertions(+), 5 deletions(-)

diff --git 
a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/ISAACRandom.java
 
b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/ISAACRandom.java
index eff8b2e8..41593c94 100644
--- 
a/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/ISAACRandom.java
+++ 
b/commons-rng-core/src/main/java/org/apache/commons/rng/core/source32/ISAACRandom.java
@@ -21,16 +21,25 @@ import java.util.Arrays;
 import org.apache.commons.rng.core.util.NumberFactory;
 
 /**
- * A fast cryptographic pseudo-random number generator.
+ * ISAAC: a fast pseudo-random number generator.
  * <p>
  * ISAAC (Indirection, Shift, Accumulate, Add, and Count) generates 32-bit
  * random numbers.
- * ISAAC has been designed to be cryptographically secure and is inspired
- * by RC4.
+ * ISAAC was designed by its author as a cryptographic pseudo-random number
+ * generator inspired by RC4.
  * Cycles are guaranteed to be at least 2<sup>40</sup> values long, and they
  * are 2<sup>8295</sup> values long on average.
- * The results are uniformly distributed, unbiased, and unpredictable unless
- * you know the seed.
+ * The results are uniformly distributed and unbiased.
+ * <p>
+ * <strong>This implementation is not suitable for cryptographic or
+ * security purposes.</strong> This library targets statistical
+ * applications: the default seeding procedure is not a cryptographically
+ * strong source of entropy, and the full internal state of the generator
+ * can be saved and restored (see
+ * {@link org.apache.commons.rng.RestorableUniformRandomProvider}), so
+ * output must be assumed to be predictable. Use
+ * {@link java.security.SecureRandom} to generate keys, tokens, session
+ * identifiers or any other security-sensitive values.
  * <p>
  * This code is based (with minor changes and improvements) on the original
  * implementation of the algorithm by Bob Jenkins.
diff --git 
a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
 
b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
index 0cc3f893..0749021d 100644
--- 
a/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
+++ 
b/commons-rng-simple/src/main/java/org/apache/commons/rng/simple/RandomSource.java
@@ -249,6 +249,13 @@ public enum RandomSource {
      *  <li>Native seed type: {@code int[]}.</li>
      *  <li>Native seed size: 256.</li>
      * </ul>
+     *
+     * <p><strong>Note:</strong> Although the ISAAC algorithm was designed by 
its
+     * author as a cryptographic pseudo-random number generator, this
+     * implementation, its default seeding and its saveable state are intended
+     * for statistical applications only and are <em>not</em> suitable for
+     * cryptographic or security purposes. Use {@link 
java.security.SecureRandom}
+     * for security-sensitive values.</p>
      */
     ISAAC(ProviderBuilder.RandomSourceInternal.ISAAC),
     /**
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index fb5ec0aa..b4aa4bb4 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -56,6 +56,11 @@ If the output is not quite correct, check for invisible 
trailing spaces!
     <release version="1.8" date="TBD" description="
 New features, updates and bug fixes (requires Java 8).
 ">
+      <action dev="aherbert" type="update" due-to="Security scan, Alex 
Herbert">
+        "ISAACRandom": Document unsuitability for use in a cryptographic or 
security
+        purposes due to the use of a non-cryptographically strong source of 
entropy for
+        seeding, and access to the internal state by save/restore 
functionality.
+      </action>
       <action dev="aherbert" type="update" due-to="Security scan, Alex 
Herbert" issue="RNG-196">
         "FastLoadedDiceRollerDiscreteSampler": Introduce a defaut alpha to 
exclude
         practically unobservable categories with a probability of less than 
2^-53

Reply via email to