International Conference on Computer Systems and Technologies - CompSysTech’07
Application and Statistic Testing of the 5-adic Summation-Shrinking Generator Borislav Stoyanov, Borislav Bedzhev, Todor Tashev, Svetlana Vasileva Abstract: The paper describes the software application of a scheme of stream cipher named N-adic Summation-Shrinking Generator (NSumSG). The statistic testing proves the pseudo-randomness of the output bits of the NSumSG and applicability of the NSumSG as a real stream cipher. Key words: Pseudorandom Generator, Encryption and Decryption, Statistic Testing.
INTRODUCTION The pseudorandom generators are crucial factor in the stream ciphers design. Their performance quality depends on their period, linear complexity and statistical properties. The NSumSG [1], [7] is a new pseudorandom generator with basic building block – the N-FCSR [2], [8]. We design the NSumSG as a software application. The output of the generator has been tested statistically with NIST test suite [4] and autocorrelation test [3]. The results show that NSumSG is applicable as a real stream cipher. The paper is organized as follows. First we give the theoretical basic of the NSumSG in the next section. After that we describe a new dialog application called NSumSG Crypt for encryption and decryption of data, statistical testing and finally we present some conclusions. BASICS OF THE N-ADIC SUMMATION-SHRINKING GENERATOR In the N-adic Summation-Shrinking generator (Fig.1), a control N-adic Summation generator R0 is used to select a portion of the output sequence of 2-adic Summation generators from R1, R2, …, RN-1. Every Summation generator (from R0 to RN-1) consists of two 2-FCSRs or N-FCSRs, depicted as Rj1 ÷ Rj2, ( j = 0,1, 2,...(N − 1)) . The algorithm of the NSumSG consists of the following steps: (1) All FCSRs from R01 ÷ R02 to RN-11 ÷ RN-12 are clocked. (2) If the N-adic output bi = j of the control N-adic Summation generator R0 is not equal to 0, the output bit of jth 2-adic Summation generator forms a part of the keystream. Otherwise, if the output bi = 0 of control N-adic Summation generator R0 is equal to 0, the all output bits are discarded. The N-FCSRs and 2-FCSRs are initialized with strong N-prime and 2-prime numbers [5] dj1÷dj2 and d01÷d02, j = 1, 2,...(N − 1) , where N is prime number. For N = 2 the period of the NSumSG is T0*T1 , gcd(T0 , T1 )
(1)
T0 =
(d 01 − 1)(d 02 − 1) , gcd((d 01 − 1)(d 02 − 1))
(2)
T1 =
(d11 − 1)(d12 − 1) . gcd((d11 − 1)(d12 − 1))
(3)
S2 = where
Here T0* is noted the total number of ones in a period of the controlling N-adic Summation generator. The linear complexity of the NSumSG is close to the value S2. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. To copy otherwise, to republish, to post on servers, or to redistribute to lists, requires prior specific permission and/or a fee. © 2007 ACM ISBN: 978-954-9641-50-9
- IIIA.17-1 -
International Conference on Computer Systems and Technologies - CompSysTech’07
Fig. 1. N-adic Summation-Shrinking Generator. SOFTWARE APPLICATION OF THE N-ADIC SUMMATION-SHRINKING GENERATOR The software dialog application named NSumSG Crypt (Fig.2) of the N-adic Summation-Shrinking Generator is realized for N = 5, with the help of the class p_adic [6]. In this configuration a control 5-adic Summation generator and two 5-FCSRs are used. There are four slaved 2-adic Summation generators.
Fig. 2. The software application NSumSG Crypt. - IIIA.17-2 -
International Conference on Computer Systems and Technologies - CompSysTech’07
The software application is implemented in Visual C++ 6.0 environment for Windows/32 bits. It was executed on PC AMD Athlon™ XP 2200+ / 256 MB RAM. During the test, the strong 2-prime and 5-prime numbers are chosen randomly from the file named strong.key. STATISTICALLY TESTING OF THE OUTPUT FROM THE N-ADIC SUMMATIONSHRINKING GENERATOR For the test we were generated a file with a 1000 sequences, consisting of 1 000 000 bits each. The size of file is 953 MB. Each of the two 5-FCSRs of the control 5-adic Summation generator was initialized by 1000 connection strong 5-prime numbers from two intervals: for d01 – from 981287 to 1878887 and for d02 – from 989687 to 1890467. Each of the used eight 2-FCSR was loaded with the next 1000 strong 2-prime numbers: d11 from 984587 to 2288603, d12 from 997307 to 2299547, d 21 from 1007243 to 231308, d 22 from 1009643 to 2318843, d 31 from 1025147 to 2328827, d 32 from 1038539 to 2335547, d 41 from 1053707 to 2349947, d 42 from 2073707 to 3493163. As is know, the NIST test suite [4] included 16 tests - frequency (monobit), frequency within a block, runs, longest-run-of-ones in a block, binary matrix rank, discrete Fourier transform (spectral), non-overlapping template matching, overlapping template matching, Maurer’s Universal statistical, Lempel-Ziv compression, linear complexity, serial, approximate entropy, cumulative sums, random excursions, random excursions variant. For each test it calculates the proportion of sequences that pass the test [4] (in our case the proportion must be lie above 0.9805607) and the specific p-value [4] ( in our case the p-value must be lie above 0.0001). The results from the NIST testing are listed in Table.1. In addition, we implemented an autocorrelation test in Visual C++ 6.0 and tested the output file. The idea of the test is to check if there is a correlation between the bits of a sequence and the bits of a shifted version of the same sequence. The shift d was chosen to be in the interval from 1 to 20 and all 1000 sequences were checked. Statistical Test Frequency (monobit) Frequency within a block Cumulative sums Runs Longest-run-of-ones in a block Binary matrix rank Discrete Fourier transform (spectral) Non-overlapping template matching Overlapping template matching Maurer’s “Universal statistical” Approximate entropy Random excursions Random excursions variant Serial Lempel-Ziv compression Linear complexity
Result Pass Pass Pass Pass Pass Pass Pass Pass
Proportion 0.9890 0.9910 0.9910 0.9890 0.9860 0.9900 0.9910 0.9960
P-valueT 0.560546 0.002105 0.788728 0.298282 0.366918 0.220159 0.620465 0.607993
Comment
Pass
0.9901
0.535410
Avg. values
Pass Pass Pass Pass Pass Pass Pass Pass Pass
0.9910 0.9900 0.9890 0.9894 0.9914 0.9870 0.9870 0.9910 0.9920
0.498313 0.664168 0.026948 0.527718 0.527718 0.204439 0.605916 0.004872 0.038062
Avg. values Avg. values
Table 1. The result of the testing the 5SumSG. The output file of the NSumSG passes all 16 tests from NIST test suite and autocorrelation test. - IIIA.17-3 -
International Conference on Computer Systems and Technologies - CompSysTech’07
CONCLUSIONS The statistic tests prove that the N-adic Summation-Shrinking generator is a very good pseudorandom generator with indistinguishable output bits from truly random sequences. The software application NSumSG Crypt is suitable for local file encryption/decryption. REFERENCES [1] Bedzhev, B., Zh. Tasheva, B. Stoyanov, Summation – Shrinking Generator, International Conference "Information Technologies and Security" (ITS - 2004), 22-26 June 2004, Partenit, Crimea, Ukraine, pp.119-127. [2] Klapper, A., M. Goresky, “2-adic Shift Register. Fast Software Encryption”, Second International Workshop. (Lecture Notes in Computer Science, vol. 950, Springer Verlag, N. Y., 1994.) pp.174-178 [3] Menezes, A., P. van Oorshot, S. Vastone, Handbook of Applied Cryptography, CRC Press, 1996, www.cacr.math.uwaterloo.ca/hac/. [4] Rukhin, A., J. Soto, J. Nechvatal, M. Smid, E. Barker, S. Leigh, M. Levenson, M. Vangel, D. Banks, A. Heckert, J. Dray, S. Vo, “A Statistical Test Suite for Random and Pseudo-Random Number Generators for Cryptographic Application”, NIST Special Publication 800-22 (with revision May 15, 2001), http://csrc.nist.gov/rng/. [5] Seo, Ch., S. Lee, Y. Sung, K. Han, S. Kim, “A Lower Bound on the Linear Span an FCSR”, IEEE Transaction on Information Theory, Vol. 46, No 2, March 2000. [6] Stoyanov, B., B. Bedzhev, Zh. Zhekov, Computation Model of p-adic Arithmetic, XXXIX International Scientific Conference on Information, Communication and Energy Systems and Technologies, ICEST 2004, 16-19 June 2004, Bitola, Macedonia, pp.341344. [7] Tasheva, Zh., B. Bedzhev, B. Stoyanov, N-adic Summation-Shrinking Generator. Basic properties and empirical evidence, http://eprint.iacr.org, 2005/068/. [8] Xu, J., Stream Cipher Analysis Based on FCSRs, PhD Dissertation, University of Kentucky, 2000, http://www.cs.engr.uky.edu/etd/theses/uky-cocs-2000-d-002/. ABOUT THE AUTHORS Assist. Prof., Borislav Stoyanov, PhD., Faculty of Computer System and Technologies, University of Shumen, Bulgaria, Phone: +359 89 9257770, Е-mail:
[email protected]. Assoc. Prof., Borislav Bedzhev, Eng., DSc. PhD, Faculty of Artillery, Air Defence and Communication Information Systems, NMU „V. Levski”, Shumen, Bulgaria, Е-mail:
[email protected]. Eng. Todor D. Tashev, PhD. Student in Communication Network and Systems, University of Shumen, Shumen, Bulgaria, Phone: +359 54 980 422, e-mail:
[email protected]. Assist. Prof. Svetlana Vasileva, PhD. student, College - Dobrich, University of Shumen, Phone: +359 58 603 248, Å-mail:
[email protected]
- IIIA.17-4 -