Redalyc.A Novel Approach for Pseudo-Random Seed Generation
Total Page:16
File Type:pdf, Size:1020Kb
Computación y Sistemas ISSN: 1405-5546 [email protected] Instituto Politécnico Nacional México Pelaiz, Sacha; Tejera, Renier A Novel Approach for Pseudo-Random Seed Generation Computación y Sistemas, vol. 17, núm. 1, enero-marzo, 2013, pp. 63-68 Instituto Politécnico Nacional Distrito Federal, México Available in: http://www.redalyc.org/articulo.oa?id=61525677007 How to cite Complete issue Scientific Information System More information about this article Network of Scientific Journals from Latin America, the Caribbean, Spain and Portugal Journal's homepage in redalyc.org Non-profit academic project, developed under the open access initiative A Novel Approach for Pseudo-Random Seed Generation Sacha Pelaiz and Renier Tejera Complejo de Investigaciones Tecnológicas Integradas CITI, La Habana, Cuba {spelaiz, rtejera}@udio.cujae.edu.cu Abstract. Random sequences play an important role in entre otras aplicaciones. En este trabajo se describe el all aspects of Cryptography. All cryptographic systems diseño de RAMG, un generador seudo-aleatorio de and protocols are based on secrets and can only be as semillas (GSSA) empleando un algoritmo simétrico strong as the random sequence generators they use to seguro de cifrado en bloques. Se describen los generate those secrets. The best cryptographic scheme principios de diseño utilizados para su desarrollo así becomes insecure once its secrets can be predicted or como sus componentes principales y se analiza la idea determined. In modern cryptography random de emplearlo como un generador de sucesiones de bits sequences are used (1) to generate session keys and seudo-aleatorios (GBSA). initialization vectors for symmetric block ciphers, (2) to Palabras clave. Semilla, cifrado simétrico en bloques. generate random values for various digital signature schemes such as DSA and (3) to produce seeds which are used in math routines to get values such as large prime numbers for RSA and also in security protocols. 1 Introduction This paper presents the design of RAMG, a pseudo- random seed generator, using a secure symmetric The generation of truly random sequences, block cipher algorithm. We describe the design despite being a widely studied topic in principles used for the development of the generator as cryptography, is a complex issue, particularly well as its principal components. We also discuss the because computers in which generation idea of using it as a pseudo-random bit generator algorithms are implemented are designed to be (DRBG). deterministic. Therefore, a general procedure is to Keywords. DRGB, seed, symmetric encryption cipher. use pseudo-random numbers, which are numbers generated from truly random values and are very Un nuevo procedimiento de difficult to distinguish from the latter. generación seudo aleatoria A pseudo-random bit generator (DRBG) is a deterministic mechanism that processes truly de semillas random unpredictable inputs, commonly called seeds, and generates pseudo-random outputs. Resumen. Las sucesiones aleatorias juegan un papel DRBGs are currently used in many cryptographic importante en todos los aspectos de la criptografía. Todos los sistemas y protocolos criptográficos se applications; some of them have already identified basan en el secreto y solo pueden ser tan fuertes como vulnerabilities [5]. lo sean los generadores aleatorios de sucesiones A DRBG can be defined as a deterministic empleados para generar esos secretos. El mejor function as follows: esquema criptográfico deviene inseguro una vez se puedan determinar o predecir sus secretos. En la k n (1) criptografía moderna se emplean las sucesiones F :0,1 0,1 , aleatorias para: generar llaves de sesión e inicializar vectores para esquemas simétricos de cifrado en where F is a one-way function that maps a bloques; generar valores aleatorios para diversos esquemas de firma digital tales como DSA y ECDSA; small input to a much greater length output, and generar semillas que se empleen en rutinas n k . matemáticas para obtener valores tales como números If input x is selected uniformly at random, primos grandes para esquemas como RSA y ElGamal, then no efficient algorithm can distinguish Computación y Sistemas Vol. 17 No.1, 2013 pp.63-68 ISSN 1405-5546 64 Sacha Pelaiz and Renier Tejera between F(x) and a truly random sequence of To generate seeds, one commonly uses some the same length. This implies that the output is values as entropy inputs; these values are usually uniformly distributed and unpredictable without obtained from actions taken by a human operator, and also relating to system inputs such as time the knowledge of . The first k bits of the output values and process tables. However, these are used as input for the next iteration, while the values usually are poor sources of entropy [3]. remaining n k bits are the output. Designating An improved variant to obtain suitable inputs is the first entry of as the initial state and each to employ entropy sources associated to following entry as the next state, one creates a unpredictable physical or electronic processes state machine with the transition function F, and such as thermal noise sources and noise of then successive application results in a DRBG. diodes. However, this implies an additional cost in The security of this construction is to keep the hardware due to the use of appropriate and internal state secret. The requirement that is a specific devices which may not be feasible in one-way function ensures that an attacker cannot different scenarios. retrieve the internal state from the outputs. For these reasons we decided to design and For the initial state to be secret to a potential implement a software-based pseudo-random attacker, it must be initialized with uniformly seed generator PRSG, named RamG, with good distributed secret values (seeds). Also, most statistical properties to provide the quantity of DRBGs periodically reset the internal state for two entropy required for DRBGs. main reasons: to prevent the function to fall in short cycles and to increase the entropy of the 2 RamG Components internal state. DRBGs must fulfill certain requirements [1]. to 2.1 Entropy Source be considered cryptographically secure. The two fundamental requirements are as follows. According to [9], the source of the entropy input 1. Forward security or Progressive resistance. shall be either An attacker who can compute the internal – a non-deterministic random bit generator state of the generator cannot retrieve (NRBG), previous outputs. This is achieved by – a DRBG, thus forming a chain of at least two ensuring that the transition function is a one- DRBGs; the highest-level DRBG in the chain way function. shall be seeded by an NRBG or an entropy 2. Backward security or Prediction resistance. source, or An attacker who can compute the internal – an appropriate entropy source. state of the generator cannot predict future In the implementation of RamG we used the outputs. This can be provided if the internal function randomize as an entropy source. This state is periodically reset with data of function is part of the BigInt class, developed and sufficient entropy. implemented by the authors for working with large So, why do we need to design a seed integers and multi-precision arithmetic. This generator? The most common reason for failure function was adequate for specific purposes from of DRBGs in real-world applications is that they various functions of the Open Source Library Lidia overestimate the amount of entropy in the seeds. [6]. It was proved that the randomize function For example, if a generator have seeds of 128 generates random sequences with good bits which seem random, but in fact have only 56 cryptographic properties for lengths of 256, 384, bits of entropy, then an attacker can feasibly 512 and 768F bits. Note further that this function perform an exhaustive search of the starting point can be replaced by any other function to generate of the DRBG [4]. This is perhaps the most difficult pseudo-random sequences of 768 bits. problem to solve in the design of a DRBG. x Computación y Sistemas Vol. 17 No.1, 2013 pp.63-68 ISSN 1405-5546 A Novel Approach for Pseudo-Random Seed Generation 65 2.2 Symmetric Algorithm GOST 28147-89 232 1 – CM 4 : a 32 bit adder modulo . The symmetric block cipher scheme GOST – CM 5 : a Bitwise Exclusive or adder without 28147-89 [11] is considered an algorithm with restrictions of the number of bits. good cryptographic properties. To date, there are – SS -mode: a Simple Substitution Mode. no known effective general or specific purpose attacks. This algorithm is originally from the former Union of Soviet Socialist Republics 2.3 Statistical Tests (USSR), and it functions today with certain specifications and employment restrictions To check the quality of the sequences generated according to the symmetric standard of by RamG, we used the NIST package of Russia [2]. statistical tests proposed in [10] with good results. The algorithm was implemented in the Output Besides, as part of the generation process, we Feedback mode (Fig. 1) leading to the function decided to incorporate only 4 of these statistical rGOST. Its components are: tests for efficiency reasons, to measure the quality in terms of randomness of the generated – K0 ,,K7 : 32 bit registers for storing the sequences. In the following we describe these 4 symmetric key of 256 bits. tests. – S1,, S8 : 8 S-boxes, each of size 64 bits. 2.3.1 Frequency Test (Monobit Test) – R1,R2 ,R3 ,R4 : 32 bit registers. Compute the confidence interval: – R5 , R6 : 32 bit registers which contain two I np t npq (2) , constants C1 and C2 . 32 – CM 3 ,CM1 : 32 bit adders modulo 2 . Where n is the number of elements of the – CM 2 : a Bitwise Exclusive Or adder for 32 sequence, p 1/ 2 is the probability of the bit registers.