Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [random]

The generation of random or pseudorandom data, and the use of randomness in security protocols

5
votes
4answers
199 views

Are there any practical attacks on random number generators?

I'm creating an internal security course for developers. To make it more interesting, I'm trying to reinforce each chapter with some real-world attacks but stumbled upon insecure random usage section. ...
2
votes
3answers
148 views

Password-hash proofing SHA-3

I am in a situation where I need to harden a password hash, but not allowed to bring in any extra dependencies, so I am pretty much forced to do the one thing everyone seems to advise against - roll ...
0
votes
1answer
35 views

Is it necessary to verify that my order confirmation IDs are unique?

I'm generating 9-character order confirmations such as K1YBFRG17, O1D15ZCOM, etc and using them as order confirmation numbers. It's basically just picking at random from the string '...
1
vote
1answer
73 views

The NIST randomness tests for a generated key

Does different tests for key randomness provided by NIST are available online? where one can test that which test for key generated are passed and which are failed?
2
votes
1answer
100 views

Is RDRAND used in a safe way by Windows 10?

This question was already answered by Linus Torvalds for Linux, and is also cited in this Q/A on this stack: We use rdrand as _one_ of many inputs into the random pool, and we use it as a way to ...
2
votes
1answer
98 views

When you XOR a random number with non-random number, does that give you a new random number?

XOR has the following truth table: 0, 0 : 0 0, 1 : 1 1, 0 : 1 1, 1 : 0 So per bit in an XOR operation, there is a 50% chance of that result being 1 and 50% chance of it being 0. If you XOR a random ...
1
vote
2answers
49 views

Should you use SecureRandom.getInstance() with or without a provider?

So, I am new to cryptography and I was learning about SecureRandom and all of the ways it calls implementations with or without providers. When I looked up some sites for information, it says not to ...
0
votes
2answers
109 views

/dev/random generate session key

if a server uses /dev/random to generate the random session key with a client. How you can launch a Denial-Of-Service (DOS) attack on such a server?
1
vote
1answer
48 views

Mobile application authentication using UUID

I write back-end code for mobile applications. I am needing to write the code for authentication and the simplest yet secure solution I can think of is: When user signs in, device sends username and ...
2
votes
1answer
110 views

For a “normal” computer user, does it make a difference to have a good entropy source?

Let's take, for example, Linux. From my understanding, there are different sources and different ways that can be used to gather entropy (RNG daemon, Intel rrandr, TPM, etc). Some produce entropy that ...
71
votes
5answers
14k views

What makes Random Number Generators so fragile?

It seems to me that a hardware component which generates random numbers is extremely simple - just measure tiny vibrations in the hardware with a sensor, right? Maybe I'm wrong but it seems like if ...
1
vote
1answer
69 views

What function is used to generate client random in TLS

I've been learning TLS. During the Client-Server Hello their random values are shared. The client generates a 28 byte random and combine it with 4 bytes of epoch time to generate a 32 byte random ...
1
vote
1answer
117 views

How to reverse engineer str_shuffle (PHP) to get its mt_rand outputs

$output = str_shuffle("12345"); E.g. $output is now 25134 How do I find out what numbers came out of mt_rand() to allow for the shuffle I want to know this because I want the seed of mt_rand() and ...
0
votes
1answer
91 views

Is a substring of base64 encoded random_bytes less secure then just using random_bytes

$bytes = random_bytes(15); $encoded = base64_encode($bytes); $output = substr($encoded, 0, 15); Does this code affect the complexity of the output vs just using $output = random_bytes(15); I think ...
1
vote
1answer
207 views

Would `cat /dev/random` be a denial of service to any other users of `/dev/random`?

As in the question. Wouldn't cat /dev/random decrease the entropy estimate until it blocks, which forces the random device to block for all applications on the current system?
18
votes
2answers
2k views

Is “always use /dev/urandom” still good advice in an age of containers and isolation?

In short: Instead of another question asking about when to use /dev/random instead of /dev/urandom, I present the following scenario, in which I find myself in an application I'm building: A VM or ...
1
vote
0answers
89 views

Does OpenSSH use padding of random lengths?

