What is in Java a cipher function for integer encryption having these properties?:
If you don't need a secure solution, but just fast one, consider the XOR cipher:
int key = ... .... int b = a ^ key; int c = b ^ key; assert (c == a);