Generation of Low C ost and Low Power [602527]

Generation of Low C ost and Low Power
Random Number Generation for Wireless Sensor
Networks Application

Ghofrane S ouaki(1) Kacem Halim(1,2)
Ghofrane.S [anonimizat] [anonimizat]

(1) ESPRIT School of Engineering, Tunis, Tunisia,
(2) Faculty of sciences of Tunisia Unit: Circuits and Electronics Systems High Frequency Tunis, Tunisia,

Abstract— Wireless sensor communication is managing
critical applications that require serious security and
privacy concerns to decrease hacking attacks. As a
solution, most cryptographic algorithms include secure
encoding and decoding which are based on random
number generator (R NG), This paper suggests an
efficient solution for the generation of low cost and low
power random number for Wireless Sensor Networks
Application based on analog and digital sources of the
Microcontroller Unit (MCU) with external sensing
resources. The de sign detail and the validation of the
quality of the solution outputs, were identified based on a
couple of test suites standardized by the U.S. National
Institute of Standards and Technology, both achieved in
the ideal case and assuming implementation .
Index Terms — WSN (Wireless Sensor Network), RNG
(Random Number Generator ), MCU (Microcontroller
Unit), DMA (Direct Memory Access).

I. INTRODUCTION
Since its birth, wireless sensor network technology (WSN)
hasn't stop getting further. Starting with basic solutions
(irrigation, control…) until integrating the latest technologies,
getting involved into critical applications and reaching crucial
needs such as medical records, military and security
applications.
Therefore, securing these potential applications which are all
being hindered because of serious security and privacy
concerns presents great challenges [1-3]. Security and privacy
concerns require a combination of technical, social, and legal
approaches adopting and implementing mathematical
modeling of security and cryptographic protocols [4]. Per that, two musts are required to secure WSN's
applications.
On the one hand, we need to integrate protections against
unauthorized accesses such as Cryptography while
developing a wireless sensor network applica tion. On the
other hand, we should minimize the power consumption and
guaranty the performance of the Microcontroller Unit
(MCU) [5,6] .
Most cryptographic algorithms include secure encoding and
decoding. The difficult part is how to guaranty the
uniqueness of a generated code hard to be hacked. The key
for that is random number generation [7,8] .
In this paper, we propose a new random number generator
solution. We aim to provide an efficient randomness output
while respecting the power consumption restriction , CPU
bandwidth and reasonable cost.
The structure of this paper is as follows. Section II describes
the related background knowledge. In section III we present
the new RNG proposal scheme based on MCU resources. In
this paper, we choose to work with CC13 10
microcontroller, a member of the CC26xx and CC13xx
family, known by the low active RF and microcontroller
(MCU) current consumption, in addition to flexible low –
power modes, which provide excellent battery lifetime and
allow long -range operation on smal l coin -cell batteries and in
energy -harvesting applications . [1]
Section V describes the experimental synthesis results and
performances tested based on the National Institute of
Standards and Technology (NIST) Statistical Test Suite
(STS). Finally, we wil l conclude the paper with section VI.

Figure 2: The implementation of the true random number generator. II. BACKGROUND
Cryptographic applications are based on Random Number
Generator which is a computational or physical device
designed to generate a sequence of numbers that does not
have any easily discernable pattern, such that the sequence
can be treated as being random. Such functions may be
described as "True" Random Number Generators (TRNGs) or
"Pseudo" Random Number Generators (PRNGs).
1. Deterministic random number generator or pseudo
random number generator (PRNG ):
A PRNG only appears to generate deterministic numbers
which have certain statistical properties that from a cursory
examination appear to be random, but which can be proven
otherwise by analysis. The PRNG is based on a mathematical
formula that produces a sequence of bits from a n initial value
called a seed t o guarantee forward unpredictability, care must
be exercised in obtaining seeds as presented in [9].
The values produced by a PRNG are completely predictable
if the seed and generation algorithm are known.
The following figure illustrates the implementation of the
pseudo random number generator using linear feedback shift
registers (LFSR) .
Where Parameter Min_LFSR_Length is used to specify the
length of the shortest LFSR.
2. Non -deterministic random number generator or true
random number generator (TRNG): A TRNG generates numbers that cannot be guessed or
predetermined for all practical purposes as it typically use s
external physical phenomena to generate true randomness.
A nondeterministic RNG produces sequence of bits (1 and 0)
based on some irregular and unidentified physical sources
(i.e., the entropy source), which are outside human control.
As presented in Figure 2 , below, TRNG is constituted of
three blocs: analog part (i.e Noise signal), digital part that
digitalizes the analog source and the output part.
Many standards have created requirements and references for
the construction, the validation and the use of Random
Number Generators (RNG) [10, 11, 12] to pursue that the
output they produce is indeed random.
The most popular standard is the NIST SP800 -22b statistical
test suite which has been carried out using a statistical test
suite (sts) developed by the National institute of standards
and technology (NIST) to probe the quality of random
generators for cryptographic applica tions. A comprehensive
description of the suite was presented in [12].
III. NEW RNG APPROACH
PROPOSAL
The microcontroller selected CC1310 integrates a TRNG
module that provides a true, nondeterministic noise source for
generating keys, initialization vectors, and other random
number requirements. The TRNG is built on 24 ring
oscillators that create unpredictable output to feed a complex
nonlinear -combinatorial circuit.
With CC 1310, Sensors can be handled in a very low -power
manner by a dedicated autonomous ult ra-low-power MCU
that can be configured to handle analog and digital sensors;
thus, the main MCU (Cortex -M3) can maximize sleep time .
Figure 1: The implementation of the pseudo random number generator.

