Want to preface this by saying this is not by any means a secure system, and the goal is obfuscation while being reversible. To start we have auto-incremented ID #s from 1-70000. The plan is to have a user enter this number on a phone system (so having the output number be small is important), but also have it not be apparent that the numbers are in any way sequential. The highest the ID #s will ever be will be 6 digits, so we were considering having each of these 'map' to an 7 digit number.
Was hoping to make it so that the output would look something like this:
1 -> 3041953
2 -> 1949921
3 -> 8541230
(in other words, the output in no way appears to be sequential)
We cannot directly 'map' these existing numbers in any sort of database (as a) the information is spread all over the place, and b) the places that 'input' these numbers are all over the place as well, so no singular code could be implemented upon insert).
It has to be a number, it has to be easily reversible, and it has to be consistent length output as well.
Will be using PHP to generate to back and forth between the input and output. I've tried just basic math on the number (but can't get that to seem 'random'). Closest I've gotten was to do some multiplication operations, and then perform an XOR with a number of the size I need. However, that still results in sequential seeming numbers.
$xor= 8593473;
$originalID = rand(1,70000);
$result = ($originalID * 37) ^ $xor;