-%\documentclass{article}
+\documentclass{article}
%\documentclass[10pt,journal,letterpaper,compsoc]{IEEEtran}
-\documentclass[preprint,12pt]{elsarticle}
+%\documentclass[preprint,12pt]{elsarticle}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fullpage}
\usepackage{tabularx}
\usepackage{multirow}
+\usepackage{color}
+
% Pour mathds : les ensembles IR, IN, etc.
\usepackage{dsfont}
\newcommand{\alert}[1]{\begin{color}{blue}\textit{#1}\end{color}}
-
+\begin{document}
\title{Efficient and Cryptographically Secure Generation of Chaotic Pseudorandom Numbers on GPU}
-\begin{document}
-\author{Jacques M. Bahi, Rapha\"{e}l Couturier, Christophe
-Guyeux, and Pierre-Cyrille Héam\thanks{Authors in alphabetic order}}
-
+%% \author{Jacques M. Bahi}
+%% \ead{jacques.bahi@univ-fcomte.fr}
+%% \author{ Rapha\"{e}l Couturier \corref{cor1}}
+%% \ead{raphael.couturier@univ-fcomte.fr}
+%% \cortext[cor1]{Corresponding author}
+%% \author{ Christophe Guyeux}
+%% \ead{christophe.guyeux@univ-fcomte.fr}
+%% \author{ Pierre-Cyrille Héam }
+%% \ead{pierre-cyrille.heam@univ-fcomte.fr}
+
+\author{Christophe Guyeux \and Rapha\"{e}l Couturier \and Pierre-Cyrille Héam \and Jacques M. Bahi\\
+FEMTO-ST Institute, UMR 6174 CNRS,\\ University of Franche Comte, Belfort, France}
+
+\maketitle
+
+
+%\begin{frontmatter}
%\IEEEcompsoctitleabstractindextext{
\begin{abstract}
In this paper we present a new pseudorandom number generator (PRNG) on
\end{abstract}
%}
+%\begin{keyword}
+% pseudo random number\sep parallelization\sep GPU\sep cryptography\sep chaos
+%\end{keyword}
+%\end{frontmatter}
-\maketitle
%\IEEEdisplaynotcompsoctitleabstractindextext
%\IEEEpeerreviewmaketitle
need is to define \emph{secure} generators able to withstand malicious
attacks. Roughly speaking, an attacker should not be able in practice to make
the distinction between numbers obtained with the secure generator and a true random
-sequence. However, in an equivalent formulation, he or she should not be
+sequence. Or, in an equivalent formulation, he or she should not be
able (in practice) to predict the next bit of the generator, having the knowledge of all the
binary digits that have been already released. ``Being able in practice'' refers here
to the possibility to achieve this attack in polynomial time, and to the exponential growth
BigCrush} successfully and all $p-$values are at least once inside
[0.01, 0.99].
Chaos, for its part, refers to the well-established definition of a
-chaotic dynamical system proposed by Devaney~\cite{Devaney}.
+chaotic dynamical system defined by Devaney~\cite{Devaney}.
In a previous work~\cite{bgw09:ip,guyeux10} we have proposed a post-treatment on PRNGs making them behave
as a chaotic dynamical system. Such a post-treatment leads to a new category of
original implementation of this PRNG is also proposed and experimented.
Pseudorandom numbers are generated at a rate of 20GSamples/s, which is faster
than in~\cite{conf/fpga/ThomasHL09,Marsaglia2003} (and with a better
-statistical behavior). Experiments are also provided using BBS as the initial
+statistical behavior). Experiments are also provided using
+\begin{color}{red} the well-known Blum-Blum-Shub
+(BBS)
+\end{color}
+as the initial
random generator. The generation speed is significantly weaker.
-Note also that an original qualitative comparison between topological chaotic
-properties and statistical test is also proposed.
+%Note also that an original qualitative comparison between topological chaotic
+%properties and statistical tests is also proposed.
and on an iteration process called ``chaotic
iterations'' on which the post-treatment is based.
The proposed PRNG and its proof of chaos are given in Section~\ref{sec:pseudorandom}.
-
-Section~\ref{The generation of pseudorandom sequence} illustrates the statistical
-improvement related to the chaotic iteration based post-treatment, for
-our previously released PRNGs and a new efficient
-implementation on CPU.
-
- Section~\ref{sec:efficient PRNG
- gpu} describes and evaluates theoretically the GPU implementation.
+%Section~\ref{The generation of pseudorandom sequence} illustrates the statistical
+%improvement related to the chaotic iteration based post-treatment, for
+%our previously released PRNGs and a new efficient
+%implementation on CPU.
+ Section~\ref{sec:efficient PRNG} %{sec:efficient PRNG
+% gpu}
+ describes and evaluates theoretically new effective versions of
+our pseudorandom generators, in particular with a GPU implementation.
Such generators are experimented in
Section~\ref{sec:experiments}.
We show in Section~\ref{sec:security analysis} that, if the inputted
leading thus to a new PRNG that
should improve the statistical properties of each
generator taken alone.
-Furthermore, the generator obtained in this way possesses various chaos properties that none of the generators used as present input.
+Furthermore, the generator obtained in this way possesses various chaos properties that none of the generators used as input present.
\end{algorithmic}
\end{algorithm}
+
+We have shown in~\cite{bfg12a:ip} that the use of chaotic iterations
+implies an improvement of the statistical properties for all the
+inputted defective generators we have investigated.
+For instance, when considering the TestU01 battery with its 588 tests, we obtained 261
+failures for a PRNG based on the logistic map alone, and
+this number of failures falls below 138 in the Old CI(Logistic,Logistic) generator.
+In the XORshift case (146 failures when considering it alone), the results are more amazing,
+as the chaotic iterations post-treatment makes it fails only 8 tests.
+Further investigations have been systematically realized in \cite{bfg12a:ip}
+using a large set of inputted defective PRNGs, the three most used batteries of
+tests (DieHARD, NIST, and TestU01), and for all the versions of generators we have proposed.
+In all situations, an obvious improvement of the statistical behavior has
+been obtained, reinforcing the impression that chaos leads to statistical
+enhancement~\cite{bfg12a:ip}.
+
\subsection{Improving the Speed of the Former Generator}
Instead of updating only one cell at each iteration, we now propose to choose a
as an integer having $\mathsf{N}$ bits too). More precisely, the $k-$th
component of this state (a binary digit) changes if and only if the $k-$th
digit in the binary decomposition of $S^n$ is 1.
+\begin{color}{red}
+Obviously, when $S$ is periodic of period $p$, then $x$ is periodic too of
+period either $p$ or $2p$, depending of the fact that, after $p$ iterations,
+the state of the system may or not be the same than before these iterations.
+\end{color}
The single basic component presented in Eq.~\ref{equation Oplus} is of
ordinary use as a good elementary brick in various PRNGs. It corresponds
\section{Toward Efficiency and Improvement for CI PRNG}
+\label{sec:efficient PRNG}
\subsection{First Efficient Implementation of a PRNG based on Chaotic Iterations}
-\label{sec:efficient PRNG}
%
%Based on the proof presented in the previous section, it is now possible to
%improve the speed of the generator formerly presented in~\cite{bgw09:ip,guyeux10}.
PRNGs\footnote{we multiply this number by $2$ in order to count 32-bits numbers}
and the pseudorandom numbers generated by our PRNG, is equal to $100,000\times ((4+5+6)\times
2+(1+100))=1,310,000$ 32-bits numbers, that is, approximately $52$Mb.
+\begin{color}{red}
+Remark that the only requirement regarding the seed regarding the security of our PRNG is
+that it must be randomly picked. Indeed, the asymptotic security of BBS guarantees
+that, as the seed length increases, no polynomial time statistical test can
+distinguish the pseudorandom sequences from truly random sequences with non-negligible probability,
+see, \emph{e.g.},~\cite{Sidorenko:2005:CSB:2179218.2179250}.
+\end{color}
This generator is able to pass the whole BigCrush battery of tests, for all
the versions that have been tested depending on their number of threads
array\_comb1, array\_comb2: Arrays containing combinations of size combination\_size\;}
\KwOut{NewNb: array containing random numbers in global memory}
-\If{threadId is concerned} {
- retrieve data from InternalVarXorLikeArray[threadId] in local variables including shared memory and x\;
+\If{threadIdx is concerned} {
+ retrieve data from InternalVarXorLikeArray[threadIdx] in local variables including shared memory and x\;
offset = threadIdx\%combination\_size\;
o1 = threadIdx-offset+array\_comb1[offset]\;
o2 = threadIdx-offset+array\_comb2[offset]\;
\For{i=1 to n} {
t=xor-like()\;
t=t\textasciicircum shmem[o1]\textasciicircum shmem[o2]\;
- shared\_mem[threadId]=t\;
+ shared\_mem[threadIdx]=t\;
x = x\textasciicircum t\;
- store the new PRNG in NewNb[NumThreads*threadId+i]\;
+ store the new PRNG in NewNb[NumThreads*threadIdx+i]\;
}
- store internal variables in InternalVarXorLikeArray[threadId]\;
+ store internal variables in InternalVarXorLikeArray[threadIdx]\;
}
\end{small}
\caption{Main kernel for the chaotic iterations based PRNG GPU efficient
$\mathcal{D}$ is called a $(T,\varepsilon)-$distinguishing attack on pseudorandom
generator $G$ if
-\begin{flushleft}
-$\left| Pr[\mathcal{D}(G(k)) = 1 \mid k \in_R \{0,1\}^\ell ]\right.$
-\end{flushleft}
-
-\begin{flushright}
-$ - \left. Pr[\mathcal{D}(s) = 1 \mid s \in_R \mathds{B}^M ]\right| \geqslant \varepsilon,$
-\end{flushright}
-
+$$\left| Pr[\mathcal{D}(G(k)) = 1 \mid k \in_R \{0,1\}^\ell ]\right. - \left. Pr[\mathcal{D}(s) = 1 \mid s \in_R \mathds{B}^M ]\right| \geqslant \varepsilon,$$
\noindent where the probability is taken over the internal coin flips of $\mathcal{D}$, and the notation
``$\in_R$'' indicates the process of selecting an element at random and uniformly over the
corresponding set.
}
\KwOut{NewNb: array containing random numbers in global memory}
-\If{threadId is concerned} {
- retrieve data from InternalVarBBSArray[threadId] in local variables including shared memory and x\;
+\If{threadIdx is concerned} {
+ retrieve data from InternalVarBBSArray[threadIdx] in local variables including shared memory and x\;
we consider that bbs1 ... bbs8 represent the internal states of the 8 BBS numbers\;
offset = threadIdx\%combination\_size\;
o1 = threadIdx-offset+array\_comb[bbs1\&7][offset]\;
t$<<$=shift\;
t|=BBS2(bbs2)\&array\_shift[shift]\;
t=t\textasciicircum shmem[o1]\textasciicircum shmem[o2]\;
- shared\_mem[threadId]=t\;
+ shared\_mem[threadIdx]=t\;
x = x\textasciicircum t\;
- store the new PRNG in NewNb[NumThreads*threadId+i]\;
+ store the new PRNG in NewNb[NumThreads*threadIdx+i]\;
}
- store internal variables in InternalVarXorLikeArray[threadId] using a rotation\;
+ store internal variables in InternalVarXorLikeArray[threadIdx] using a rotation\;
}
\end{small}
\caption{main kernel for the BBS based PRNG GPU}
c = \left(m_0 \oplus (b_0 \oplus S^0), m_1 \oplus (b_0 \oplus b_1 \oplus S^0), \hdots, \right.
\left. m_{L-1} \oplus (b_0 \oplus b_1 \hdots \oplus b_{L-1} \oplus S^0) \right)
\end{equation*}
-instead of $$\left(m_0 \oplus b_0, m_1 \oplus b_1, \hdots, m_{L-1} \oplus b_{L-1} \right)$$.
+instead of $$\left(m_0 \oplus b_0, m_1 \oplus b_1, \hdots, m_{L-1} \oplus b_{L-1} \right).$$
The same decryption stage as in Blum-Goldwasser leads to the sequence
-$$\left(m_0 \oplus S^0, m_1 \oplus S^0, \hdots, m_{L-1} \oplus S^0 \right)$$.
+$$\left(m_0 \oplus S^0, m_1 \oplus S^0, \hdots, m_{L-1} \oplus S^0 \right).$$
Thus, with a simple use of $S^0$, Alice can obtain the plaintext.
By doing so, the proposed generator is used in place of BBS, leading to
the inheritance of all the properties presented in this paper.
In future work we plan to extend this research, building a parallel PRNG for clusters or
grid computing. Topological properties of the various proposed generators will be investigated,
and the use of other categories of PRNGs as input will be studied too. The improvement
-of Blum-Goldwasser will be deepened. Finally, we
+of Blum-Goldwasser will be deepened.
+\begin{color}{red}
+Another aspect to consider might be different accelerator-based systems like
+Intel Xeon Phi cards and speed measurements using such cards: as heterogeneity of
+supercomputers tends to increase using other accelerators than GPGPUs,
+a Xeon Phi solution might be interesting to investigate.
+\end{color}
+ Finally, we
will try to enlarge the quantity of pseudorandom numbers generated per second either
in a simulation context or in a cryptographic one.