Tagged Questions

creation of (real or pseudo) random numbers (or bits).

6k views

Is modern encryption needlessly complicated?

RSA, DES, AES, etc. all use (relatively) complicated mathematics to encrypt some message with some key. For each of these methods, there have been several documented vulnerabilities found over the ...
775 views

How does Google's “authenticator number generator” work?

I have two-factor authentication enabled on my Google account, and I have this app on my phone which generates a number I have to type when I'm logging in to Google-Mail. But I don't understand how ...
119 views

How can I generate a brief (100) stream of random numbers, not using the computer or throwing dice? [closed]

I am looking for a method of making random numbers that is off-line and is also independent of specialist equipment like a Geiger counter.
459 views

Extracting only the entropy

(I cleaned up the question a bit, It was previously titled "extracting entropy without hashing" .. thus some of the comments / answers) I'd like to extract the entropy of data without injecting "...
434 views

Relation between key size and PRNG state size

Some (supposedly) cryptographically secure PRNGs have an internal state of only 160 bits or less. When the algorithm is otherwise properly designed, that seems like enough to generate a 128 bit key ...
679 views

Why does Fortuna (RNG) require entropy sources to specify accumulator pool?

Re-reading my copy of Cryptography Engineering for the holidays, I was struck by the following question about the Fortuna RNG: Why require an entropy source specify which pool a random event should ...
282 views

Why are Fortuna entropy pools reset after a reseed?

