I am writing my Master's Thesis in cryptography at the moment. The main part deals with randomness; therefore, I wanted to make a little Tikz picture in the introduction to show an example of randomness. Of course, I could create a random string somewhere else and just import it to LaTeX, but this approach feels unsatisfying. My question: Is there a way to access a cryptographic secure random number generator directly from LaTeX, e.g. within a Tikz picture? I assume my solution using random()
from pgf math is not cryptographic secure:
\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\foreach \row in {0,1,...,7}{
\foreach \column in {0,1,...,7}{
\pgfmathparse{random(0,1)}
\ifnum\pgfmathresult=1
\draw[fill, black] (\row, \column) rectangle (\row +1, \column + 1);
\fi
}
}
\end{tikzpicture}
\end{center}
\end{document}
Edit: To be more accurate on the secure part: I am searching for a random generator, that is accepted as a standard, e.g. by Nist. For those more interested in the topic, here is a reference.
pgf
macro-based implementation nor the engine primitives are going to meet the requirement.math.random
function?math.random
function "uses the xoshiro256** algorithm to produce pseudo-random 64-bit integers, which are the results of calls with argument 0. Other results (ranges and floats) are unbiased extracted from these integers." Hopefully, the OP will know whether this explanation indicates that the resulting pseudo random numbers are 'cryptographically secure'.