Simple integer encryption

后端 未结 9 1424
南方客
南方客 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:52

    Ayden is an algorithm that I developed. It is compact, fast and looks very secure. It is currently available for 32 and 64 bit integers. It is on public domain and you can get it from http://github.com/msotoodeh/integer-encoder.

    0 讨论(0)
  • 2020-12-03 07:01

    XOR it with /dev/random

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题