Info Call to Random API

Description

List of all calls to methods that return pseudo-random values.

Recommendation

Do not seed Random with the current time because that value is more predictable to an attacker than the default seed.

The java.util.Random class must not be used either for security-critical applications or for protecting sensitive data. Use a more secure random number generator, such as the java.security.SecureRandom class.

Technical details

Method org.mockito.internal.creation.bytebuddy.SubclassBytecodeGenerator.<init>() calling method java.util.Random.<init>()


    protected SubclassBytecodeGenerator(org.mockito.internal.creation.bytebuddy.SubclassLoader p1, net.bytebuddy.implementation.Implementation p2, net.bytebuddy.matcher.ElementMatcher p3)
    {
        this.loader = p1;
        this.readReplace = p2;
        this.matcher = p3;
        this.byteBuddy = new net.bytebuddy.ByteBuddy().with(net.bytebuddy.dynamic.scaffold.TypeValidation.DISABLED);
        this.random = new java.util.Random();
        return;
    }

Method okhttp3.OkHttpClient.newWebSocket() calling method java.util.Random.<init>()


    public okhttp3.WebSocket newWebSocket(okhttp3.Request p8, okhttp3.WebSocketListener p9)
    {
        okhttp3.internal.ws.RealWebSocket v6 = new okhttp3.internal.ws.RealWebSocket;
        v6(p8, p9, new java.util.Random(), ((long) this.pingInterval));
        v6.connect(this);
        return v6;
    }

Method net.bytebuddy.dynamic.TypeResolutionStrategy$Active.resolve() calling method java.util.Random.<init>()


    public net.bytebuddy.dynamic.TypeResolutionStrategy$Resolved resolve()
    {
        return new net.bytebuddy.dynamic.TypeResolutionStrategy$Active$Resolved(this.nexusAccessor, new java.util.Random().nextInt());
    }

Method net.bytebuddy.agent.builder.AgentBuilder$InitializationStrategy$SelfInjection.dispatcher() calling method java.util.Random.<init>()


    public net.bytebuddy.agent.builder.AgentBuilder$InitializationStrategy$Dispatcher dispatcher()
    {
        return this.dispatcher(new java.util.Random().nextInt());
    }

Method org.apache.commons.lang3.RandomUtils.<clinit>() calling method java.util.Random.<init>()


    static RandomUtils()
    {
        org.apache.commons.lang3.RandomUtils.RANDOM = new java.util.Random();
        return;
    }

