I'm looking for a function or set of functions that can produce a pseudo-random permutation on an input set of arbitrary size.
Given a set of $M$ values in range $0..M-1$, where $M$ is positive integer, I need a function $I' = F(K,M,I)$, where $I$ is a value in range $0..M-1$, $K$ a key (to be determined) and $I'$ a value in range $0..M-1$. For each value $I$, there must be only one $I'$ value, and for each $I'$ value, only one $I$ value.
Having the reverse function $I = F'(K,M,I')$ is not strictly needed, but it seems implied by requirement.
So this look like an encryption function.
If $M$ was $2^{128}$ or $2^{256}$, I could use a block cipher. If $M$ was a multiple of $256$, I could use a stream cipher (byte oriented). But $M$ could be any value, without any special properties: it's not required to be odd, even, prime, power of two,...
I'm not aware of such encryption or hash function. Could you help me to formalize my need and give me some hint to find an encryption/hash scheme that suit my needs?
I've found what I seems to be looking for is Format Preserving Encryption (FPE), but I need some help to sort this out.
EDIT: In order to be strong, I think it's important the function should not be self-inverse, eg. given $I' = F(K,M,I)$, $F(K,M,I')$ should not return $I$.