News for hackers. Stuff that matters.
Re:Evolution of Random Number Generators by Someone on Sunday May 02, 2021 @09:37AM (#27015171)
Xoring won’t work:

- xoring will only produce permutations that have period two, and every element will be part of a 2-cycle.

- if your n isn’t a power of two, it may produce numbers larger than n

The set of 2-cycles will have a lot of structure, too (for example, if your magic constant is even, all cycles will have either two even numbers or two odd numbers; if it is odd, all cycles will have an even and an odd number), but the above should already be bad enough to drop that idea.

Re:Evolution of Random Number Generators by TekMol on Sunday May 02, 2021 @02:13PM (#27017437)

    if your n isn’t a power of two,
    it may produce numbers larger
    than n
This is the biggest problem.

The others are not such big problems as I don't need strong resemblence to real randomness.

Re:Evolution of Random Number Generators by Someone on Sunday May 02, 2021 @04:13PM (#27018609)
I can’t look into your use case, but I’m not sure you realize how spectacularly bad xoring with a fixed value is as a way to generate a ‘random’ permutation.

For example, it will still alternate odd and even numbers.

Also, an adversary can derive the xor key from a single sample, and predict the entire sequence from it.

Re:Evolution of Random Number Generators by TekMol on Monday May 03, 2021 @01:20AM (#27021867)
Alterning odd and even numbers is fine.

There is no adversary. The use case is not about security.