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

learn more… | top users | synonyms

3
votes
2answers
57 views

Is it secure to create a Bitcoin address from a private key generated by Rand() instead of cryptographic elliptic curve

I am writing a C++ application that creates a Bitcoin address. I am having a hard time installing openssl for windows and making it work for visual studio. So, I am asking myself, if I create a ...
2
votes
1answer
107 views

Is it fine to store single-use beta keys plain-text?

Is it okay to store single-use beta keys in plain-text in the database? I'll be pre-generating and storing about 2M keys. The keys get passed around so that people can sign up with it, rather than let ...
0
votes
0answers
16 views

What is the difference between Shannon entropy and saying that tossing a 6-sided die 100 times has more than 256-bit entropy? [migrated]

I'm confused. I thought that tossing a 6-sided die 100 times had a greater than 256-bit entropy because 6^99 < 2^256 < 6^100. (A similar concept appeared in this XKCD comic, where choosing four ...
1
vote
4answers
621 views

Add a file as entropy source for /dev/random

What I have: A large file containing lots of secret, true-random bytes (yes, I'm sure they're not merely pseudo-random). I'll call it F. What I want to do: Tell Linux that it can use this file as an ...
5
votes
3answers
107 views

Is it worth augmenting /dev/random entropy in software?

Modern Linux systems, especially headless virtuals, often have shallow /dev/random entropy pools, which can cause software to block or fail to run (e.g. Tripwire in FIPS mode) While many agree ...
19
votes
3answers
6k views

Cracking a linear congruential generator

I was recently listening to the security now podcast, and they mentioned in passing that the linear congrunential generator (LCG) is trivial to crack. I use the LCG in a first year stats computing ...
0
votes
0answers
11 views

What are the possible issues with generating random numbers in OpenSSL this way [migrated]