For that, we propose in our new RNG approach to create our
new TRNG based on divers sources to generate RNG value,
using continuous analog sources that provide a seed to a post
processing which will be synchronized with the digital part
while adopting the minimum CPU usage to reduce the CPU
load and power consumption.
Then we aim to compare our results to those tested with the
existing TRNG in CC1310.

Figure 3: TRNG new approach
I. Sources Based Overview :
Generally, most MCUs embed various analog and digital
sources that can be used as a seeding source.
These analog sources will be connected to the Analog to
Digital Converter peripheral (ADC ) existing almost in every
MCU [13].
Thus, many studies have been conducted on the different
analog sources that can be used. In [14] the authors admit that
we can use the value provided from external sensor as
entropy source. Some others used communication error as an
entropy source [15]. Another proposition adopted the noise
on the start -up pattern of SRAM memory [16] for the
generation. The jitter provided from oscillator or PLL can be
interesting too as presented in [17].
Our approach aims to improve the previous researches by
using the combination of four different sources to provide
seeds to post processing unit for the improvement of ou r
entropy.
These sources could be divided into two categories:
1. External sources: The sensitiveness for PVT condition parameters (Power,
Voltage, temperature) are the main parameter for having
external unpredictable variations and then enhance the
entropy.
i. Sensing unit based:
As external Inputs , we decided to implement analog sources
which should be carefully chosen and selected. This unit
reflect the extensibil ity of our solution by adding a sensing
source which supports the implementation of different type of
sensing such as temperature, humidity…While selecting the
most sensible sensor as an entry to our RNG scheme.
2. Internal sources:
i. the temperature sensor
The first analog source is embedded in the MCU. We can use
it to measure the junction temperature (TJ) of the device.
The Sensibility to temperature and precision are confirmed
and highlighted in [18]. The advantage of using the internal
temperature sensor comes from its characteristics, w hich may
vary significantly from one chip to another due to the
different fabrication technologies. The temperature sensor is
internally connected to a dedicated ADC channel that is used
to convert the sensor output voltage into a digital value.

ii. Random -Access Memory RAM
The SRAM (static RAM) of our MCU is split into two 4 -KB
blocks and two 6 -KB blocks and can be used to store data
and execute code. Retention of the RAM contents in standby
mode can be enabled or disabled individually for each block
to mini mize power consumption. In addition, if flash cache is
disabled, the 8 -KB cache can be used as general -purpose
RAM .
As a second source, we decided to adopt the values generated
by the start -up pattern of the Random -Access Memory
(RAM) that contains 1024 bi t sized registers.

iii. STATUS registe r
STATUS register is used as the third RNG source. Known as
a flag or a condition code register, it is a collection of status
flag bits that contains information about the state of
the processor .
The values of STATUS register vary After each executed
instruction.

II. Digital part
The digital part is adopted to ensure integrity, which is based
on CRC (cyclic redundancy check), a peripheral embedded in
most MCUs, implemented in our proposal. Which is used to
calculate the CRC code from a 32 bits’ data word.

III. Synchronization part
We aim to provide a low -cost solution in term of power
consumption and CPU load. Therefore , random number
generation mechanism will be provided while CPU is in sleep
mode. For that, Analog part and Digital part will be
synchronized using Direct memory acce ss (DMA) that
provides a way to offload data -transfer tasks allowing more
efficient use of the processor and the available bus
bandwidth. The DMA of the CC1310 MCU manage Highly
flexible and configurable channel operation of up to 32
channels within a data sizes of 8, 16, and 32 bits. In This new
approach, we are using 8 bits sized channels in two modes:
1. DMA: Peripheral to memory
This mode is used to transfer converted Data from the four
sources used to the CRC p eripheral as follow:
The Analog part composed by the temperature sensor and the
sensing unit is using DMA to transfer converted Data from
ADC to CRC peripheral. The ADC embedded in our MCU is
a 12 -bit, but only the 8 LSB of every conversion will be
transferred into the CRC.
The Digital part f ormed by the STATUS register and the
values generated by the start -up pattern of the RAM is
directly transmitted by the two 8 bit DMA channels into the
same CRC peripheral.
Therefore, to increase the quality of the randomness, the
32bits, received by the C RC, will be composed by the
concatenation of 8 bits of each of the sources of Digital part
and the LSB bytes of the Analog part converted values.
2. DMA: Memory to memory :
16 bits of the final random number generated from the CRC will be transferred via a DMA channel to an internal FIFO in
the MCU RAM.
Figure 4, below explains the principle of different steps of
our proposal.

