Simple integer encryption

后端 未结 9 1465
南方客
南方客 2020-12-03 06:24

Is there a simple algorithm to encrypt integers? That is, a function E(i,k) that accepts an n-bit integer and a key (of any type) and produces another, unrelated n-bit integ

9条回答
  •  借酒劲吻你
    2020-12-03 06:50

    I wrote an article some time ago about how to generate a 'cryptographically secure permutation' from a block cipher, which sounds like what you want. It covers using folding to reduce the size of a block cipher, and a trick for dealing with non-power-of-2 ranges.

提交回复
热议问题