Method org.apache.commons.lang3.RandomStringUtils.<clinit>() calling method java.util.Random.<init>()


    static RandomStringUtils()
    {
        org.apache.commons.lang3.RandomStringUtils.RANDOM = new java.util.Random();
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(boolean[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(short[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(Object[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(long[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(int[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(float[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(double[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(char[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.lang3.ArrayUtils.shuffle() calling method java.util.Random.<init>()


    public static void shuffle(byte[] p1)
    {
        org.apache.commons.lang3.ArrayUtils.shuffle(p1, new java.util.Random());
        return;
    }

Method org.apache.commons.codec.digest.UnixCrypt.crypt() calling method java.util.Random.<init>()


    public static String crypt(byte[] p9, String p10)
    {
        if (p10 != null) {
            if (!p10.matches("^[./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz]{2,}$")) {
                StringBuilder v0_7 = new StringBuilder();
                v0_7.append("Invalid salt value: ");
                v0_7.append(p10);
                throw new IllegalArgumentException(v0_7.toString());
            }
        } else {
            byte[] v10_3 = new java.util.Random();
            StringBuilder v0_2 = org.apache.commons.codec.digest.UnixCrypt.SALT_CHARS.length;
            String v1_1 = new StringBuilder();
            v1_1.append("");
            v1_1.append(org.apache.commons.codec.digest.UnixCrypt.SALT_CHARS[v10_3.nextInt(v0_2)]);
            v1_1.append(org.apache.commons.codec.digest.UnixCrypt.SALT_CHARS[v10_3.nextInt(v0_2)]);
            p10 = v1_1.toString();
        }
        StringBuilder v0_5 = new StringBuilder("             ");
        String v1_3 = 0;
        int v2_4 = p10.charAt(0);
        byte[] v10_6 = p10.charAt(1);
        v0_5.setCharAt(0, v2_4);
        v0_5.setCharAt(1, v10_6);
        int v4_1 = org.apache.commons.codec.digest.UnixCrypt.CON_SALT;
        int v2_5 = v4_1[v2_4];
        byte[] v10_8 = (v4_1[v10_6] << 4);
        int v6_0 = new byte[8];
        int v7_1 = 0;
        while (v7_1 < v6_0.length) {
            v6_0[v7_1] = 0;
            v7_1++;
        }
        int v7_0 = 0;
        while ((v7_0 < v6_0.length) && (v7_0 < p9.length)) {
            v6_0[v7_0] = ((byte) (p9[v7_0] << 1));
            v7_0++;
        }
        int v9_4 = org.apache.commons.codec.digest.UnixCrypt.body(org.apache.commons.codec.digest.UnixCrypt.desSetKey(v6_0), v2_5, v10_8);
        byte[] v10_10 = new byte[9];
        org.apache.commons.codec.digest.UnixCrypt.intToFourBytes(v9_4[v1_3], v10_10, v1_3);
        org.apache.commons.codec.digest.UnixCrypt.intToFourBytes(v9_4[1], v10_10, 4);
        v10_10[8] = 0;
        int v9_6 = 2;
        int v4_3 = 0;
        int v5_1 = 128;
        while (v9_6 < 13) {
            int v6_2 = v4_3;
            int v7_2 = v5_1;
            int v4_0 = 0;
            int v5_2 = 0;
            while (v4_0 < 6) {
                v5_2 <<= 1;
                if ((v10_10[v6_2] & v7_2) != 0) {
                    v5_2 |= 1;
                }
                v7_2 >>= 1;
                if (v7_2 == 0) {
                    v6_2++;
                    v7_2 = 128;
                }
                v0_5.setCharAt(v9_6, ((char) org.apache.commons.codec.digest.UnixCrypt.COV2CHAR[v5_2]));
                v4_0++;
            }
            v9_6++;
            v4_3 = v6_2;
            v5_1 = v7_2;
        }
        return v0_5.toString();
    }

Method org.apache.commons.codec.digest.B64.getRandomSalt() calling method java.util.Random.<init>()


    static String getRandomSalt(int p5)
    {
        StringBuilder v0_1 = new StringBuilder();
        int v1 = 1;
        while (v1 <= p5) {
            v0_1.append("./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".charAt(new java.util.Random().nextInt(64)));
            v1++;
        }
        return v0_1.toString();
    }

Method net.bytebuddy.utility.RandomString.<init>() calling method java.util.Random.<init>()


    public RandomString(int p2)
    {
        if (p2 <= null) {
            throw new IllegalArgumentException("A random string\'s length cannot be zero or negative");
        } else {
            this.length = p2;
            this.random = new java.util.Random();
            return;
        }
    }

Method kotlin.random.KotlinRandom.<init>() calling method java.util.Random.<init>()


    public KotlinRandom(kotlin.random.Random p2)
    {
        kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull(p2, "impl");
        this.impl = p2;
        return;
    }

Method kotlin.random.FallbackThreadLocalRandom$implStorage$1.initialValue() calling method java.util.Random.<init>()


    protected java.util.Random initialValue()
    {
        return new java.util.Random();
    }

Method com.google.android.gms.measurement.internal.zzfx.zzmj() calling method java.util.Random.<init>()


    public final long zzmj()
    {
        if (this.zzaus.get() != 0) {
            try {
                this.zzaus.compareAndSet(-1, 1);
                return this.zzaus.getAndIncrement();
            } catch (Throwable v1_2) {
                throw v1_2;
            }
        } else {
            try {
                Throwable v1_5 = new java.util.Random((System.nanoTime() ^ this.zzbx().currentTimeMillis())).nextLong();
                long v3_1 = (this.zzado + 1);
                this.zzado = v3_1;
                return (v1_5 + ((long) v3_1));
            } catch (Throwable v1_7) {
                throw v1_7;
            }
        }
    }

Method io.split.android.client.SplitFactoryImpl.<clinit>() calling method java.util.Random.<init>()


    static SplitFactoryImpl()
    {
        io.split.android.client.SplitFactoryImpl.RANDOM = new java.util.Random();
        return;
    }

Method com.google.common.cache.Striped64.<clinit>() calling method java.util.Random.<init>()


    static Striped64()
    {
        com.google.common.cache.Striped64.threadHashCode = new ThreadLocal();
        com.google.common.cache.Striped64.rng = new java.util.Random();
        com.google.common.cache.Striped64.NCPU = Runtime.getRuntime().availableProcessors();
        try {
            com.google.common.cache.Striped64.UNSAFE = com.google.common.cache.Striped64.getUnsafe();
            com.google.common.cache.Striped64.baseOffset = com.google.common.cache.Striped64.UNSAFE.objectFieldOffset(com.google.common.cache.Striped64.getDeclaredField("base"));
            com.google.common.cache.Striped64.busyOffset = com.google.common.cache.Striped64.UNSAFE.objectFieldOffset(com.google.common.cache.Striped64.getDeclaredField("busy"));
            return;
        } catch (Exception v0_7) {
            throw new Error(v0_7);
        }
    }

Method com.google.android.gms.tagmanager.zzai.<init>() calling method java.util.Random.<init>()


    public zzai(android.content.Context p2, String p3)
    {
        this(p2, p3, new java.util.Random());
        return;
    }

Method com.google.android.gms.analytics.Tracker.<init>() calling method java.util.Random.<init>()


    Tracker(com.google.android.gms.internal.measurement.zzaw p3, String p4, com.google.android.gms.internal.measurement.zzcn p5)
    {
        super(p3);
        super.zzsy = new java.util.HashMap();
        super.zzsz = new java.util.HashMap();
        if (p4 != null) {
            super.zzsy.put("&tid", p4);
        }
        super.zzsy.put("useSecure", "1");
        super.zzsy.put("&a", Integer.toString((new java.util.Random().nextInt(2147483647) + 1)));
        super.zzta = new com.google.android.gms.internal.measurement.zzcn("tracking", super.zzbx());
        super.zztb = new com.google.android.gms.analytics.Tracker$zza(super, p3);
        return;
    }

Method com.crashlytics.android.answers.RandomBackoff.<init>() calling method java.util.Random.<init>()


    public RandomBackoff(io.fabric.sdk.android.services.concurrency.internal.Backoff p2, double p3)
    {
        this(p2, p3, new java.util.Random());
        return;
    }

Method com.facebook.internal.Utility.generateRandomString() calling method java.util.Random.<init>()


    public static String generateRandomString(int p2)
    {
        return new java.math.BigInteger((p2 * 5), new java.util.Random()).toString(32);
    }

Method org.apache.http.impl.auth.DigestSchemeHC4.createCnonce() calling method java.security.SecureRandom.<init>()


    public static String createCnonce()
    {
        byte[] v1_1 = new byte[8];
        new java.security.SecureRandom().nextBytes(v1_1);
        return org.apache.http.impl.auth.DigestSchemeHC4.encode(v1_1);
    }

Method com.google.android.gms.measurement.internal.zzfx.zzmk() calling method java.security.SecureRandom.<init>()


    final java.security.SecureRandom zzmk()
    {
        this.zzaf();
        if (this.zzaur == null) {
            this.zzaur = new java.security.SecureRandom();
        }
        return this.zzaur;
    }

Method com.google.android.gms.measurement.internal.zzfx.zzgz() calling method java.security.SecureRandom.<init>()


    protected final void zzgz()
    {
        this.zzaf();
        com.google.android.gms.measurement.internal.zzau v0_5 = new java.security.SecureRandom();
        long v1 = v0_5.nextLong();
        if (v1 == 0) {
            v1 = v0_5.nextLong();
            if (v1 == 0) {
                this.zzgt().zzjj().zzby("Utils falling back to Random for random id");
            }
        }
        this.zzaus.set(v1);
        return;
    }