Questions tagged [random]

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

Filter by
Sorted by
Tagged with
7
votes
2answers
6k views

Cryptographically secure number generator for node.js

I am looking for a cryptographically secure number generator for node.js. Afaik. Math.random() does not meet these requirements. Is there any nodejs lib which can generate cryptographically secure ...
1
vote
0answers
185 views

Vulnerable Keys? CVE-2008-0166 openssl DSA Key Signature Blacklist coverage?

Would the current set of DSA key blacklists detect a DSA key that was generated with openssl on an affected/vulnerable system, BUT whose DSA parameters (dsaparam) were generated on an unaffected ...
5
votes
1answer
733 views

All weak Debian openssl DSA keys

More weak keys? 32768 weak keys can be downloaded for analysis, but are there more? Three times as many? There is much information about DSA-1571-1 openssl -- predictable random number generator. ...
1
vote
1answer
476 views

How can I use OpenSSL with an external source of randomness?

When generating RSA keys using OpenSSL, if I want to use an external source of randomness (e.g an HSM that can provide random numbers), is the best way to get a new random number (for every generation)...
3
votes
1answer
905 views

How to Determine the State of a Random Number Generator?

Its always been said that to get strong cryptographic numbers in computing, a good random number generator is needed. Without a good source of randomness, it could be possible for an attacker to ...
1
vote
1answer
84 views

Fair Conscription

It is interesting to read about the random number generation problems in the last USA conscription. If, for the same purpose, we need a random permutation of the 366 birthdays, what should the ...
6
votes
2answers
9k views

Java UUID.randomUUID() or SecureRandom for id segment on URL?

In building a Java based system that needs unique identifiers on the URL, is UUID.randomUUID() or SecureRandom a better choice? More specifically, a call to POST /items will return a 201 Created with ...
2
votes
1answer
131 views

Is there any bias in this random selection from a dictionary?

I am generating passwords by selecting random words from a dictionary and counting entropy=words_in_passphrase*log(dictionary_size)/log(2). This algorithm assumes words will be selected from the ...
2
votes
1answer
483 views

How secure is this Diceware generator?

I wonder, because you can visit the site offline and still create passwords. Is this site safe and good for use? https://www.rempe.us/diceware/#eff
0
votes
2answers
6k views

How safe are the passwords suggested by Apple keychain?

Safari on recent versions of Mac OSX can suggest passwords on signup forms. These passwords have the a similar form (the alphanumeric characters are separated by dashes: AbC-dEf-941-T3k) and they only ...
2
votes
1answer
192 views

How does Google Chrome's JS Crypto RNG Work?

According to caniuse, Google Chrome has support for crypto.getRandomValues() for (presumably/hopefully) generating cryptographically secure random values. How is this implemented? As there have been ...
4
votes
2answers
2k views

Why would the session ID entropy only be half of the length of the session ID?

