Note that for $G : \{0,1\}^s \to \{0,1\}^{n}$ to be a PRG, $n$ must be some polynomial of $s$, so let's rewrite this as $G : \{0,1\}^s \to \{0,1\}^{\ell(s)}$, where $\ell(s)$ is a polynomial.
To disprove the proposition that your $G' : \{0,1\}^s \to \{0,1\}^{2\cdot\ell(s)}$ is a PRG, it suffices to exhibit a probabilistic polynomial time algorithm (over $s$) that, for random $k$, distinguishes $G'(k)$ from a random bitstring drawn from $\{0,1\}^{2\cdot\ell(s)}$ with non-negligible probability. Given a string $x \in \{0,1\}^{2\cdot\ell(s)}$, here's one such algorithm, which runs in time proportional to $2\cdot\ell(s)$:
- Split $x$ in length-$n$ halves $x_1$, $x_2$ such that $x_1 \| x_2 = x$;
- If $x_1 = x_2$, then output
True
; otherwise, output False
.
If $x$ was produced by $G'$, then this algorithm is guaranteed to output True
. If $x$ is random, the probability that it outputs True
is $2^{-\ell(s)}$. The distinguishing advantage is therefore
$$
1 - 2^{-\ell(s)}
$$
which is not a negligible function of $s$. Therefore $G'$ is not a PRG.
In simpler English, the statistical test that checks whether the first half of the input is identical to the second half always succeeds on the output of $G'$.
How likely is it for a random string to be x∥x for any x
. A good PRNG should not give you any information (except the length, in this case) about the output before generation. $\endgroup$ – Aven Desta Feb 15 '20 at 15:57