My following method is supposed to generate random numbers using OpenSSL. Is this correct and sufficient? Or do you see any issues with it? vector<unsigned char> generateBytes(const unsigned ...
0
votes
1answer
27 views

A simple question about entropy and random data

Let's say I roll a 6-sided die 100 times and record the results into a 100 character string, for example: //this is obviously an example (and very unlikely) outcome ...
8
votes
1answer
89 views

Attacks on keys generated with low entropy

If I were to give someone a two 4096 bits keys, and say one was generated in a Linux OS with very very low entropy available, and one was generated in a Linux OS with more than enough entropy. Would ...
2
votes
2answers
121 views

Why does gpg use /dev/urandom [duplicate]

Looking at the strace output of GPG on my box seems to show that it uses /dev/urandom when encrypting a message without any access to /dev/random even when --no-random-seed-file is specified. Are ...
1
vote
2answers
109 views

Token-based authentication - what's a good token length?

What's a good token character length for a token-based login? Currently I'm using the following code: <?php $token = bin2hex(openssl_random_pseudo_bytes(16)); Is 16 sufficient or should ...
4
votes
1answer
53 views

Law of Large Numbers vs. OpenSSL RAND_bytes

I have a system where tens of thousands of users log in whenever they like and my server has to assign them to one of many databases. I would like to distribute the users evenly amongst the databases. ...
11
votes
1answer
584 views

Is Postgres's uuid_generate_v4 securely random?

I'm using Postgres's uuid_generate_v4 in a uuid primary key column to generate secure one-time authentication tokens. Is this okay? Does Postgres use a secure random number source for generating these ...
3
votes
2answers
49 views

Calculating the time required to brute force a random code

Say we have amount random entry codes of length characters from an alphabet of size alphabet. The number of possible codes is then easily calculated as keyspace = alphabet ^ length. Now take an ...
5
votes
1answer
42 views

Who can certify RNG according NIST SP800-22?

I have written my own random number generator as a C library and I tested it on NIST Statistical Test Suite. Now I would like to get a certification to have a formal proof that my C library generates ...
0
votes
0answers
40 views

Using UUIDs for non-guessable URLs [duplicate]

How safe is using UUIDs as URL identifier for non-guessable IDs? Specifically UUIDs generated by Python's uuid4() function, using base64 encoding. E.g. ...
1
vote
1answer
40 views

Can a salt maintain pseudo-randomness after being modified?

TL;DR: How much can a function (such as the one below) modify an initially random string before that string becomes useless as a salt for password hashing? Is there a general rule? # Function ...
1
vote
1answer
42 views

RDRAND in Intel Celeron CPUs under Linux

Is there any reason to believe that the hardware RNG in an Intel Celeron CPU is more unreliable than in other CPUs? Can someone confirm that what Linus Torvalds says is true, namely that Linux does ...
2
votes
1answer
62 views

Will two virtual machines running on the same physical host machine get the same value from /dev/random?

Will two virtual machines running on the same physical host machine get the same value from /dev/random if read over the same time period? Say that Virtual-machine-1 wants to generate its ssh host ...
1
vote
0answers
18 views

Evaluating a noise source for a RNG - defining a one-paramter family for RNG [closed]

I am trying to evaluate a noise-source as a means of providing entropy to a random number generator. I am running into trouble when it comes to determining the probability distribution that has the ...
3
votes
1answer
135 views

Ring Oscillator: True Random Number Generator (TRNG) vs Physically Unclonable Function (PUF)

Ring oscillators can be used in hardware true random number generators (TRNG), and also in physically unclonable functions (PUFs). The designs seem fairly similar: TRNG based on ring oscillators: ...
8
votes
1answer
192 views

Do randomized PID bring more security?

What is the concrete advantage of using random PIDs instead of traditional sequential ones? Some times ago, I've read an article in the french magazine MISC (no. 74 - July/August, 2014) publishing a ...
2
votes
2answers
35 views

Which software RNG for linux?

A headless server can suffer from a lack of entropy, which is a problem given that encryption needs random numbers. In the absence of a hardware random number generator (RNG) the numbers must be ...
3
votes
1answer
102 views

Managing keys generated with insufficient entropy

Since the Linux RNG which provides /dev/random (and by extension /dev/urandom) is seeded by "mouse and keyboard activity, disk I/O operations, and specific interrupts" (source, PDF) and since virtual ...
2
votes
2answers
77 views

Offline RSA strong prime test similar to Phuctor?

One of the ways that RSA keys get consistently owned is when they're generated without enough entropy. Dan Kaminsky refers to a study which found that 1 in 200 RSA keys were badly generated and these ...
2
votes
1answer
137 views

What comprises the AIS-31 standard for TRNGs?

I'm researching how my smart card's chipset generates random numbers. According to a source in forums the YubiKey NEO is based on the A700x chipset from NXP. The page for the chipset indicates that ...
4
votes
2answers
106 views

Should other processes be running while an iPhone or Android is generating a cryptographically random number?

I need to generate a cryptographically secure random number on iOS and Android. I could use a software approach or leverage the built in OS API for this. In each case, is it better to generate a ...
4
votes
1answer
54 views

Is is possible to avoid internal seeding of a RNG and seed the generator manually using OpenSSL's RAND_bytes()?

I'm trying to write a random number generator with the OpenSSL library. The provided RAND_bytes() function is self-seeding with the /dev/urandom. That's why I am only able to reseed with the ...
5
votes
2answers
100 views

Linux random number compliance

Not sure if this is the right forum, and I am pretty sure that his must have been answered before (I searched a lot but I haven't found a definitive answer). Do the Linux random number generators ...
1
vote
2answers
197 views

Is `arc4random` secure enough?

I need to generate many many initialization vectors and session keys in C++ code. I am wondering if arc4random is up to the task. Last I heard, there are many weaknesses in the RC4 cipher. Should I ...
7
votes
7answers
681 views

Is it possible to make a more secure random number generator algorithm by XORing two or more less secure random number algorithms?

Is it possible to make a more secure random number generator (e.g. for cryptologic purposes) by combining two or more less secure random number generator algorithms using XOR? Here is an example of ...
3
votes
1answer
235 views

Predicting Math.random() numbers?

I was reading up on the documentation for Math.random() and I found the note: Math.random() does not provide cryptographically secure random numbers. Do not use them for anything related to ...
17
votes
6answers
2k views

What does “random” mean in the context of password creation?

Disclaimer: as you will see from my question I'm a total outsider in this subject, just very curious. I was wondering how easy it would be to crack a password-protected RAR5 file, and I found many ...
5
votes
2answers
4k views

Should I use urandom() or openssl_random_pseudo_bytes()?

I am developing a site in PHP 5.4. Which function is better to use to generate a random salt for password security? $salt = sha1(openssl_random_pseudo_bytes(23)); or $seed = ''; $a = ...
8
votes
1answer
251 views

RSA key generation: gpg vs openssh

When I generate RSA key for ssh (both server-side and client-side): dpkg-reconfigure openssh-server ssh-keygen the key generation is completed instantly. However, when I generate RSA key for gpg, ...
9
votes
2answers
245 views

AES encryption on embedded device: Can this be secure?

I plan to create an encryption program for an embedded device with the following characteristics: CPU is Intel 80186 compatible @ ~20 MHz 128 KB RAM, of which I have ~20 KB at my disposal for ...
7
votes
4answers
496 views

How to check randomness of random number generators?

Assume that I have a smart card that returns an 8 byte (for example) random value on reception of a command. The question is that: How I can check if this value is really random? (I don't have any ...
0
votes
2answers
173 views

Initialization of a LUKS encrypted partition with cipher or /dev/urandom

I've created a few encrypted devices with LUKS and cryptsetup on Linux and am pretty comfortable with disk encryption in this regard. I've seen it mentioned in many different places that when setting ...
1
vote
1answer
112 views

How to protect against random number generator attacks

I am using custom hardware on which i'm using the random noise from an ADC converter and a few other seeds. I combine these in an algorithm and have tested it against FIPS PUB 140-2 for a random ...
1
vote
3answers
104 views

How to compare passwords with duplicate password

On Steam, the gaming client, I have this habit of creating multiple "smurf" accounts. I have a randomly-generated, unique password, and I decided to use the same password for all of my multiple ...
12
votes
3answers
13k views

License key / Serial number generator and checker

I need a serial number generator and accompanying checker. I would like to be able to set a salt (and maybe a length). The generator should only produce serial numbers that pass the test of the ...
20
votes
7answers
4k views

Are humans a strong or weak RNG? [duplicate]

Thomas Pornin has stated in the past on multiple occasions (I'm not going to source them, he can argue with me if he wants) that humans are bad RNGs. While I agree that human RNG for password ...
1
vote
0answers
40 views

How is the random string of Thunderbird's profile folder generated? [closed]

As per this link, Thinderbird creates a folder by name in the format ".default” where ”” is an eight digit string randomly generated by Thunderbird. But how is it generated? Which random generator ...
92
votes
3answers
16k views

Is a rand from /dev/urandom secure for a login key?

Lets say I want to create a cookie for a user. Would simply generating a 1024 bit string by using /dev/urandom, and checking if it already exists (looping until I get a unique one) suffice? Or should ...
16
votes
4answers
5k views

Generate cryptographically strong pseudorandom numbers in Javascript?

Is there any good way to generate cryptographically strong pseudorandom (or true random) numbers in Javascript? The crucial requirement: if a.com's Javascript generates some random numbers, no one ...
1
vote
1answer
991 views

Using Random Numbers As Session variables

I am using randomly generated numbers as session variables to identify the sessions in a PHP application. To make further security proof what ways should I follow?
14
votes
4answers
7k views

Why OpenSSL can't use /dev/random directly?

I couldn't find the answer for the reason anywhere, even the wiki page doesn't explain it. This seems like using a PRNG for seeding an another PRNG. The first one (/dev/random) may itself be seeded by ...
0
votes
1answer
192 views

Creating secure PIN in Java

I need to create cryptographically secure PIN number in Java using secret id for each user. This simple approach comes to mind: int getPin(String secretUserIdStr) { String pepper = ...
4
votes
2answers
349 views

Including and storing the order of character entry in a password as an enhanced security measure

I'm sure I will be quickly corrected if this is a stupid idea, or if it has already been tried. My question is: has this idea been tried before? If not, are there good reasons it would not work, or ...
2
votes
1answer
255 views

Key's random art image is mostly black

I have generated an SSH key on Ubuntu 10.04 with ssh-keygen -t rsa -C "example@example.com" and the key's random art image comes out mostly empty (modified slightly): +--[ RSA 2048]----+ | ...