コンテンツへスキップ
uencoder

CRC32 を使う方法

CRC32 チェックサムを計算し、高速な非暗号学的な整合性チェックを行います。

问题

セキュリティ上の改ざんではなく、偶発的なデータ破損を検出するための高速なチェックサムが必要です。

前提条件

  • チェックサムと暗号学的ハッシュの違いの理解
  • 16 進出力への習熟

ステップ

  1. 1. Understand CRC32's purpose

    CRC32 is a cyclic redundancy check that detects accidental changes to raw data. It produces a 32-bit (8 hex character) output. It is extremely fast but not collision-resistant against intentional attacks. Use it for error detection, not security.

    入力
    Hello
    输出
    F7D18982
  2. 2. Compute the CRC32

    Feed the data into a CRC32 calculator. The algorithm uses polynomial division over GF(2) to produce the checksum. The same input always yields the same output. It is commonly used in ZIP files, PNG chunks, and network protocols.

    入力
    Hello, World!
    输出
    E4F2D2A2
  3. 3. Verify integrity

    Compare the computed CRC32 with the stored value. If they match, the data is likely intact (CRC32 detects most accidental errors). If they differ, the data is corrupted. Do not use CRC32 to detect intentional tampering, as collisions are trivial to construct.

    入力
    computed == stored?
    输出
    MATCH or MISMATCH

期待される結果

偶発的な破損の検出には適するが、意図的な改ざんの検出には適さない、高速な 32 ビットチェックサム。

よくあるエラー

Using CRC32 for security
CRC32 is not cryptographically secure. Collisions can be found instantly. Use SHA-256 for tamper detection.
Different CRC32 values for the same data
There are several CRC32 variants (ISO-HDLC, Castagnoli, Koopman). Ensure both sides use the same polynomial.

トラブルシューティング指引

  • If CRC32 values differ across tools, check which polynomial variant each uses.
  • For ZIP files, the CRC32 is stored in the file header for integrity verification.

セキュリティ上の制限

  • CRC32 is NOT a cryptographic hash. It must not be used for authentication, signatures, or tamper detection.
  • All computation is local.

関連ツール

関連用語

参考链接