I'm trying to hide database auto-incremented ids (1 to PHP_INT_MAX) from the user by encrypting the integer to another integer, making it appear random.
I considered doing an XOR
$mySecretNumber = 123456789;
$idToHide = 10;
$encryptedId = ($idToHide ^ $mySecretNumber);
but (I think) the secret number can easily be figured out.
How can I do this with a more secure method where I can specify a salt/password?
EDIT
To be clear, I need to (seemingly randomly) map an integer in the range 1 to PHP_INT_MAX to another integer in the same range.