生日攻击:最多选√n次就能在n个数中选到相同的数
√1000000007≈31622≈10^5
然后l搞大一点,使得最后会出现两个冲突的hash值。
(Orz hzwer)


1 #include <iostream> 2 #include <algorithm> 3 #include <cstdio> 4 #include <cstring> 5 #include <cstdlib> 6 #include <string> 7 #include <vector> 8 #include <cmath> 9 #include <queue> 10 #include <complex> 11 #include <set> 12 using namespace std; 13 14 const int N=100000; 15 16 int main(){ 17 puts("100000 20"); 18 for(int i=0;i<N;i++)putchar(rand()%26+'a'); 19 }
本文探讨了生日攻击原理,即在n个数中通过选择约√n次即可找到至少一对相同的数,以此来理解Hash冲突的可能性。通过示例代码展示了如何在大量数据中制造Hash冲突。
1181

被折叠的 条评论
为什么被折叠?



