Simple integer encryption

后端 未结 9 1456
南方客
南方客 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 07:05

    Would not this amount to a Block Cipher of block size = 32 bits ?

    Not very popular, because it's easy to break. But theorically feasible. Here is one implementation in Perl : http://metacpan.org/pod/Crypt::Skip32

    UPDATE: See also Format preserving encryption

    UPDATE 2: RC5 supports 32-64-128 bits for its block size

提交回复
热议问题