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

learn more… | top users | synonyms

-2
votes
2answers
43 views

2 way encryption of a string into numerical string using random number

I have a random number like 0.323978544752212. I want to encrypt a string using this random number into to numerical string i.e. final string is like ...
23
votes
11answers
4k 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
0answers
52 views

How to use Intel Ivy Bridge's RNG? [migrated]

I read that Intel Ivy Bridge processors provide a RNG (RdRand). But how do I use this? My CPU E3-1270v2 does not provide a RNG flag. flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr ...
-1
votes
0answers
38 views

How to determine possible encryption type of a given data [duplicate]

I have a encrypted data which consist of 2 numbers: A random number of form 0.110134486415522 This number is always less than 1 and is generated at start of every session encrypted numerical ...
2
votes
1answer
126 views

Why is using [x] to generate random keypairs a bad idea?

Anyone who has generated large GPG public/private keypairs has come across this annoying message: "Not enough random bytes available. Please do some other work to give the OS a chance to collect more ...
2
votes
4answers
67 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 ...
3
votes
2answers
213 views

Can the human brain generate cryptographically secure random numbers?

A security conscious friend of mine was attempting to generate entropy using random dice rolls to generate a random password, and I became curious about the security of random number generators and ...
1
vote
2answers
76 views

Do DES keys have to be random?

In stream cipher (namely the OTP ) . The pad which the plain text is Xored with has to be random to achieve perfect secrecy , or psudorandom to ensure semantic security Dose this apply to DES or ...
4
votes
2answers
114 views

How does an insecure RNG affect cryptography, and how do I measure the corresponding loss of security?

Suppose a given random number generator has poor entropy, and is compressible by any compression algorithm (zlib, bzip2, lzma, etc). Specifically the issues with this RNG are: Bad entropy Bad seed ...
0
votes
2answers
67 views

Is there something similar to pseudorandom generators but in the opposite direction?

Pseudorandom generators (PRG) are functions that takes a random small input (called the Seed) and maps it into much larger output . However, the mapping process must be unpredictable in order for the ...
2
votes
1answer
49 views

Usefulness of bcrypt(UUIDv4())

One of my colleagues is working on securing OAuth 2 client IDs and secrets for our OAuth server and he has come up with this scheme where he would not only use UUID v4 to generate random values, but ...
0
votes
0answers
38 views

Steps for creating a test environment where GUIDs are exploitable?

I have been using GUIDs as un-guessable tokens in various situations for some time. I came across this question/answer which seems to suggest that while this is ok in some situations, it should not ...
4
votes
3answers
229 views

Would it be secure to generate random number using AES?

I know that there are already tools out there to generate cryptographic random number, but I was wondering if using AES could do the same. For example, I have a secret key for AES on my server and a ...
0
votes
2answers
122 views

How to generate an unpredictable but short string? [closed]

I want to built some short urls for uploaded files and links on my own server. Simple enough, I upload files and my script returns me a link. On access, the link is translated to the file and download ...
2
votes
1answer
125 views

What cryptosystem makes the encrypted text look like random noise?

Suppose one wants to setup a cryptographic protocol in which 2 parties communicate using an encryption scheme that produces encrypted messages indistinguishable from random data (the desired property) ...
3
votes
2answers
100 views

Reliable random seed for RNG

I want to create my computer passwords with a RNG, but I am thinking about one thing: I would use python to write that script and the RNG is controlled by one seed, most likely the time. If I would ...
33
votes
6answers
6k 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 ...
2
votes
1answer
63 views

Does RAND_add(&Time,sizeof(Time),0) at each ssl connect reduce randomness or not?

