Hot answers tagged

10

If you can't see obvious patterns, that does not make it cryptographically secure! See also my answer to this question on our sibling site: What does it mean for a random number generator to be cryptographically secure? At the risk of stating the obvious, rand() and mt_rand() are NOT SECURE for security purposes. Do NOT use them for things like shuffling a ...


6

On Linux at least, /dev/random and /dev/urandom are basically the same thing; more specifically they are both interfaces to the same internal RNG, called the Linux Random Number Generator (LRNG), that share an input entropy pool; the only difference between them is whether or not they block when the LRNG is at low entropy. According to the man page for /...


4

This is a cut message. Your voicemail picked the phone: "Kevin Phelan is not able to talk with you, you may leave a voicemail if you wish..." At the same time, the calling bot started telling its offer "Hello dear customer, we will sell you the most delicious pickles you have tasted, please call us back at the 123456"(The voicemail intro ...


4

Here's a one-liner that you can use to generate a random string of digits: head /dev/urandom | tr -dc '[:digit:]' | cut -c 1-10 This creates a random string of 10 digits. To increase or decrease the length, adjust the 10 at the end to the desired length. To answer your second question, 'what's the lowest amount of digits I can make the ID before the odds ...


3

Netscape Navigator 1.1 1996 Ian Goldberg and David Wagner found out that Netscape Navigator 1.1 was using only three sources to seed their pseudo-random number generator (PRNG). The three sources were: the time of day, the process id, and the parent process id. They showed, these “random” sources aren’t that random and were relatively easy to figure out. ...


3

Intro Given that you're using a diceware list, I'll follow the one found here but this applies to any list (except for the average word size and some details in the instructions). Properties of the diceware list The instructions for using the diceware list make it clear that the overarching goal is to avoid bias when constructing a passphrase, starting from ...


3

Per https://www.php.net/manual/en/function.str-shuffle.php, str_shuffle uses PHP's internal PRNG, which is an implementation of Mersenne Twister (see http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/emt.html or https://en.wikipedia.org/wiki/Mersenne_Twister). According to Wikipedia, the standard Mersenne Twister implementation requires observing 624 ...


3

One notorious PRNG attack was the attack on the PRNG that was used for SSL in early versions of Netscape, as published in this paper written in 1996 by two PhD students at Berkeley. As explained in the paper, the PRNG relied on three sources of 'entropy': the time of day, the process ID, and the parent process ID.


2

It's better to use random_bytes than openssl_random_pseudo_bytes. From the manual(available since php 7.x) : random_bytes — Generates cryptographically secure pseudo-random bytes Sample code (from the manual too): <?php $bytes = random_bytes(5); var_dump(bin2hex($bytes)); ?>


2

I think is a reasonable approach, the most important aspect will be how hard the pin numbers are to guess - a 6 digit pin will take more effort than a 3 digit pin for example. The larger you can make the length of the pin number without compromising usability the better, I'd suggest no less than 6 digits. The maths is fairly simple: 3 digits means 1000 ...


2

If the numbers are random, the attacker has nothing to work with, and you can trivially calculate his probability of guessing a correct combination. If you have some kind of brute-force prevention triggering well below the level where a random guess has a reasonable chance of success, you should be good. I would agree that any kind of logic would give the ...


2

Assuming you have plenty of good, random bits, the pitfalls associated with caching randomness all stem from the potential for malicious access. That is, there isn't anything inherently wrong with caching randomness, however it creates a larger attack surface. If the developers have reason enough to believe that the memory is a safe storage location then ...


2

The answer depends on the way your are going to manipulate your passphrase, because some transformations will lower the entropy, while others will not. For example, are you changing the order of the words? Are you turning some verbs into adverbs, or nouns into adjectives, etc. to produce a better sentence? Then the resulting entropy is likely to be lower. Or ...


2

This password manager have the downsides of making formulas for creating passwords, and lacks the flexibility of a proper password manager. The most obvious issue is that the passwords are deterministic. It means that if you come across a website that forces you to use exact one digit on the password, you cannot use your password manager to generate it, as ...


2

There was an opensource ransomware named HiddenTear that created a random encryption key, but the key used Environment.TickCount as the seed, making it trivial to bruteforce the key. It also created a version.txt file containing the encrypted computer name. So to break it you would use a ballpark estimate of how long the computer was running when the malware ...


1

The motivation is in my opinion pretty clear from PEP 506: ... concerns that Python's standard library makes it too easy for developers to inadvertently make serious security errors ... Although the documentation for the random module explicitly states that the default is not suitable for security purposes [2], it is strongly believed that this warning may ...


1

It's all dependent on what you're doing with that state information after authorization and what could happen if an attacker modified it. If you're using it to reassociate a session then you need to make sure an attacker can't just randomly guess the session ID. Or conversely ask yourself what happens when an attacker randomly guesses it? If you're ...


1

It is, indeed, more secure to determine the pin at random, just like actual credit cards. However, you should prevent the pin from having more that 2 or 3 times the same number in a pin, depending on the lenght of said pin. 4425is acceptable, 4445or 4424 isn't.


1

According the the documentation the current implementation is a subtractive generator. The code for Random is easy enough to browse. It keeps an array of the 55 previously generated values, and uses two values 21 places apart to generate new numbers, The InternalSample() method shows exactly how each new number is generated. If you have raw output, you ...


1

Randomness and uniqueness are different concepts. Few random values from a large entropy space are generally all different but there is no guarantee on that. If you need both, I would split the key in two parts: one would be a simple sequence (uniqueness is guaranteed) and the latter would be produced by a random generator. The size of those parts depends ...


1

According to Raymond Chen at Microsoft, even version 4 GUIDs used in Windows since 2000 are not cryptographically secure. They use the basic random number generator, which can allow someone to predict past and future GUIDs if they know the state of the generator. Granted, this would only be relevant to a security-sensitive application. It's important to know ...


Only top voted, non community-wiki answers of a minimum length are eligible