同じCRC64値を生成する可能性がある2ブロックのデータがどのくらいありますか。

StackOverflow https://stackoverflow.com/questions/6025445

  •  14-11-2019
  •  | 
  •  

質問

データの整合性を確保するためにCRC64値を使用するキャッシングアプリケーションを持っています。 余分なフィールドを置くことを考えています、データを渡すタイムスタンプ さまざまなキャッシュサーバーの間に、データが変更されたかどうかを確認するために比較されます。

しかしながら、これにはプロトコルの変更が必要です。それが莫大な取引ではありませんが、私はすでに持っています 何かが変わった指標として使用することができるCRC64。

誰もが同じCRC64を生産する2ブロックのデータを中心とした統計を知っていますか?そうでなければ、どうやってそれを計算するか、それを見積もることができますか?

役に立ちましたか?

解決

If you assume that crc64 is 'perfect', then the numbers are pretty reasonable:

For a 1% probability of collision, you need 6.1 × 10^8 entries. For a 50% probability of collision, you need 5.1 × 10^9 entries.

Of course, if the data is potentially supplied by malicious sources, then collisions in a hash as simple as crc64 can be generated easily, and collisions could be rampant. So whether or not you go this route depends on the source of input data and the potential ramifications of collisions.

他のヒント

The probability of any two given blocks colliding is 1/264, or 1 in about 1.8 × 1019.

However, the probability rapidly becomes more likely if you are interested in the rate of collision out of any two blocks from a population of size N.

For more information, see Birthday Problem on Wikipedia, which has formulas and approximations.

The probability of two CRC64s over different random data being identical would be something close to 1 chance in 2** 64. But since CRCs are somewhat sensitive to data patterns, there could be degenerate cases where you'd lose several binary orders of protection. It's probably not possible to come up with a hard number, but you'd likely be safe in assuming the worst case chance of collision would be less than 1 chance in 2** 50 or so.

You'd be assured of getting closer to the theoretical limit if you used a cryptographic hash instead of a CRC64, but the crypto hash is generally much more expensive to compute.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top