IV. EXPERIMENTAL RESULTS
AND VALIDATION
This section proves that our approach proposed in section IV
matches the experimental results. The experimental study is
based on a new development kit made by Texas Instrument
called The SimpleLink™ Sub -1 GHz CC1310 evaluation
module kit [ 19] that contains our MCU target.
From a validation point of view, many standards have made
requirements and references for the construction, the
validation and the use of random number generators (RNG), in
order to confirm that the output they generated is indeed
random.
The most popular standard is National Institute of Standards
and Technology (NIST) Statistical Test Suite (STS) SP 800 –
22, which was published and updated recently as SP800 –
22rev1a (April 2010).
Figure.5 describes the different steps needed to verify the
randomness of an output number generated by CC1310 using
the NIST statistical test suite package sts -2.1.1.
Figure 5 : The principle of different steps of Statistical Test Suite by NIST
Figure. 4: Our proposal schema

Based on this principle, the process to validate the randomness of
our random number generator is described below:

Step 1:
Based on our proposal CC1310 will generate random.
The RNG buffer will be downloaded i nto an SD card via SPI
protocol 20 blocks of 128,000 bytes of random number will be
generated s o the output file will contain 2 ,480,000 random bits to
be tested with the NIST statistical test.
This SD card will be implemented int o the PC, that offer more
mobility and portability for our solution.
As recommended by the NIST statistical test suite, the output file
format can be a sequence of or binary or ascii. Figure 6.a and 6.b
present a snapshot of type file format generated based on our
proposal.

Binary File sample:

ASCII File sample:

Step 2 :
To verify the randomness of the output file of the random
number generator from CC1310 products, the NIST statistical
test suite package sts -2.1.1 is downloaded in installed on
workstation .
Step3:
The test report generated by sts -2.1.1 package is saved under the
data folder (sts -2.1.1 \data). This file will be analyzed in next
section.

V. RESULTS ANALYSIS
The NIST statistical test suite consists of 15 tests can be
classified in 6 categories that were developed to test the good
repartition of the randomness of a binary sequence. These tests
focus on a variety of types of non -randomness that could exist in
a sequence. From this point of view, the test suite can be
classified as follows in table 1:

TABLE I: NIST STATISTICAL TEST SUI TE
Test Number Test name Test category
1 Frequency (Monobit) Frequency tests
2 Frequency test within a
block
3 Run tests
4 Test of the longest run
of 1’s in a block
5 Binary matrix rank test Test of linearity
6 Linear complexity test:
7 Discrete Fourier
transform (spectral)
test Test of
correlation
8 Non-overlapping
template matching Test of finding
some special
strings 9 Overlapping template
matching
10 Maurer’s “Universal
Statistical” Entropy tests
11 Serial
12 Approximate entropy
13 Cumulative sums Random walk
tests 14 Random excursion
15 Random excursion
variant
After executing NIST program on our generated file, The
NIST statistical tests provide a detailed report for each test,
which is saved under :
sts-2.1.1 \experiments \AlgorithmTesting \<Test suite name>
Figure 6.a The snapshots of output RNG file with binary format
Figure 6.b. The snapshots of output RNG file with binary format. Figure 7 : The summarize the different steps to validate our RNG file based
on NIST test suite

The Table II below summarize test result of input file
generated by our approach at 25°c.

TABLE II : NIST STATISTICAL TEST SUI TE RESULT
Test
Number Statistical Test P-VALUE Proportion
1 Frequency 0.911413 10/10
2 BlockFrequency 0.534146 10/10
3 CumulativeSums 0.911413 10/10
4 Runs 0.122325 10/10
5 LongestRun 0.911413 10/10
6 Rank 0.213309 10/10
7 FFT 0.534146 9/10
8 NonOverlappingTempl
ate 0.213309 10/10
9 OverlappingTemplate 0.534146 10/10
10 Universal 0.534146 10/10
11 ApproximateEntropy 0.911413 10/10
12 RandomExcursions –- 3/3
13 RandomExcursions
Variant –- 10/10
14 Serial 0.911413 9/10
15 LinearComplexity 0.534146 10/10

