secure-random Questions

5

Solved

I tried SecureRandom.random_number(9**6) but it sometimes returns 5 and sometimes 6 numbers. I'd want it to be a length of 6 consistently. I would also prefer it in the format like SecureRandom.ran...
Dunigan asked 17/5, 2017 at 17:20

1

A java application does something like this: SecureRandom random = new SecureRandom(); for(int i=0;i<12;i++){ random.nextInt(19); } At random.nextInt() the java freezes for several minutes, se...
Worden asked 19/1, 2022 at 10:21

4

I am trying to understand the advantages of using UUID.randomUUID() over SecureRandom generator as the former uses securerandom internally.
Perversion asked 30/9, 2016 at 8:24

2

Solved

Java 9 (JSR 379) introduces the NIST DRBG's as specified in JEP 273: DRBG-Based SecureRandom Implementations. However, the NIST document SP 800-90Ar1 (NIST Special Publication 800-90A Revision 1: R...
Raymond asked 9/10, 2019 at 12:33

1

Solved

Java 9 introduced a new SecureRandom called DRBG. I want to use it to deterministically generate random numbers. The problem is that it uses a nonce internally which it always changes, so I don't g...
Littlest asked 18/6, 2018 at 10:28

3

I have read that, generally, some implementations of SecureRandom may produce true random numbers. In particular, the Android docs say instances of this class will generate an initial seed usin...
Pomerania asked 12/9, 2014 at 21:28

1

There are a lot of questions asking if a specific initiation of SecureRandom is "good", but I couldn't find a rule of thumb. What's the best way to create a "good" random SecureRandom? // Fast //...
Nutt asked 29/11, 2016 at 9:59

2

Solved

The title pretty much summarizes it - we can create one instance of java.util.Random (or SecureRandom) and use it every time we need a random value or we can create a new instance every time on dem...
Avirulent asked 16/10, 2018 at 15:3

2

Solved

I'm generating a random string using: private String generateSafeToken() { SecureRandom random = new SecureRandom(); byte bytes[] = new byte[512]; random.nextBytes(bytes); return bytes.t...
Polyploid asked 17/9, 2017 at 5:36

3

Users can purchase a "Pro" version of my app. When they do, I store and verify their purchase as follows. Combine the user's UUID and another unique string. The resulting string is then encrypted...
1

© 2022 - 2025 — McMap. All rights reserved.