作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
请帮助解释维基百科中描述的生日效应:
A birthday attack works as follows:
- Pick any message m and compute h(m).
- Update list L. Check if h(m) is in the list L.
- if (h(m),m) is already in L, a colliding message pair has been found. else save the pair (h(m),m) in the list L and go back to step 1.
From the birthday paradox we know that we can expect to find a matching entry, after performing about 2^(n/2) hash evaluations.
最佳答案
这意味着循环进行 2^(n/2) 次迭代。但请注意 L
这里不会是一个普通的列表,而是一个哈希表映射 h(m)
至 m
.因此,每次迭代平均只需要恒定次数(O(1))的比较,并且总共会有 O(2^(n/2))次比较。
如果 L 是一个普通数组或链表,那么比较的次数会大得多,因为每次迭代都需要搜索整个列表。不过,这将是实现该算法的一种糟糕方式。
关于hash - 有人可以为我澄清生日效应吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2766910/
图像显示,但不转换。 CSS 代码显示在上传的页面上。 我正在使用 EverWeb 构建页面。 下面是我正在尝试的代码。提前致谢。 HTML 片段 CSS .image { width: 100
我是一名优秀的程序员,十分优秀!