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

learn more… | top users | synonyms (1)

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
3answers
256 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 ...
0
votes
1answer
75 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
200 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
57 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
98 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
1answer
61 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
85 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 ...
3
votes
2answers
100 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 ...
11
votes
1answer
175 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
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
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 ...
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, ...
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 ...
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
67 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
71 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 ...
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
219 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 ...
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 ...
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
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 ...
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 ...
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 ...
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
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?
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 ...
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 ...
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 ...
1
vote
2answers
695 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 = ...
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 ...
-4
votes
1answer
106 views

Hacking bad people to help a good cause [closed]

I want to hire a hacker to get emails by and between 2 people I think are participating in something unethical. It is very important that I not break any laws. A review of this site makes it appear ...
2
votes
2answers
114 views

Is a random work factor an increase or decrease of security?

Assume you use a proven hashing algorithm, like bcrypt with a work factor of 10 or PBKDF2 with 10K iterations. Normally that's really secure already and would give enough security already for most ...
0
votes
1answer
102 views

A “hardware” random number generator for mobile phone

I have been trying to write a random number generator using the hardware of the phone. After reading other people's attempts and tried some. I came up with the following to generate the seed: Play ...
4
votes
1answer
110 views

Is encrypted data a good random source?

Given that someone needs my encryption key to predict the output, can I encrypt arbitrary data (zeroes, system logs, personal photos) with AES and a secure passphrase, and use the result as a ...
2
votes
2answers
99 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 ...
6
votes
3answers
332 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 ...
0
votes
1answer
65 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 ...
1
vote
2answers
380 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 ...
9
votes
1answer
287 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 ...
6
votes
2answers
366 views

How much entropy is good enough for seeding a CSPRNG?

I have some fundamental questions on using Cryptographically Secure Pseudorandom Number Generators (CSPRNGs). What should be the size of the seed that I initialize a CSPRNG with? How often should I ...