Avatar CS Knowledge Wiki

Crypto Hashes and Collisions

原文链接:https://www.yuque.com/yangguangfanxing/zuyi8o/pzhssy4kbudfvveb

原文链接:https://www.yuque.com/yangguangfanxing/zuyi8o/pzhssy4kbudfvveb ↗

Different input messages are expected to produce different output hash values (message digest).

Hash Collisions#

A collision means the same hash value for two different inputs. For simple hash functions it is easy to reach a collision. For example, assume a hash function h(text) sums of all character codes in a text. It will produce the same hash value (collision) for texts holding the same letters in different order, i.e. h('abc') <mark> h('cab') </mark> h('bca'). To avoid collisions, cryptographers have designed collision-resistant hash functions.

Cryptographic Hash Functions: No Collisions#

Collisions in the cryptographic hash functions are extremely unlikely to be found, so crypto hashes are considered to almost uniquely identify their corresponding input. Moreover, it is extremely hard to find an input message that hashes to given value.

Cryptographic hash functions are one-way hash functions, which are infeasible to invert. The chance to find a collision (by brute force) for a strong cryptographic hash function (like SHA-256) is extremely little. Let’s define this in more details:

  • Let’s have hash value h=hash(p) for certain strong cryptographic hash function hash.
  • It is expected to be extremely hard to find an input p', such that hash(p')=h.
  • For most modern strong cryptographic hash functions there are no known collisions.

The ideal cryptographic hash function should have the following properties:

  • Deterministic: the same input message should always result in the same hash value.
  • Quick: it should be fast to compute the hash value for any given message.
  • Hard to analyze: a small change to the input message should totally change the output hash value.
  • Irreversible: generating a valid input message from its hash value should be infeasible. This means that there should be no significantly better way than brute force (try all possible input messages).
  • No collisions: it should be extremely hard (or practically impossible) to find two different messages with the same hash.

Modern cryptographic hash functions (like SHA2 and SHA3) match the above properties and are used widely in cryptography.

Knowledge map

知识图谱

当前文档、同目录指南与引用关系。

准备中 全局图谱

正在构建知识图谱...

拖动节点 · 滚动缩放 · 点击打开

帮助与支持

这篇文档有帮助吗?

请给我们反馈以改进文档质量
(点击按钮后会打开邮箱)

帮助改进文档

所有文档均开源,发现问题或不清楚的地方?提交 PR 来帮助改进。

编辑此页面 了解如何贡献 →

需要更多帮助?

加入社区或直接联系获取支持

文件管理器 /
位置 /
内容
Knowledge explorer

知识图谱

全部知识 准备图谱...
文章 文档 标签 分类

正在加载知识网络...

拖动节点 · 滚动缩放 · 单击查看详情 · 双击打开页面
标签云 / Tag Cloud