0
$\begingroup$

Suppose I have a certain sequence of bytes, for example 0102F4829hex, and I can pick from a pseudo-random number generator exactly one number. Is it possible, by using exactly one pseudo-random number each time, to generate all the permutations of the initial sequence of bytes following a uniform distribution?

$\endgroup$
  • $\begingroup$ Uniform? Generally, no. Indistinguishable from uniform? Sure, as long as the "number" is large enough. What's "a number" to you? $\endgroup$ – Maeher May 7 '20 at 20:24
  • $\begingroup$ It is a 32 bytes pseudo-random integer and my sequence of bytes is 32 bytes long as well. $\endgroup$ – Lorenzo May 7 '20 at 20:27
  • $\begingroup$ I am considering the constraint of using exactly one pseudo-random number since I am in a context where I cannot pick pseudo-random numbers until I am satisfied (e.g., until I have a certain number of different pseudo-random numbers). It means that I could not use something like the Fisher-Yates shuffle algorithm to compute permutations. $\endgroup$ – Lorenzo May 7 '20 at 20:45
  • $\begingroup$ Could you share a reference or explain how to do it? $\endgroup$ – Lorenzo May 7 '20 at 20:48
  • $\begingroup$ You can just stretch that value 32 byte value arbitrarily using any secure PRG. E.g. AES-256 in CTR mode. $\endgroup$ – Maeher May 7 '20 at 20:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.