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

learn more… | top users | synonyms (1)

9
votes
1answer
492 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 ...
12
votes
3answers
3k 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
2answers
710 views

Can I rely on openssl_random_pseudo_bytes() being very random in PHP?

I came across an application which needs to generate a random token for each user. It is very important that each generated token is unique. Application code was as follows: $token = ...
14
votes
4answers
2k 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 ...
27
votes
11answers
6k views

One liner to create passwords in linux?

How do you create a readable password using bash with one line? What if i'm looking for 128 bits of entropy? EDIT By readable I mean the 94 printable ascii characters (without space). It can use ...
1
vote
3answers
259 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 ...
5
votes
1answer
88 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 ...
4
votes
1answer
249 views

OpenSSL 0.9.6a PRNG algorithm weakness: How to exploit?

I saw an OpenSSL security advisory for Openssl 0.9.6a Recently a cryptographic flaw in OpenSSL's built-in pseudo-random number generator (PRNG) was pointed out to us by Markku-Juhani O. Saarinen ...
0
votes
1answer
77 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
117 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 ...
4
votes
2answers
203 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
25 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
58 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
53 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 ...
5
votes
1answer
99 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 ...
2
votes
2answers
107 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
2answers
102 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 ...
3
votes
1answer
62 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 ...
3
votes
2answers
86 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 ...
11
votes
1answer
178 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 ...
18
votes
3answers
2k views

Flaw in encryption through pseudorandom number stream (from PGP documentation)

I was reading PGP docs and came upon a part written by Phil Zimmermann (PGP's creator) that piqued my curiosity: When I was in college in the early 70s, I devised what I believed was a brilliant ...
1
vote
1answer
46 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 ...
4
votes
1answer
50 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
51 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, ...
3
votes
1answer
102 views

Is Jericho Comms TRNG reliable?

I'm looking for a method to generate true random bits/numbers on smartphones. Create a custom TRNG seems to be tricky and a lot of people suggest to trust in already existing ones, widely tested and ...
0
votes
1answer
28 views

Creating secure random output that is repeatable across machines [duplicate]

I'm having trouble figuring out a solution to this problem. Basically what i am trying to do is create random data that can be repeated across multiple machines by a user but is also secure from ...
2
votes
2answers
68 views

Securely generate a rng seed using a small number

I'm trying to figure out a secure method to generate a rng seed to a rng using a small pin number that is 5 digits. The issue that i can see with this is an attacker could very easily just loop ...
44
votes
6answers
8k views

Are random URLs a safe way to protect profile photos?

I would like to move from sequential to random user IDs, so I can host profile photos publicly, i.e. example.com/profilepics/asdf-1234-zxcv-7890.jpg. How long must user IDs be to keep anyone from ...
16
votes
5answers
5k views

Java SecureRandom doesn't block? How?

I know from experience that reading from /dev/random blocks when the Linux kernel entropy pool runs out of entropy. Also, I've seen many articles and blog entries stating that when running on Linux, ...
0
votes
3answers
105 views

Access Key In URL - Securing The Unsecured!

I'm having some difficulties doing this the right way (as much as it can go). Some time ago, I've asked a question here, asking for help on how to implement sending an access link through email. ...
0
votes
1answer
68 views

Which ciphers produce random cipher text?

I already know AES produces a "random" output. 5e4e6440826d6afc4535fbf078455f791159701a9df624ddd4e4dda84523b6a7 Its cipher-text doesn't follow a pattern and is indistinguishable from noise. Is ...
3
votes
2answers
65 views

Is there any practical weakness to using MT19937 to generate passphrases?

Suppose I use MT19937 to choose random words out of (say) the Diceware word list. I know MT19937 is not considered a cryptographically secure PRNG, but Wikipedia suggests the weakness is rather ...
1
vote
1answer
73 views

What is the purpose of including time as a part of random in TLS Client & Server Hello messages? [duplicate]

RFC 5246 Section 7.4.1.2 states that the 32 bytes of random required in the Client and Server Hello messages should be 4 bytes of time and 28 bytes of random. Why can't it be 32 bytes of random? ...
5
votes
1answer
110 views

Random string vs hash(random string)?

I'm implementing a one-time token service. Each of these one-time token represents some server side data/action associated with it (a 'email confirm' action for example), so that my web service can ...
38
votes
9answers
27k views

Feeding /dev/random entropy pool?

Which way of additionally feeding /dev/random entropy pool would you suggest for producing random passwords? Or, is there maybe a better way to locally create fully random passwords?
3
votes
1answer
96 views

What are the problems of using OTP encryption with TRNG?

I've programmed a simple One-Time Pad "encryptor" that can merge two files into one by using bitwise XOR. The pseudo-random key files are generated by using the CryptGenRandom() function from ...
5
votes
1answer
224 views

Is keepass random password generator fully secure and trustworthy?

Am I safe using keepass for generating passwords? For example my accounts, am I safe using a keepass generated password? Could my future keepass master-keys be safely generated in keepass? What method ...
14
votes
3answers
16k 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 ...
1
vote
1answer
4k views

Generating a TRULY random string in PHP [duplicate]

I need to generate thousands (possibly millions) of unique codes for a client. These codes may have a monetary value, so it's vital that they are TRULY random, and that no pattern could be spotted and ...
1
vote
0answers
55 views

Token-based authentication for specific requirement

We have the following requirement for creating a token in .NET to be used in providing a challenge token and an actual authentication (auth) token. The auth token will then be used to authenticated ...
5
votes
1answer
113 views

Resetting the Windows RNG

According to this research, Windows seems to produce the same sequence of random numbers indefinitely when a process is kicked off before a VM snapshot is taken. This is a huge issue obviously when ...
2
votes
2answers
51 views

Securing a Secure Entropy Service

Many moons ago, I answered a question about Java blocking due to a lack of entropy in /dev/random. (http://security.stackexchange.com/a/53025/41709) My main suggestion was to use /dev/urandom, but I ...
3
votes
0answers
81 views

Is there a benefit in measuring randomness? How would it be done?

Is there any benefit in determining how random a given file, stream, signal is? I guess this would be useful to determine If something is (poorly) encrypted To verify the proper encryption of a ...
2
votes
1answer
2k 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 ...
5
votes
2answers
82 views

Two ways of generating the IV

I'm looking at some code, and in a particular scenario, the code would need to generate two IVs. The second IV-generating code simply uses the C# Rijndael GenerateIV() The first IV-generating code ...
3
votes
1answer
81 views

Skewed Randomness

According to random.org, Any source of true randomness may contain skew towards 0 or 1 in the data I am a bit confused about what this exactly means and why this "skew" is present in all "true ...
3
votes
1answer
88 views

Defeating ROP attacks in x86

Most defense techniques against ROP revolves around randomization, such as ASLR. If I mark all regions of memory, other than the code segment, non-executable, will this defeat ROP?
2
votes
0answers
48 views

TRNG from smartphone accelerometer

I hope this is not a stupid question :/ but I'm trying to generate a true random number from smartphone's accelerometer, than pass it as seed to a CSPRNG to generate true random numbers. I know that a ...
4
votes
2answers
193 views

Does adding a random character to a pseudo-randomly generated password improve entropy significantly?

I'm asking a practical question. I was taught computers are bad at generating random data. Does this mean password generators, such as the one built into Keepass, suck? If yes, then would it help for ...
3
votes
1answer
2k views

Correct way to generate password salts in PHP 5.3 on Linux given my constraints?

In examining our database storage of hashed passwords with salts, I note a high rate of salt collisions, i.e., there are far too many cases where two table rows have the same salt stored. One ...