Symmetric Bijective Algorithm for Integers

Use any 32-bit block cipher! By definition, a block cipher maps every possible input value in its range to a unique output value, in a reversible fashion, and by design, it’s difficult to determine what any given value will map to without the key. Simply pick a key, keep it secret if security or obscurity is important, and use the cipher as your transformation.

For an extension of this idea to non-power-of-2 ranges, see my post on Secure Permutations with Block Ciphers.

Addressing your specific concerns:

  1. The algorithm is indeed symmetric. I’m not sure what you mean by “reverse the operation without a keypair”. If you don’t want to use a key, hardcode a randomly generated one and consider it part of the algorithm.
  2. Yup – by definition, a block cipher is bijective.
  3. Yup. It wouldn’t be a good cipher if that were not the case.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)