Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

NSEA randomness

0 views
Skip to first unread message

Robert Ames

unread,
Mar 25, 1992, 1:49:44 PM3/25/92
to

To test the randomness of NSEA I wrote an implementation of the binary
derivative test described by Carroll and Robbins (1). Binary derivatives
are described thus:

"Given a string of binary digits, the first derivative is taken by
considering each overlapping pair of digits and recording a "zero"
if they are the same (00 or 11) and recording a "one" if they are
different (01 or 10)."

Following are my findings on a small 1632 byte text file, plaintext and
encrypted with NSEA and DES. Note that NSEA does about as well as DES
by this test.

Binary derivatives of English text:
===================================
There were 6435 ones and 6397 zeroes, total 12832
first binary derivative = 0.501481
second binary derivative = 0.466256
third binary derivative = 0.489401
fourth binary derivative = 0.514963
fifth binary derivative = 0.501247
sixth binary derivative = 0.439214
seventh binary derivative = 0.489479
eighth binary derivative = 0.633962
ninth binary derivative = 0.521353
tenth binary derivative = 0.550655
Ratio of first binary derivative to tenth = 0.910699
Low value: 0.439214, high value: 0.633962, range: 0.194748 **

Binary derivatives of NSEA (CFB) encryption of English text:
============================================================
There were 6552 ones and 6424 zeroes, total 12976
first binary derivative = 0.504932
second binary derivative = 0.500077
third binary derivative = 0.509017
fourth binary derivative = 0.504084
fifth binary derivative = 0.496686
sixth binary derivative = 0.498459
seventh binary derivative = 0.494991
eighth binary derivative = 0.498459
ninth binary derivative = 0.499229
tenth binary derivative = 0.493681
Ratio of first binary derivative to tenth = 1.022791
Low value: 0.493681, high value: 0.509017, range: 0.015336 **

Binary derivatives of DES (CBC) encryption of English text:
===========================================================
There were 6607 ones and 6457 zeroes, total 13064
first binary derivative = 0.505741
second binary derivative = 0.508344
third binary derivative = 0.505052
fourth binary derivative = 0.506124
fifth binary derivative = 0.498239
sixth binary derivative = 0.494565
seventh binary derivative = 0.503291
eighth binary derivative = 0.508037
ninth binary derivative = 0.499694
tenth binary derivative = 0.495254
Ratio of first binary derivative to tenth = 1.021175
Low value: 0.494565, high value: 0.508344, range: 0.013778 **

Code sample
===========
/* generate binary representation of data */
while (!feof(in))
{
c1 = fgetc(in);
fprintf(tmp1, "%s", table[c1]); /* binary of byte value */
}

/* subroutine to do binary derivatives */
while (!feof(file1))
{
c1 = fgetc(file1);
if (c1 == c2)
{
one++;
fputc('1', file2);
} else
{
zero++;
fputc('0', file2);
}
c2 = c1;
}
--------------------------
(1) Carroll, John M. and Robbins, Lynda E. "Using binary derivatives
to test an enhancement of DES". In: Deavours et al. 1989. Cryptology:
machines, history and methods. Artech House. ISBN 0-89006-399-0.

--
Robert Ames mir...@gpu.utcs.utoronto.ca P.O. Box 724, Station 'A', Toronto

0 new messages