generative adversarial networks-based pseudo-random number
TRANSCRIPT
Generative Adversarial Networks-BasedPseudo-Random Number Generator forEmbedded ProcessorsHyunji Kim, Yongbeen Kwon, Minjoo Sim, Sejin Lim,
Hwajeong SeoIT Department, Hansung University, Seoul, Korea
Contentsโข Introductionโข Backgroundโข Proposed Methodโข Evaluationโข Conclusion
Motivation and Contributionโข Motivation
โข Improve the randomness of the previous work.โข Letโs make the Cryptographically Secure Pseudo Random Number
Generator, CSPRNG) for Embedded Processor.
โข Contributionโข Novel GAN based PRNG (DRBG) mechanism design for embedded
processors.โข High randomness validation through NIST test suite.
Random Number Generatorโข Random Number Generator (RNG)
โข Produce a sequence of numbers that cannot be predicted better than by a random chance.
โข True Random Number Generator (TRNG)โข Must produce unpredictable bits even if every detail of the generator is
available.โข Pseudo Random Number Generator (PRNG)
โข Deterministic Random Bit Generator (DRBG) : Generate random numbers by producting the random sequence with perfect balance between 0โs and 1โs.
TensorFlow and TensorFlow Lite
โข TensorFlowโข Open-source software library for machine learning applications, such
as neural networks.โข TensorFlow Lite
โข Official framework for running TensorFlow model inference on edge devices.
Edge TPUโข USB type hardware accelerators.โข ASIC designed to run inference at the edge.โข Support the TensorFlow Lite.โข Small footprint, low power.
Previous GAN based PRNG Implementation
โข Generatorโข Generate random decimal numberโข The range of output : [0,216 โ 1]
โข Predictorโข Used as a discriminator and training data is not required.โข Consist of 4 Conv1D layers.
System Configuration โ Training & inference
๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ ๐ ๐ ๐ ๐ ๐๐
0 โฏ 1โฎ โฑ โฎ
1 โฏ 0
Generaterandom bit stream
0 โฏ 1โฎ โฑ โฎ
1 โฏ 0
๐๐๐๐๐๐๐๐๐๐๐
๐๐๐๐๐๐๐๐๐๐1
0 โฏ 0
Predictrandom bit streamto come after ๐ ๐ ๐๐๐๐๐๐๐๐0
compare
predicted
Split into 2 parts
Generator
Predictor
Trained Generator
EdgeTPU
convert to
TensorFlow Lite
compile &
deploy
IoT Device
Entropy Randomseed
0 โฏ 0โฎ โฑ โฎ0 โฏ 1
Random Bit Stream
inference
input
Training phase Inference phase
The generator modelโข ๐๐,๐๐ are adjustable hyperparameter
โข Determine the number of bits to train.
โข sigmoid activation functionโข Set the number of the desired range through bit-wise training (0 or 1)
instead of training with a specific range of numbers.
1 โฏ 0
โฎ โฎ0 โฏ 1
Generator
Dense
LeakyReLu
Dense
LeakyReLu
Dense
LeakyReLu
Dense
LeakyReLu
Dense
Sigmoid
๐๐
k
Randomseed
The predictor modelโข Split generated bit stream into 2 parts.
โข ๐ ๐ ๐๐๐๐๐๐๐๐๐ : for trainingโข ๐ ๐ ๐๐๐๐๐๐๐๐๐ : for comparision with predicted bit stream
๐ ๐ ๐๐๐๐๐๐๐๐ 1 (๐๐ โ 1)๐๐
๐ ๐ ๐๐๐๐๐๐๐๐ 0 (๐๐ โ 2)1 โฏ 0
โฎ โฎ0 โฏ 1
1 โฏ 0
โฎ0 โฏ 1
generated bit stream
The predictor model โข Using RNN
โข Time series analysis using only CNN is difficult to have a mutual effect as the distance between data increases.
โข RNN is used to predict data following a random walk and have long-term dependency.
โข ๐ณ๐ณ๐ณ๐ณ๐ณ๐ณ๐ณ๐ณ๐ท๐ท = ๐๐๐๐๐๐๐๐( ๐ณ๐ณ๐๐๐๐๐๐๐๐๐๐ โ ๐น๐น๐น๐น๐น๐น๐ท๐ท )
0 โฏ 0
0 โฏ 1Predictor
Conv1D
LeakyReLu
Conv1D
LeakyReLu
Conv1D
LeakyReLu
Dense
SigmoidRNN
๐ ๐ ๐๐๐๐๐๐๐๐ 1
prediction (๐ ๐ ๐ ๐ ๐๐๐๐)
compare
๐ ๐ ๐๐๐๐๐๐๐๐ 0
1 โฏ 0
โฎ
GAN based PRNGโข Training the generator
โข Trough combined model.โข Loss is calculated by ๐ ๐ ๐๐๐๐๐๐๐๐๐ and ๐ ๐ ๐ ๐ ๐๐๐๐ .๐ฟ๐ฟ๐๐๐ ๐ ๐ ๐ ๐บ๐บ = ๐๐๐ ๐ ๐๐๐๐ 1 โ ๐ ๐ ๐๐๐๐๐๐๐๐๐ โ ๐ ๐ ๐ ๐ ๐๐๐๐ ๏ฟฝ 0.5
โข Convert to decimal number.โข ๐๐ โ โ๐๐=0๐๐+๐ก๐กโ1 2๐๐ ๏ฟฝ ๐ ๐ ๐ ๐ ๐๐๐๐๐๐๐๐๐๐ โ ๐๐ ๐๐๐๐๐๐ ๐๐
โข The range of number is determined by setting ๐๐ and ๐๐.
0 โฏ 1โฎ โฑ โฎ
1 โฏ 0
0 โฏ 1โฎ โฑ โฎ
1 โฏ 0
0 โฏ 0
๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ ๐ ๐ ๐ ๐ ๐๐
๐๐๐๐๐๐๐๐๐๐๐
๐๐๐๐๐๐๐๐๐๐1
prediction (๐ ๐ ๐ ๐ ๐๐๐๐)
Generator
Predictor
๐ฟ๐ฟ๐๐๐ ๐ ๐ ๐ ๐บ๐บ
Combined model (Generator + Predictor)
โ ๐๐๐ ๐ ๐๐๐๐๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐๐๐ ๐ ๐๐๐ ๐ ๐๐ (๐๐),๐ ๐ ๐๐๐๐๐ ๐ ๐ ๐ ๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐ ๐๐ (๐๐),๐๐๐๐ ๐ ๐๐๐๐๐๐๐๐๐ ๐ ๐๐ ๐๐๐๐ ๐๐๐๐๐๐๐ ๐ ๐๐๐ ๐ ๐ ๐ ๐๐๐ ๐ ๐๐ ๐๐๐๐ ๐๐๐ ๐ ๐๐๐๐๐ ๐ ๐ ๐ ๐ ๐ ๐๐๐๐ ๐๐๐๐๐๐๐๐๐๐๐๐ ๐๐๐๐๐๐๐๐๐ ๐ ๐๐ (๐๐)
GAN based PRNG for Embedded Processorsโข Deploy only generator model
โข The predictor is not required to generate the random bit stream.
โข Simple architecture for resource-constrained environment.
Trained Generator
EdgeTPU
convert to
TensorFlow Lite
compile &
deploy
IoT Device
GAN based PRNG for Embedded Processorsโข Entropy for random seed
โข The trained generator is a PRNG with a fixed internal state. random seed with
sufficiently high entropy is required.
โข Collected from IoT device.(e.g. sensor data)
Trained Generator
EdgeTPU
convert to
TensorFlow Lite
compile &
deploy
IoT Device
Entropy Randomseed
0 โฏ 0โฎ โฑ โฎ0 โฏ 1
Random Bit Stream
inference
input
Comparison with the previous work
Visualizationโข After training, the internal state changes.โข The generated bit stream is distributed without a pattern.
Visualization of random bit stream generated by the generator. Before training (left) and after training (right).
NIST SP 800-22 : Randomness test for PRNGโข Improving the randomness of PRNG.
โข In the previous work, tests such as frequency and cumulative sums failed because they only used convolution layer.
final analysis report of NIST test suite ; (left) previous work, (right) this work.
NIST SP 800-22 : Randomness test for PRNGโข The failed test instance (๐น๐น๐ผ๐ผ/%) is reduced by about 1.91%.โข No failed p-value (๐น๐น๐๐) in this work.โข The failed individual test (๐น๐น%) is reduced by about 2.5%.
Unpredictability for CSPRNGโข Next bit test
โข The ๐๐ + ๐ ๐๐๐ bit cannot be predicted with the ๐๐-bit.โข The training process means this test, so if the loss is minimized,
the next bit will be unpredictable.
Unpredictability for CSPRNGโข State compromise attack resistance
โข When the internal state of PRNG is known at some time, the output can be predicted after or before.
โข Reseed for each batch to ensure resistance.
๐๐๐๐๐๐๐๐๐๐๐๐๐ ๐ ๐ ๐ ๐ ๐ ๐๐
Generator
reseed
โข Execution environmentโข The PRNGs on desktop : Intel Core i5-8259 [email protected] x 8, 16GB.โข MPCG64 : STM32F4.โข This work : Edge TPU.
Comparison With Existing PRNGs
Conclusion and Future workโข Conclusion
โข GAN based PRNG (DRBG) for embedded processors.โข High randomness validation through the NIST test suite.
โข Future workโข Optimizing to maintain high randomness while being more efficient for
resource-constrained environments.โข Applying other GAN models for high randomness and efficiency.โข Designing a lightweight model through pruning.โข Efficient entropy collection.
Thank you for your attention!