According to the end of RFC 4253 § 6, the random padding introduced to each SSH packet is an arbitrary multiple of 8. It mentions that random padding lengths can mitigate traffic analysis: Note ...
2
votes
1answer
188 views

Injecting data into the Windows entropy pool

On Linux, it is possible for userspace to mix arbitrary data with the kernel entropy pool by writing to the /dev/urandom device. Is there any equivalent on Windows which does not require SYSTEM?
1
vote
0answers
100 views

Problem in Cracking PHP rand() seed on windows

I read this article https://www.sjoerdlangkemper.nl/2016/02/11/cracking-php-rand/ about cracking php rand() function. and I involved with some problems on testing methods mentioned in article. I used ...
-3
votes
1answer
1k views

How to correctly use dev/urandom for random generation [closed]

Runs before main: d -c 30 /dev/urandom > random.bytes Access the randomly generated numbers int main() { FILE *fp; int fd = open("random.bytes",O_RDONLY); fp = fopen("file.txt" , ...
8
votes
1answer
381 views

Unix command to generate cryptographically secure random string

Is the following Unix command cryptographically secure to randomly generate 20 characters (a-zA-Z0-9 only)? dd if=/dev/urandom bs=256 count=1 2> /dev/null | LC_ALL=C tr -dc 'A-Za-z0-9' | head -c20 ...
9
votes
1answer
192 views

Random seed not propagating to the entropy pools in a timely manner

The Linux kernel's randomness driver collects entropy from the environment. Because there will be little entropy during boot, a random seed is often kept at /var/lib/misc/random-seed or a similar ...
3
votes
0answers
188 views

Entropy sources used by modern Windows

A comment on a Microsoft blog from 2005 mentions over 150 sources of entropy for the Windows CryptGenRandom function. The majority of sources come from low-level system information (precise stat ...
208
votes
11answers
41k views

Why is Math.random() not designed to be cryptographically secure?

The JavaScript Math.random() function is designed to return a single floating point value n such that 0 ≤ n < 1. It is (or at least should be) widely known that the output is not cryptographically ...
3
votes
1answer
111 views

Linux 'add_interrupt_randomness' implementation - low entropy contribution by cycles and jiffies?

Currently I'm analyzing the process of entropy generation of a Linux 64-bit kernel during system startup (for educational purpose). The system is hosted as/on a (64 bit) virtual machine (Xen domU). ...
2
votes
1answer
3k views

Need advices on API key & secret generation?

While working on a Java project using Spring-boot, Spring-security and JWT token, I need to provide access via API key and secret. After searching on Google for a while about key/secret generation, ...
0
votes
1answer
61 views

Key Generation on FIPS device or using SW with FIPS generator

I would like to understand the difference between these two options how to generate AES key. AES key is generated directly in FIPS 140-2 Level 3 device with validated AES algorithm AES key is ...
0
votes
0answers
211 views

How secure is BouncyCastle's SecureRandom .NET(C#) class?

I've already seen some question related to this, but the most upvoted answer just states that SecureRandom is not DumbRandom basically (yes, it doesn't use DateTime.Now.Ticks as its seed, of course). ...
2
votes
3answers
132 views

XOR of many prime sized cycles: secure?

I thought of a PRNG which is dependent on a large amount of good salt. The method is to use the salt to fill many arrays whose lengths are prime numbers, and cycle through each array, and ouput the ...
1
vote
1answer
133 views

Generating a secret on a compromised computer

Suppose we are on a compromised computer (for example infested with trojans logging key presses or taking screenshots) and for some reason we have to generate a number that's supposed to be secret for ...
4
votes
2answers
231 views

What role do hashing and block ciphers play in random number generation?

I read about pseudo random number generators and there were certain demands on which "underlying hash function" and "underlying block cipher" to use. What role do hashing algorithms and block ciphers ...
5
votes
1answer
163 views

How would someone attack a not truly random secret produced by a human?

Especially in cryptocurrencies you often hear people say that private key/seeds should not be typed "randomly" by humans, but rather use a truly random number generator. I understand, that humans ...
3
votes
1answer
161 views

Are many rounds of SHA needed for a random veracrypt key

Assume that I've used white noise from the classic "zener breakdown" circuit to produce 512 bits of random data. If I use these as the key to a Veracrypt volume, is there any benefit to running 200,...
1
vote
2answers
684 views

Is it possible to predict Python's random.random() if it is constantly seeded with high entropy values?

I am interested in understanding if it is possible to predict Python 3 random.random() when seeded with high entropy value from a physical system, like a dice toss. In other words, is random.random() ...
2
votes
3answers
464 views

Does the existence of two-factor recovery codes mean that my 2-factor code isn't completely random?

With some services that use standard 6-digit TOTP codes, they also offer the ability to have a set of backup codes, in case you lose your two factor device. With Google, for example, you can print ...
0
votes
1answer
212 views

Most widely used non Cryptographic random number generators

I want to research pseudo random number generators, and I see that a lot of the random number generators are not as secure as people assume. What I would like to know is what are the most widely used ...
1
vote
0answers
71 views

What's the difference between random number evaluation among AIS-31 AIS-20 and NIST sp800-22

I'm trying to know about the evaluation of random number generated by smart card chip. But these standards AIS-31, AIS-20 and NIST sp800-22 confuse me. Could someone help me with a brief explanation ...
0
votes
2answers
176 views

Does a completely random string produce a completely random hash

As the title states, say you create a hypothetical completely random string like one used for a OTP. Would hashing the string (provided it is the same length and possible characters as the hash ...
4
votes
2answers
121 views

Is it still secure if a cryptographic key generated with OpenSSL while a backdoored HWRNG used?

Assuming I plugged a HWRNG in to my Linux machine, use OpenSSL to generate a RSA key pair and encrypted some text with AES. Later then, a researcher posted the HWRNG was backdoored. Should I consider ...
58
votes
4answers
11k views

Expert quote on entropy for uncrackable password

Could anyone point to a quote in a published work - or suggest a recognised expert who might provide a quote - which answers the following question How much entropy in a password would guarantee ...
4
votes
2answers
198 views

Research about entropy of human randomness?

An argument people often use in favor of password managers is: Human-generated passwords have less entropy than randomly generated ones! Is there any research to back this up? Can we quantify it? ...
8
votes
4answers
3k views

Why are randomly generated passwords often hexadecimal?

Most of the time, when I see a randomly generated password, it's hexadecimal, i.e. only uses the character set [0-9a-f]. Wouldn't it be much more secure if the character set were [0-9a-z], let alone [...
1
vote
0answers
43 views

Content Delivery Security

An application has 2 servers - Server1 and Server2. Server1 stores db and image+video files. Server2 stores a copy of all image+video files. According to the geographical location of a user, if ...
1
vote
1answer
463 views

SHA256 for IV for AES-256 CBC?

When making an IV for AES-256 CBC mode the IV should be random and shouldn't be able to be guessed. If I were to use the rand() function in C, seeded with time(NULL) to generate sim random numbers ...
4
votes
1answer
101 views

Is my OpenPGP key rubbish because of bad entropy?

I had problems generating an OpenPGP key on my XUbuntu machine, because GnuPG did not get enough entropy. After some time of browsing and doing stupid stuff to generate more entropy, still nothing ...
3
votes
1answer
324 views

GETRANDOM syscall's relation to kernel entropy pool state

I get that when GETRANDOM is called with bitmask 00, the entropy source is from /dev/urandom, and the CSPRNG output is blocking until internal entropy pool has at least 128 bits of entropy. Is the ...
2
votes
1answer
511 views

Windows .NET equivalent to Linux /dev/random

Is there a pseudo device-based random data stream/file that can be used in Windows .NET programming in the same way as /dev/random can be read and used as a source of random values on Linux based ...
1
vote
3answers
257 views

Are outputs of this random string generating software safe to use as strong passwords?

Over a year ago, I've created a small form-based software. It's purpose, as the title states, is random string generation. It has options to combine numerical, small caps, large caps and special ...
1
vote
2answers
939 views

Why are hardware based random number generators considered better than software based generators?

Hardware based random number generators (RNG) get their randomness from the noise around. Software based generators get this usually from user input, like moving the mouse over a screen (like ...
2
votes
8answers
2k views

How should I securely generate random passwords when importing new users?

I need to generate random passwords when importing new users from an external source. I'm currently doing it by taking a random assortment of 8 lowercase/uppercase letters, and numbers. I am also ...