Let $G:\{0,1\}^n \leftarrow \{0,1\}^{2n}$ be a PRG. Establish whether the following PRG candidates $$G^{'},G^{''}:\{0,1\}^n \leftarrow \{0,1\}^{3n}$$ are secure or not:
- $G^{'}(s)=(x⊕y,u,v)$ where $(x,y)=G(s)$ and $(u,v)=G(y)$;
- $G^{''}(s)=(x,y ⊕ u,v)$ where $(x,y)=G(s)$ and $(u,v)=G(y)$;
This was in my exam today and I thought the following argument: Suppose $s$ random in $\{0,1\}^n$ then $(x,y)=G(s)$ is random in $\{0,1\}^{2n}$ since $G$ is a PRG. In particular $y$ is random in $\{0,1\}^n$ so $(u,v)=G(y)$ is random in $\{0,1\}^{2n}$ since $G$ is a PRG. Hence, as XOR preserves randomness, $x⊕y$ and $y ⊕ u$ are random too.
Finally both $(x⊕y,u,v)$ and $(x⊕y,u,v)$ are random in $\{0,1\}^{3n}$ and this proofs that $G^{'}$ and $G^{''}$ are both secure PRG.
Now I'm thinking that maybe this argument is wrong because i can't assume that $(x,y)$ random in $\{0,1\}^{2n}$ implies $y$ random in $\{0,1\}^n$.
Maybe I’m just confusing myself. Can you help me?