On this page on the OWASP website, there is a sentence about session id entropy I find quite strange: The session ID value must provide at least 64 bits of entropy (if a good PRNG is used, this ...
0
votes
1answer
82 views

Shuffle large string securely

I have a large string that I need to shuffle in a secure manner. It will be around 4000 characters. The resulting permutation of such string, must be one in the set of all possible permutations (4000!)...
0
votes
0answers
676 views

Generate 256 bit nonce from crypto.getRandomValues()

I need a 256 bit nonce in JavaScript and cannot use external libraries. I was planning on simply concatenating values from crypto.getRandomValues(): let ints = new Uint32Array(8); window.crypto....
3
votes
1answer
173 views

IoT secure identification scheme

We're contemplating to use the following design to securely identify IoT devices from the cloud, and we would like to know if anybody would see major flaws in it. The design is based on the use of a ...
6
votes
3answers
2k views

Saving random seed on restart/shutdown, and restoring it during system boot

On Debian (and I guess on other linux distributions as well), there is an init script /etc/init.d/urandom, whose function it is to: "Save and restore random seed between restarts" In my case, this ...
0
votes
1answer
28 views

Do CSPRNGs have a maximum input seed length to output length ratio?

Using what may be considered today's "best" or "most secure" CSPRNGs, how much maximum data N can you read from a CSPRNG given seed input of length n before the output starts becoming predictable (...
1
vote
1answer
265 views

Help with hash functions and pseudo-random functions

I am a little bit confused about the terms "hash function" and "pseudo-random function". As far as I know, I can use a cryptographic strong hash function as a PRF. The hash function has a IV and is ...
3
votes
1answer
917 views

Difference between pseudorandom generator and pseudorandom function

Is there a difference between a pseudorandom generator (PRG) and a pseudorandom function (PRF)? I read a lot about that things, for example it is possible to build a PRG from PRFs. But I think there ...
2
votes
1answer
62 views

Entropy in multitenant environments

How is entropy generated for cryptographically secure pseudo random number generator (CSPRNG) seeds in an Intel x64 Windows environment? If it uses Intel's Digital Random Number Generator (DRNG), does ...
0
votes
2answers
238 views

How is entropy “stirring” accomplished in the Microsoft TPM?

Page 14 of Microsoft's TPM abstraction says that is allows for "stirring" A call to BCryptGenRandom will fill the caller-provided buffer with random data. The maximum random number size is ...
1
vote
0answers
42 views

In Windows CSP, is it better to get secure random numbers as one large array or several smaller ones?

I need to generate several random bytes arrays in one time for different purposes. What way would be preferred: Generate one large random bytes array in single API call and then split by chunks for ...
4
votes
3answers
369 views

Predictability of PHPs array_rand

It's generally known information that methods such as the array_rand() method in PHP are not considered cryptographically secure. I'm trying to understand under what situations generated result may be ...
0
votes
1answer
265 views

With a very large number of GUIDs, can one predict the previous and subsequent GUIDs that will be generated?

I've been reading up on GUIDs. According to the Wiki: Cryptanalysis of the WinAPI GUID generator shows that, since the sequence of V4 GUIDs is pseudo-random, given full knowledge of the internal ...
1
vote
1answer
167 views

HPET effects on CSPRNG for Linux OS

HPET or High Precision Event Timer is a hardware built-in clock source available in most processors. I would use the computer to generate CSPRNG and do cryptographic operations. My question is: Is ...
4
votes
2answers
4k views

Seeding a C# random number generator securely

I'm trying to figure out the best way to securely seed a rng in C#. The class I am currently using is the Random class https://msdn.microsoft.com/en-us/library/system.random(v=vs.110).aspx#Same ...
-1
votes
3answers
393 views

Virus using input from victims mic to generate encryption keys [closed]

I am a software engineer from Bucharest and I've created an audio based encryption and authentication application called WaveCrypt. It basically allows users to encrypt (AES) their files with an ...
2
votes
1answer
1k views

ssh-keygen: How is the seed generated?

How is the seed for ssh-keygen generated? I expect it will take information from /dev/random and request supplementation with system activity if we have insufficient random bits. An Instructor ...
9
votes
2answers
21k views

Ways to generate symmetric and asymmetric keys

We are using Beaglebone Black based custom board, and want to use hybrid encryption for encrypting firmware file, i.e. symmetric for encryption big firmware file and asymmetric for encrypting ...
19
votes
1answer
6k views

What's eating my entropy? Or what does entropy_avail really show?

Below are graphs with the value of /proc/sys/kernel/random/entropy_avail on a Raspberry Pi. This answer which might not be correct describes it as: The pattern always comes to the same "stable" saw ...
3
votes
2answers
1k views

Are password generators secure?

Here's a scenario that I often encounter: Some user needs access to something on my network, but they don't have an existing account in AD. I create an AD account for them which I then use to allow ...
2
votes
1answer
767 views

Choosing Key and IV in AES-256

I am working on a real-life project for a firm. I have to encrypt data using AES 256 as per specification. I want to know how are the key and IV are really chosen in real world projects. /dev/urandom ...
12
votes
3answers
4k views

Is a concatenation of random numbers better than a single random number?

We are generating random numbers 16 digits in length. One option that was put forward was to generate four random numbers of 4 digits each and concatenate them instead of just generating a single 16 ...
1
vote
3answers
2k views

How to generate random but unique tokens for authentication?

I need to create unique and long tokens for email verification, but I am not sure about how. Currently we are on staging servers or we are just using os.urandom() in Django. But I need to know what ...
7
votes
3answers
1k views

How bad it is to feed /dev/random with /dev/urandom?

I have seen many blog posts, or blog comments which recommends to feed /dev/random entropy using output from /dev/urandom. I'm not a crypto expert, but it looks like a good way to replace hard-to-...
0
votes
1answer
586 views

Is `/dev/urandom` secure to generate a salt on a Virtual Machine?

I've read the new password_hash() function from PHP uses /dev/urandom to generate a secure salt, however this assumes some noise from device drivers. Is possible that /dev/urandom is not so random ...
7
votes
6answers
2k views

Should I use a cryptograpically secure random number generator when I generate IDs?

It is common to generate random identifiers to expose through an API instead of using a simple auto incrementing primary key. The reasons are many: Prevents easy enumeration. Does not give away order ...
5
votes
2answers
247 views

How secure are these password schemes?

On One liner to create passwords in linux?, I see advice generally of the form head -c16 /dev/urandom | md5sum. They're all random combinations of text manipulation commands, sha1, base64 and md5sum ...
1
vote
1answer
79 views

Synchronized nonce

If two parties (Say A and B) have a shared secret key (K), is there any way for each party to use the shared secret key to generate nonce(N) sequence which is equal on both sides without having to ...
3
votes
1answer
328 views

Is this good/secure method for client-server communication encryption?

Something came to my mind, and I wonder if this is proper method for client-server communication, and if this method is wide-used. On connection, client generates seed, encrypts it using asymmetric ...
3
votes
1answer
515 views

Should I use random usernames for a MySQL database? [duplicate]

I have a script that accesses a MySQL database - clearly a strong, random password and a username unique to the script with no more privileges than it needs are all sensible norms here. However, is ...
6
votes
1answer
4k views

Simple, Secure PHP API Design

I'm trying to design a secure RESTful API web service with as few moving parts as possible. I have some questions, and want to make sure my design is secure. For the data transmission level of ...
3
votes
2answers
199 views

Are there any security advantages to the “TrueCrypt-Paradigm”?

TrueCrypt and its successors use a file format that has the special property, that it looks completely random, there's only a salt (which is random) and the cipher text (which looks random). I like to ...
3
votes
1answer
290 views

Is SHA1 / PBKDF2-HMAC-SHA1 indissociable from random data?

I want to make sure that the result of PBKDF2-HMAC-SHA1 is indissociable from random data (given random parameters). Basically, PBKDF2-HMAC-SHA1 looks like just a bigger SHA-1 hash, which is normal ...
5
votes
2answers
1k views

Is it possible to crack g++ rand()?

So, I have this: I know that some code was used to generate a random sequence, and it looked roughly like this: #include <iostream> #include <string> int main() { const std::string ...
4
votes
2answers
488 views

How significant are these Dieharder results on a Raspberry pi

I was running the Dieharder test suite on my raspberry pis hardware random number generator, and it came back with this: root@raspberrypi:/home/pi# dieharder -a -g 201 -f /dev/hwrng #=========...
15
votes
3answers
2k views

How long to re-seed /dev/urandom in a virtual machine?

I have read plenty about the distinction between /dev/random and /dev/urandom. I understand that the prevailing advice is to use /dev/urandom. The explanation - that 256 bits of 'proper' randomness ...
4
votes
1answer
332 views

Is there a PRNG in Java with a period of at least 256 bits?

From what I can tell, Sun JRE/JDK's are limited to only providing 128-bit strong cryptography without downloading an unlimited strength jurisdiction policy files. My question is, if I install theses ...
1
vote
1answer
56 views

Best practice for serving sensitive data?

Our invoice vendor serves invoice images via http and does not require any type of authentication. EX: http://example.com/companyid/image.php?id=Lhjjfkedhf_739567395 Using HTTPS would be a good ...
1
vote
1answer
805 views

Is reseeding OpenSSL CSPRNG necessary if using RAND_bytes?

I read that cryprographic secure PRNG (CSPRNG) need a random seed to provide random output. Looking at OpenSSL that seems to be archived by RAND_poll() and random data is fetched with RAND_bytes(buf, ...