Reviewing openssl 1.0.1g s23_clnt.c code i see that : int ssl23_connect(SSL *s) { BUF_MEM *buf=NULL; unsigned long Time=(unsigned long)time(NULL); void (*cb)(const SSL *ssl,int ...
2
votes
1answer
143 views

How secure is Vigenere cipher for random data?

Traditional situation It is easy to crack a ciphertext encrypted by Vigenere cipher, if you know the plaintext is in a natural language like English. There are two methods to discover the key used to ...
3
votes
2answers
160 views

MySQL ENCRYPT salt is not random?

I know there's little reason to still use ENCRYPT() nowadays, what with bcrypt being almost ubiquitous and MySQL providing better hashes such as SHA1. But while dabbling with ENCRYPT() on MySQL ...
2
votes
3answers
550 views

Hashing speed with true random passwords

Just a theoretical question: If I had ideal users, who all provide fully random 128-bit passwords, And also, I invalidate every password shorter than 128 bits. Then would I still need a slow hash ...
1
vote
1answer
140 views

SSL Handshake random number?

I realized all of the phase of the handshake but I do not understand how it does that from the two randomly generated numbers are unable to generate a session key that the client and the server uses ...
2
votes
1answer
123 views

Is the following code seeding OpenSSL's PRNG necessary, superfluous, or harmful?

As I was going through Crypt::SSLeay, preparing it for the next release, I noticed the following code, written way before my time, ... int rand_bytes_read; static int bNotFirstTime; char buf[ 1024 ...
3
votes
2answers
104 views

How can you detect an insecure, non-random token?

I know that some of PHP's random functions are insecure due to them not being completely random and are considered a bad practice. My question is how an attacker go about finding that the developer ...
2
votes
1answer
193 views

-bash: -sudo: command not found [closed]

Some dependencies were missing when I installed THC Hydra. I found this site which directs me to install the missing package: sudo apt-get install libsvn-dev libapr1-dev libaprutil1-dev But when I ...
2
votes
1answer
56 views

Are the problems with Window's CSPRNG still an issue on modern Windows?

The paper Cryptanalysis of the Random Number Generator of the Windows Operating System describes some problematic aspects of the Windows CSPRNG. However the paper was written in 2007, and looked at ...
3
votes
2answers
141 views

What does the “period” of a random number generator measure?

What is "period" in the context of pseudo-random number generators? For example when someone says "The Mersenne Twister has a 2^19337−1 period" what does it mean? I would appreciate a simple as ...
2
votes
1answer
167 views

Should generating gpg keys ever result in an identical key to an older key?

I recently had a situation where I lost an old private key (write error; realized this too late). In regenerating keys and replacing the public keys on various sites, I noticed that the public keys ...
0
votes
1answer
101 views

is this code valid for securing passwords? [duplicate]

i was wondering if this is a secure method for a hashing password.if it is not secure please tell me what to do in order to make it secure $pass='test'//the password ...
2
votes
1answer
26 views

bin_random_table and RANDOM_BOOT_ID

The Linux kernel has a few sysctrl's related to random devices packaged in a bin_random_table (http://lxr.free-electrons.com/source/kernel/sysctl_binary.c?v=3.2): static const struct bin_table ...
19
votes
3answers
713 views

Does (online) poker require cryptographically secure randomness?

Here’s a quote from a reddit discussion: … for poker [a cryptographically secure RNG] is completely unnecessary. If you have an appropriate unpredictable seed, and you are throwing away a lot of ...
1
vote
1answer
934 views

How securely random is Oracle's java.security.SecureRandom

There was a lot of news in the past year about exploitable weaknesses in cryptography which originated from weak random number generators. In some cases it was negligence on side of the developers, in ...
12
votes
4answers
4k 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 ...
6
votes
7answers
2k views

Testing a hardware random number generator

The Raspberry Pi has a built in hardware random number generator but there doesn't appear to be any public documentation on the hardware, and even if there were it would be questionable (what company ...
5
votes
1answer
205 views

Can the xor of two RNG outputs ever be less secure than one of them?

Suppose I'm suspicious that one or more (pseudo)-random number generators is cryptographically flawed, perhaps even deliberately backdoored. The RNGs in this case might be either PRNG algorithms, ...
5
votes
2answers
141 views

Benefit to using PBKDF2 on key generated by RNGCryptoServiceProvider?

I have a program that generates a fixed-length 32 byte (256-bit) password using RNGCryptoService provider and then uses Rfc2898DeriveBytes on that password to arrive at an encryption key. However, to ...
14
votes
3answers
543 views

Why CSRF Token has to be a Cryptographically Strong Random number, in Double Submit Cookies method?

I was just going through the OWASP's Cheat Sheet for CSRF Prevention. In the Double Submit Cookies method, I saw this the site should generate a (cryptographically strong) pseudorandom value ...
0
votes
1answer
288 views

Can SHA-1 PRNG still create secure cipher keys?

I am concerned that a SHA-1 PRNG cannot produce an AES-256 cipher key with the expected 256 bits of security, or indeed any secure cipher key where over 165 bits of security are expected. The SHA-1 ...
0
votes
1answer
2k 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 ...
3
votes
3answers
359 views

If the code to shuffle an array is known, is it possible for the randomized shuffle to stay secure?

I recently was looking at Poker shuffles that were hacked and made to be guessable within a reasonable degree and this was because of the weakness of the shuffles. Is it possible to make a shuffle ...
2
votes
2answers
520 views

How to generate cryptographically strong pseudorandom data very rapidly?

What's the best way to go about generating a fast stream of cryptographically strong pseudorandom data without installing uncommon packages? Drawing from /dev/urandom is far too slow. I had an idea ...
2
votes
2answers
176 views

Reducing crypto-random values to a useless entropy

Supposing I have generated random data from CryptGenRandom (or similar PRNG), at what point does futzing with the values make it not-so-random that it's useless? Or is sufficiently random in enough to ...
3
votes
4answers
472 views

What are the features of Dual EC DRBG that are lost when using a different cipher?

Due to a potential NSA backdoor, the NIST is now recommending that implementor no longer use ECC-based PRNG Dual EC DRBG. (As described in Wired.com) this PRNG has certain features such as: ...
0
votes
1answer
139 views

Can the random keys generated during handshake be guessed

During the handshaking of an SSL connection, the server sends its public key, the client generates a random password, encrypts it with the pk, and sends it back, then the server decrypts it and all is ...
27
votes
4answers
2k views

Is generating random numbers using a smartphone camera a good idea?

Forgive my ignorance on the subject, but I wish to know more and asking (stupid) questions are one way. I was reading http://www.random.org/randomness/ and this idea popped into my head (before the ...
9
votes
2answers
998 views

How does a weakness in a random number generator lead to a compromise of the entire cryptographic process?

In the news, there are several articles (here, here, and the technical point of view) which have to do with a weakness in a random number generator. The question is somewhat twofold. What symptoms do ...
1
vote
2answers
184 views

How many bytes should an authorization token have? [duplicate]

Assuming I generate random bytes with a secure PRNG, how many bytes do I need to make authorization tokens secure? Specifically, when users log in to a website, a token will be generated and stored ...
10
votes
2answers
2k 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, ...
3
votes
2answers
426 views

Is mt_rand() suitable for generating a salt?

Assumed I have to following code in order to generate a random blowfish salt for saving a new password: $blowfishCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./'; $salt ...
12
votes
2answers
573 views

Correct way to get a number from 0-9 from a random byte?

If I have a good random number generator that gives me a byte of data at a time, and I want to extract a random decimal digit of 0 to 9 from that byte stream, what is the correct way to do that? At ...