Ideas for non duplicate cryptographically secure numbers My Boss asked me this today. I am not a math major. He needs to generate 50 billion non-sequential non-duplicate (no collisions) cryptographically secure random numbers. I work in GO. Any ideas?
I had to do the exact same thing for unique product identifier codes. In my case they needed to be random looking, not cryptographically secure, so I had more room to work with. I still went with a cryptographic method since that is what I was familiar with.

In your case, you are looking for just under $2^{36}$ values, for which all values are unique, and where guessing the next number in a sequence is infeasible (at least 50 billion possible choices), even when given all previous values.

For this the easiest option is a block cipher with a block size of at least 37-bits performing the encryption operation on an incrementing counter. DES, Blowfish, AES, and others all meet the criteria, the difference being key size, ciphertext size, and hardware support. Since 64-bit Go supports AES hardware acceleration, it is probably your best option.

Simply generate a cryptographically random key, start with an all 0 block, encrypt the block and save the output, increment the input block by treating it as 2 64-bit integers and incrementing the 2nd one (+1), repeat steps as needed until all values are generated. You can generate quadrillions of unique and cryptographically pseudorandom 128-bit values.