我有一个加密大文本的算法。我想在统计测试中测试这个算法。密文包含~10,000,000位。我决定用两种不同的方式测试这个算法,然后把密文传递给统计测试的输入:
/assess 1000000和How many bitstreams? 10/assess 100000和How maney bitstreams? 100在第一个场景中,我得到了以下结果:
------------------------------------------------------------------------------
RESULTS FOR THE UNIFORMITY OF P-VALUES AND THE PROPORTION OF PASSING SEQUENCES
------------------------------------------------------------------------------
generator is <data/encode.txt>
------------------------------------------------------------------------------
C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 P-VALUE PROPORTION STATISTICAL TEST
------------------------------------------------------------------------------
0 1 1 1 0 2 2 2 0 1 0.739918 10/10 Frequency
0 1 1 0 0 2 2 3 0 1 0.350485 10/10 BlockFrequency
0 1 1 0 1 1 1 1 2 2 0.911413 10/10 CumulativeSums
0 1 0 1 1 4 1 1 1 0 0.213309 10/10 CumulativeSums
1 1 0 0 0 1 2 1 3 1 0.534146 10/10 Runs
2 0 1 1 1 0 2 1 1 1 0.911413 10/10 LongestRun
1 2 1 1 0 1 0 0 2 2 0.739918 10/10 Rank
1 4 0 0 1 0 2 1 0 1 0.122325 10/10 FFT
1 1 0 2 0 0 1 3 0 2 0.350485 10/10 NonOverlappingTemplate
2 0 1 0 2 1 1 1 0 2 0.739918 9/10 NonOverlappingTemplate
a lot of passed tests...
1 0 0 2 2 1 2 1 1 0 0.739918 10/10 NonOverlappingTemplate
0 0 1 0 7 1 0 0 1 0 0.000003 * 10/10 NonOverlappingTemplate
1 4 1 0 1 2 1 0 0 0 0.122325 10/10 NonOverlappingTemplate
a lot of passed tests...
0 0 0 3 0 0 3 1 1 2 0.122325 10/10 NonOverlappingTemplate
0 1 3 0 0 2 1 1 1 1 0.534146 10/10 OverlappingTemplate
1 0 0 3 2 1 1 0 1 1 0.534146 9/10 Universal
0 0 1 2 2 3 0 0 1 1 0.350485 10/10 ApproximateEntropy
1 0 0 0 1 1 2 1 1 1 ---- 8/8 RandomExcursions
0 1 1 1 0 1 1 1 2 0 ---- 8/8 RandomExcursions
1 0 1 1 0 2 1 1 0 1 ---- 7/8 RandomExcursions
0 1 2 1 2 1 1 0 0 0 ---- 8/8 RandomExcursions
0 3 0 0 0 1 1 0 1 2 ---- 8/8 RandomExcursions
0 2 0 0 0 0 1 1 2 2 ---- 8/8 RandomExcursions
0 0 1 2 3 0 1 0 0 1 ---- 8/8 RandomExcursions
1 1 1 0 1 1 1 1 1 0 ---- 8/8 RandomExcursions
2 0 0 3 0 0 0 0 1 2 ---- 8/8 RandomExcursionsVariant
2 1 1 0 1 0 0 1 1 1 ---- 8/8 RandomExcursionsVariant
0 1 3 0 0 1 0 2 1 0 ---- 8/8 RandomExcursionsVariant
0 1 1 1 0 3 1 0 0 1 ---- 8/8 RandomExcursionsVariant
0 0 0 4 2 1 1 0 0 0 ---- 8/8 RandomExcursionsVariant
0 2 0 1 1 1 0 3 0 0 ---- 8/8 RandomExcursionsVariant
1 0 2 0 0 0 0 0 1 4 ---- 8/8 RandomExcursionsVariant
0 1 0 2 2 0 1 0 0 2 ---- 8/8 RandomExcursionsVariant
1 0 2 0 1 0 1 1 0 2 ---- 8/8 RandomExcursionsVariant
2 0 1 1 0 1 0 0 1 2 ---- 8/8 RandomExcursionsVariant
0 2 1 2 0 1 2 0 0 0 ---- 8/8 RandomExcursionsVariant
1 0 2 2 1 1 1 0 0 0 ---- 8/8 RandomExcursionsVariant
0 2 3 1 0 0 0 0 1 1 ---- 8/8 RandomExcursionsVariant
0 1 3 1 1 0 0 1 1 0 ---- 8/8 RandomExcursionsVariant
0 3 1 0 0 2 0 0 0 2 ---- 8/8 RandomExcursionsVariant
1 2 0 1 0 0 0 1 2 1 ---- 8/8 RandomExcursionsVariant
2 1 0 0 1 1 1 0 2 0 ---- 8/8 RandomExcursionsVariant
2 1 0 1 0 0 1 2 1 0 ---- 7/8 RandomExcursionsVariant
1 1 0 0 2 3 0 1 1 1 0.534146 10/10 Serial
0 1 0 1 4 1 0 2 1 0 0.122325 10/10 Serial
2 0 1 1 0 2 1 0 2 1 0.739918 10/10 LinearComplexity
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The minimum pass rate for each statistical test with the exception of the
random excursion (variant) test is approximately = 8 for a
sample size = 10 binary sequences.
The minimum pass rate for the random excursion (variant) test
is approximately = 7 for a sample size = 8 binary sequences.
For further guidelines construct a probability table using the MAPLE program
provided in the addendum section of the documentation.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -在第二个场景中,我得到了以下结果:
------------------------------------------------------------------------------
RESULTS FOR THE UNIFORMITY OF P-VALUES AND THE PROPORTION OF PASSING SEQUENCES
------------------------------------------------------------------------------
generator is <data/encode.txt>
------------------------------------------------------------------------------
C1 C2 C3 C4 C5 C6 C7 C8 C9 C10 P-VALUE PROPORTION STATISTICAL TEST
------------------------------------------------------------------------------
9 11 9 10 8 7 11 10 11 14 0.946308 100/100 Frequency
10 8 10 10 11 10 15 10 8 8 0.924076 100/100 BlockFrequency
9 9 9 7 8 13 11 15 8 11 0.779188 100/100 CumulativeSums
6 12 7 12 11 12 9 11 8 12 0.851383 100/100 CumulativeSums
8 11 15 8 6 15 10 4 8 15 0.122325 100/100 Runs
9 10 14 14 11 11 4 7 9 11 0.514124 99/100 LongestRun
9 13 12 9 13 9 8 11 12 4 0.637119 100/100 Rank
14 6 11 10 6 8 8 13 10 14 0.514124 100/100 FFT
9 7 12 11 13 8 9 11 12 8 0.924076 99/100 NonOverlappingTemplate
a lot of passed tests...
8 16 16 3 10 9 12 11 6 9 0.096578 99/100 NonOverlappingTemplate
6 12 6 11 12 11 7 11 14 10 0.657933 98/100 OverlappingTemplate
100 0 0 0 0 0 0 0 0 0 0.000000 * 0/100 * Universal
8 11 7 12 10 12 9 13 12 6 0.816537 100/100 ApproximateEntropy
1 0 0 0 2 1 1 2 2 3 0.350485 12/12 RandomExcursions
0 1 1 2 1 0 2 1 2 2 0.739918 12/12 RandomExcursions
1 0 0 2 2 0 1 2 1 3 0.350485 12/12 RandomExcursions
0 3 1 1 1 1 1 1 0 3 0.350485 12/12 RandomExcursions
2 1 1 2 0 0 2 1 2 1 0.739918 11/12 RandomExcursions
2 0 0 2 2 2 0 1 1 2 0.534146 12/12 RandomExcursions
3 3 0 1 1 2 1 1 0 0 0.213309 12/12 RandomExcursions
3 1 0 2 2 1 0 3 0 0 0.122325 11/12 RandomExcursions
2 0 0 1 0 2 2 1 2 2 0.534146 12/12 RandomExcursionsVariant
2 0 1 0 1 0 3 2 1 2 0.350485 12/12 RandomExcursionsVariant
2 1 0 1 2 0 4 0 1 1 0.122325 12/12 RandomExcursionsVariant
2 0 2 0 2 1 1 3 0 1 0.350485 12/12 RandomExcursionsVariant
1 1 1 0 1 3 0 0 0 5 0.004301 12/12 RandomExcursionsVariant
0 1 2 1 0 2 1 1 1 3 0.534146 12/12 RandomExcursionsVariant
0 0 1 2 1 0 3 3 1 1 0.213309 12/12 RandomExcursionsVariant
0 0 1 0 2 3 1 2 0 3 0.122325 12/12 RandomExcursionsVariant
0 1 0 1 3 2 1 4 0 0 0.035174 12/12 RandomExcursionsVariant
1 2 1 2 2 1 0 1 2 0 0.739918 11/12 RandomExcursionsVariant
2 3 0 1 2 1 2 0 0 1 0.350485 11/12 RandomExcursionsVariant
3 2 0 1 0 1 1 1 2 1 0.534146 11/12 RandomExcursionsVariant
3 2 1 1 0 2 0 0 2 1 0.350485 12/12 RandomExcursionsVariant
2 3 1 0 1 0 3 1 0 1 0.213309 12/12 RandomExcursionsVariant
1 1 3 0 1 1 4 0 0 1 0.066882 12/12 RandomExcursionsVariant
1 0 3 1 1 3 0 0 1 2 0.213309 12/12 RandomExcursionsVariant
1 0 3 0 1 3 2 1 0 1 0.213309 12/12 RandomExcursionsVariant
1 2 0 1 1 2 3 0 2 0 0.350485 12/12 RandomExcursionsVariant
11 10 14 11 9 9 8 12 9 7 0.924076 100/100 Serial
15 5 11 8 9 12 6 14 13 7 0.275709 100/100 Serial
12 11 5 10 12 11 5 13 7 14 0.401199 98/100 LinearComplexity
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The minimum pass rate for each statistical test with the exception of the
random excursion (variant) test is approximately = 96 for a
sample size = 100 binary sequences.
The minimum pass rate for the random excursion (variant) test
is approximately = 10 for a sample size = 12 binary sequences.
For further guidelines construct a probability table using the MAPLE program
provided in the addendum section of the documentation.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -为什么在测试同一文本时,算法没有通过两次不同的测试?在第一种情况下,算法失败了一些NonOverlappingTemplate。在第二种情况下,算法通过了所有的NonOverlappingTemplates,但失败了通用测试。
谢谢你的帮助!
发布于 2023-03-07 15:44:55
我会忽略它。
莫勒的试验是压缩试验。您的文件是否使用pkzip、7z或更强的东西(如PAQ8或cmix )进行压缩?不是吗?它是否通过了(我认为是最值得信赖的测试)?
大多数随机测试返回p值,如果输入文件包含真正独立的随机位,则该值在[0,1]上应该是一致的。这些p值是由p= F(X)得到的,其中F是样本随机变量X的假设分布,通常是正规的。但假设F只是一个渐近逼近,其拟合在尾部是最坏的。
在测试平原/dev/urandom时,我也遇到过类似的失败。是测试代码的错误。如果您考虑一下,当运行= 0.122325时,如何压缩为= 0.000000?太荒谬了。
这个缺陷的一个很好的例子如下(来自马的嘴,NIST特别出版物800-22)。所有的证据使我们得出结论,一个正常数的扩展的数字是随机分布的。因此,在数学上、哲学上和总体上,e不可能通过随机性检验。但NIST测试确实..。

矛盾只能在于考验,而不是主体。事实证明了这一点。但并不意味着你的加密是安全的。只有通过检查才能确定。
https://crypto.stackexchange.com/questions/105535
复制相似问题