algorithm - 没有扩散属性的散列函数/校验和是否存在?

标签 algorithm hash

来自维基百科:

Diffusion means that if we change a single bit of the plaintext, then (statistically) half of the bits in the ciphertext should change, and similarly, if we change one bit of the ciphertext, then approximately one half of the plaintext bits should change.[2] Since a bit can have only two states, when they are all re-evaluated and changed from one seemingly random position to another, half of the bits will have changed state.

例如,改变一个文件的一位,文件的MD5校验和就变得完全不同。

有没有不具有扩散特性的哈希函数/校验和?理想情况下,如果 20% 的明文发生变化,那么 20% 的密文应该发生变化,如果 80% 的明文发生变化,那么 80% 的密文应该发生变化。这样,可以通过密文跟踪明文的百分比变化。

最佳答案

我认为与您寻找的最接近的东西是“局部敏感散列”,它试图将相似的输入映射到相似的输出:https://en.wikipedia.org/wiki/Locality-sensitive_hashing

散列的变化量与输入的变化量并不真正成正比,但也许它会满足您的需求。

关于algorithm - 没有扩散属性的散列函数/校验和是否存在?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57318186/

相关文章:

c++ - 多个凸形角连接

.net - 为什么 Dictionary.First() 这么慢?

r - 通过键向量(R)获得值

ios - 从 Objective-C 对象生成 MD5 哈希

php - 如何设计顺序哈希类函数

C:使用散列函数将字符串写入(然后读取)文件以定位字节的位置

java - 两个 vector 之间的排列

arrays - 排序数组时最小化插入次数

python - "Unsorting"快速排序

json - 在 Perl 中对哈希数组进行编码