Say I have a function that calculates a pseudo random permutation and this function is easy to invert.
For example $P(i) = AES_k(i)$ where $k$ is a publicly known key. So anyone can compute $P(i)$ and also get back $i$ if $P(i)$ is known.
Would the following function be hard to invert?
$$F(i) = P(i) \oplus i$$
I am trying to understand why the Salsa20 construction is secure and would like to know if any construction like this will be secure provided that $P(i)$ is a good pseudo random permutation, or if there is more to it.