I have a database id that start from 1 to … and I need encrypt this number to use for pursuit number.
how to generate numeric string by encrypting the database id and decrypt it?
pursuit number must be short as possible.
I have a database id that start from 1 to … and I need
Share
How secure do you need this encryption to be? A simple XOR with another int might be what you need, though you might have to be careful with sign bits.
Alternatively, if you want something more secure, just implement a simple 32 bit Feistel cypher. Here’s one I prepared earlier: