I intend to be using a UNIQUEIDENTIFIER
as an access key that users can use to access certain data. The key will act as a password in that sense.
I need to generate multiple such identifiers as part of an INSERT...SELECT
statement. For architectural reasons I want to generate the identifiers server-side in this case.
How can I generate a securely random UNIQUEIDENTIFIER
? Note, that NEWID
would not be random enough as it does not promise any security properties at all. I'm looking for the SQL Server equivalent of System.Security.Cryptography.RandomNumberGenerator because I need unguessable IDs. Anything based on CHECKSUM
, RAND
or GETUTCDATE
would also not qualify.
4
. But the fact that I don't have strong evidence that they might be guessable does not mean that they are not. I cannot base this security decision on this observation.