I've implemented LibTomCrypt's version of fortuna and am wondering about the pool resetting after a reseed. In fortuna.c in libtomcrypt we have the following (which is that part that adds the entropy ...
67 views

What's wrong with this “order-preserving MAC” function?

Please note: this is purely a thought experiment and not intended for any real-world usage! I came up with a simple function $\mathrm{OPF}$ to map the integers $[0,C)$ (where $C$ is the "ChunkSize") ...
703 views

Secure AES Key Generation via Salsa20?

I am not creating my own cryptography or anything, but to learn about the Dos and Donts of cryptography, I am looking into AES encryption and ways to generate keys for that. As far as I've understood,...
246 views

Does changing the random number selected for each message increase security in Schnorr's scheme?

I was reading about Schnorr's scheme and in that for signing the signer generates a random number and continues with his operation. I am trying to implement this in a scenario where the signature ...
281 views

Cryptographically strong pseudo-random seq. generators

If a pseudo-random sequence generator is built so that it uses an n-bit seed and outputs a string that is of length x. Let's say one wants to generate a bit string of length y and uses the previous ...
1k views

LFSR get output from characteristic polynomial?

Say you have a characteristic polynomial of an LFSR: $$f(X) = X^4 + X^3 + 1$$ How can I use this function f to get the output of the LFSR, given some initial state? Obviously I can create the LFSR ...
3k views

Generating Random Primes

Although this has been extensively discussed around here, I'm curious whether my approach makes sense, or I should just stick to "the standard version". I'm implementing some homomorphic encryption ...
343 views

Odds of false error detection in a randomness test using the chi-squared test?

Common Criteria classifies the requirements for true Random Number Generators, and specifies how these should be tested against failures (these can occur accidentally, or following deliberate attack, ...
335 views

Reseeding a PRNG with the generated PRN

Would reseeding a PRNG with the PRN from the previous generation have any effects whatsoever on the quality of the generated numbers; if so, does this depend on the PRNG used, or are the effects ...
293 views

How to generate a random integer in interval $[1, 2^n-1]$ from random integer in interval $[0, 2^n-1]$?

For a project I am working on, I have access to a CSPRNG that outputs a random integer in the interval $[0, 2^n-1]$ for any integer $n$ greater than 0. I cannot use the zero values, so I have my RNG ...
517 views

Unpredictability vs randomness

I'm experimenting with creating an entropy source for an environment where I have no hardware available and the language is very high level (executed in a virtual machine). I know it's not a good idea ...
382 views

Entropy of Androids motion-sensor data

My app on Android uses the built-in motion sensors to collect seed-data for the PRNG (java.security.SecureRandom) that is later to be used for key-generation. The user is told to shake the device so ...
77 views

If $G'(s)=G(s0^{|s|})$ and $G$ is a PRNG, is $G'$ necessarily a PRNG? [closed]

I argue it is because there should be no more correlation between the outputs $G(s0^{|s|})$ than between the outputs $G(s)$. Thus we can say the $G'(s)$ is a PRNG that satisfies $|G'(s)| \geq 4|s|$. ...
143 views

Determine the iteration times using Pollard's rho Method for factoring

Let's say, we have a large number $n=181937053$ and $f(x)=x^2+1$. And also we know that $n=12391 \times 14683$. The problem is that ,using Pollard rho method, can we find the algorithm iteration ...
159 views

Standard or guidance for entropy collection

I need to write some high-level security requirements which include a random number generator suitable for use in cryptography. I don't need something very formal, this isn't a security certification ...
130 views

Would data be secure if a cryptographically secure PRNG was used for encryption?

For example, say you have a client and server. You use asymmetric encryption to securely deliver two seeds from server to client. Each user then seeds two PRNGs (one for incoming data, one for ...
3k views

Would it be secure to use random numbers from random.org in a cryptographic solution?

Random.org provides true random numbers through an unsecured web service. Since these numbers would be transmitted in plaintext could they still be considered useful as true random numbers while ...
1k views

How much entropy is lost via hashing when you add known or low entropy data?

(I updated the title, as I think there was some confusion as to the question) Here's the question: For example, if I have a bit stream that is 64K bytes long and there is about 16 *8 bits worth of ...
381 views

Feedback on rolling my own entropy gatherer

First of all, I don't recommend doing this. This was something I created when I didn't know better and didn't have a solution available to me. Long ago I created my own entropy gather for a ...
566 views

Deterministically combine more than one source of entropy

What is the proper/canonical way to do this? For example, $0 < r1 < 1$ and $0 < r2 < 1$. Presuming uniformly distributed probabilities for the two, combining/averaging them is going to ...
744 views

Initialize a PRNG with a password

Let's assume that we have a secure PRNG. Is it "safe" to initialize it with password, or seed based on a password like SHA256(password)? If yes, is it "safe" to generate an RSA or DSA key from it? ...
341 views

Breaking a PRNG Scheme

Assume the following scheme for a PRNG generating decimals in [0,100) Given a message and a key, compute tag := HMAC512(message, key). Take the first 5 hexadecimal characters of the tag. If the ...
408 views

Predicting Java's PRNG using partial output

I have a program (a game) that uses Java's nextInt function with parameter 0x10000 to get a random 16-bit number. Java's ...
7k views

How can i predict the next number of a long sequence of seemingly random numbers? [closed]

How can I accurately predict the next random number between 1 and 999, given past results. I have no knowledge of the PRNG or algorithm used. How can I predict the next number of a long sequence of ...
268 views

Oracle DBMS_RANDOM algorithm?

Oracle DBMS offer builtin random number generator (pseudo to be accurate). DBMS_RANDOM is one of the available packages, it is however considered as insecure for cryptography. Do we happen to know the ...
233 views

Trustless, Multiparty Random Number Generation

I've been having trouble with coming up with a random number generator that produces a random number between two parties. My current scheme is this: User 1 gives user 2 the hash of their randomly ...
1k views

Can a LFSR be cryptographically secure?

I have been looking at an embedded microcontroller which has a cryptographic hardware engine (in particular the PIC32MZ family). These devices have what they advertise as a cryptographically secure ...
467 views

Random Number Generation with a Entropy pool versus Seed

To give a little background I'm currently implementing a crypto library in JavaScript. I have started porting across Linux's random number generator because its both publicly scrutinized, it is open-...
2k views

Good entropy source for generating openssl keys

I need to generate a CA (4096-bit RSA) and server keys for openvpn and I want them to be "top quality". Here is my plan: gather entropy from multiple sources (saving individual files): FreeBSD ...
227 views

How does a backdoor in the RNG enable an attacker to break encryption protocols?

I'm wondering how a backdoor in a random-number generator (as rumored the NSA have placed), actually compromises the security of things like VPNs or TSL/SSL. What I understand is that, if such a ...
812 views

How random are commercial TRNGS

I'm thinking about buying a USB TRNG. How do I evaluate its randomness? I'm sure some are better than others but which is which? Are thermal-noise better than radio-noise TRNGs?
196 views

How is a PRNG used in the PGP?

I'm currently reading up on the components of PGP and I am wondering what exactly the PRNG is used for. PGP uses ANSI X9.17 and entropy from a users keystrokes to generate a temporary key. So, is ...
112 views

$\phi$ function in Dual_EC_DRBG

I am trying to understand the operation of the Dual_EC_DRBG. I'm reading the formal specification (SP 800-90) and can't seem to find a definition of the $\phi$ function used throughout the definition ...
318 views

Why can we always assume that $Gen$ algorithm choose key uniformly?

Talking about a (symmetric) encryption scheme $\Pi=(Gen,Enc,Dec)$ where $Gen$ take the security parameter $n$ as input and generates a key $k$ of length $n$. Generally speaking we say that $Gen$ ...
27k views

Explaining weakness of Dual EC DRBG to wider audience?

I have an audience of senior (non-technical) executives and senior technical people who are taking the backdoor in Dual_EC_DRBG and considering it as a weakness of Elliptic curves in general. I can ...
469 views

In Elgamal, the generator g is always quadratic non-residue modulo p where p is a safe prime and inverse of g can be also generator?

In Elgamal, the generator $g$ is always quadratic non-residue modulo $p$, where $p$ is a safe prime and the inverse of $g$ can also be generator? Can I prove it? I can't come up with it at all.
4k views

Using a Hash as a secure PRNG

I was just looking at some NIST PRNG recommendations, specifically at Hash_DRBG. I read briefly through the algorithm, and even though it is not overly complex, it still seems unnecessary to me. I ...
1k views

Are there any Javascript CSPRNGs? [closed]

I'm writing some software that requires the use of a CSPRNG with javascript for use in the browser and I'm wondering what libraries are available. Crypto-js doesn't seem to have a CSPRNG I can ...
400 views

Endless PRNG from PRNG with specific stretch?

Every definition of pseudorandom generator that I've seen says it takes n-bit strings and gives poly(n)-bit strings. Is there a proof that if there is such a pseudorandom generator then there is a ...
765 views

Using an RSA private key simultanously as an AES encryption key to generate random numbers?

Currently I'm implementing a PRNG for an embedded system. Using the RFC 4086 I've decided to use the X9.17 - to be more specific the successor X9.31- standard to implement my PRNG. X9.17 uses DES, but ...
1k views

Why is sharing the seed and using SecureRandom “deterministically” so bad?

I've recently been reading an article about "using cryptography to store credentials", and I would love it someone explained this in more detail… Up until Android 4.1, Android used a SecureRandom ...
I was studying Crypto, and this question came up. Using a PRG like the multiplicative congruence generator: $b_{i+1} = a \cdot b_i \mod m$ How do I prove that the output of this PRG, or any PRG's ...