At the end of test report, NIST statistical test suite gives a
conclusion of the tests as below:
“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 = 2 for a sample size = 3 binary
sequences.”
VI. CONCLUSION
This labor aimed todesign a low cost Random number
generator, which serves as a solution to make the deployment
of wireless sensor networks to improve the efficiency of
cryptographic algorithms.
In this paper, we studied and proposed an efficient
implementation for the random number generator (RNG)
based on MCU internal and external resources to be used in
cryptosystems with small size memory and do not need high
level of consumption or any additi onal hardware.
The proposed approach has been implemented on The
SimpleLink™ Sub -1 GHz CC1310 evaluation module kit,
anew development kit made by Texas Instrument, and tested
based on NIST statistical test suite, 15 tests passed in
accordance with the minim um pass rate for each statistical
test.
VII. REFERENCES
[1] Yu Y, Li K, Zhou W, Li P. Trust mechanisms in wireless sensor
networks: attack analysis and countermeasures. Journal of Network
and Computer Applications 2011; 35(3):867 –880. [2] 19. Li Z, Gong G. A survey on security in wireless sensor
networks. Technical Report, Department of Electrical and Computer
Engineering, University of Waterloo: Canada, 2011.
[3] 20. Perrig A, Stankovic J, Wagner D. Security in wireless sensor
networks. Communications of the ACM 2004; 47(6):53 –57.
[4] G. Popek and C. Kline. Encryption and secure computer networks.
ACM Computing Surveys (CSUR), 11(4):331 –356, 1979..
[5] S. Behnia, A. Akhshani, H. Mahmodi, A. Akhavan, Prof. M.S. El
Naschie, “A novel algorithm for image encrypti on based on mixture
of chaotic maps”, Chaos, Solitons and Fractals, DOI:10.1016/j.chaos,
May 2006.
[6] Biham, E. and A. Shamir. (1990). Differential Cryptanalysis of
DES -like Cryptosystems. Advancesin Cryptology — CRYPTO '90.
Springer -Verlag. 2 –21.
[7] Czernik P., Olszyna J.: Cryptographic Random Number
Generators for Low -Power Distributed Measurement System.
Proceedings of SPIE vol. 7502 (75022A), 2009.
[8] Jessa M., Jaworski M.: Generation of binary random sequences. In
Virtex -5, PAK 2010 vol. 07 (p. 681 -684).
[9] B. Barak and S. Halevi. A model and architecture for pseudo –
random generation with applications to /dev/random. Cryptology
ePrint Archive, Report 2005/029, 2005.
[10] Brown R. G.: Dieharder: A Random Number Test Suite,
Duke University,http:// www.p hy.duke.edu/~rgb/General/dieharder.ph p
[11] The BSI test suite for statistical test procedures A and B, which is
available on the BSI website [AIS2031Stat].
[12] The NIST test suite and guidance documentation [SP800 -22],
which is available on the NIST RNG project we bsite describing in
http:csrc.nist.gov/groups/ST/toolkit/ rng/documentation_software.html
[13] Sergio Callegari University of Bologna, Riccardo Rovatti
University of Bologna, Gianluca Setti University of Ferrara
Embeddable ADC -based true random n umber generator for
cryptographic applications exploiting nonlinear signal processing and
chaos in IEEE TRANSACTIONS ON SIGNAL PROCESSING •
MARCH 2005
[14] Sesham Srinu, , Samrat L. Sabat FPGA implementation and
performance study of spectrum sensing based on entropy estimation
using cyclic features in Volume 38, Issue 6, November 2012, Pages
1658 –1669
[15] O. Keren ; Fac. of Eng., Bar -Ilan Univ., Ramat Gan, Israel ; M.
Karpovsky, Relations Between the Entropy of a Source and the Error
Masking Probability fo r Security -Oriented CodesIEEE Transactions
on Communications (Volume:63 , Issue: 1 ) 04 décembre 2014
[16] Vincent van der Leest, Erik van der Sluis, Geert -Jan Schrijen,
Pim Tuyls, and Helena Handschuh “Effcient Implementation of True
Random Number Generator based on SRAM PUFs” in Intrinsic -ID,
Eindhoven, The Netherlands http://www.intrinsic -id.com
[17] Sunar B, Martin WJ, Stinson DR. A provably secure true random
number generator with built -in tolerance to active attacks. IEEE
Transactions on Comput ers 2007; 56(1):109 –119.
[18] Texas Instruments : CC1310 SimpleLink™ Ultra -Low-Power
Sub-1 GHz Wireless MCU (Rev. C) 24 Oct 2016
[19] Texas Instruments : SimpleLink™ CC1310 Evaluation Module
Kit Quick Start Guide (Rev. B) 05 Nov 2015 .

Similar Posts