For a website I am creating we have to store a user id for people that do a test without creating a account. The user id has to be the same for the user if he does te the test 2 times but should also be anonymous, by which I mean not retracable to the person. The only purpose for it is that the ID is the same in the export for a user that does the test more than 1 time.

I have tried thinking of a way but can't get my head around it.

closed as off-topic by Julian Knight, Steve, Xander, this.josh, Matthew May 31 '17 at 8:42

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "This question does not appear to be about Information security within the scope defined in the help center." – Julian Knight, Steve, Xander, this.josh, Matthew
If this question can be reworded to fit the rules in the help center, please edit the question.

  • anonymous is easy: don't record personal info - is your problem how to relate one test to another so that they are linked? – schroeder May 30 '17 at 13:19
  • Yes, the only use for storing the number is so that the different tests are linked together. – Rednos May 30 '17 at 13:21
  • give the user a code to enter when they do tests ..... – schroeder May 30 '17 at 13:25
  • 2
    the problem isn't about the hash, or about anonymity, it's about linking - I'm not sure this is a security problem – schroeder May 30 '17 at 13:27
  • Entering a code is a option but not all users will do that. And this is a problem on how the information stays secure right.. – Rednos May 30 '17 at 13:31

One way to achieve this is to generate UUID's on the server and set a cookie. That then becomes the ID and the client manages it without further need of input from the server.

UPDATE: Just to clarify, using this method stores nothing at all about either the user nor the client, it is in no way identifying other than knowing that it is likely the same cookie comes from the same source. Using a UUID ensures, like a hash, that the number is unique without needing any complex algorithms or user information that might compromise identity.

Really not a security question though.

  • cookie kind of defeats the appearance of anonymity – schroeder May 30 '17 at 13:54
  • @schroeder: well , kind of, because there is no way to identify the user from the cookie. You only know it is the same browser. – Serge Ballesta May 30 '17 at 16:19
  • Actually, unless you include some verification, it is hard to know that it definitely came from the same browser since MitM attacks could spoof that. But I certainly disagree that it defeats anonymity since the cookie doesn't identify the user nor the client, it only contains a random number and one that the user can throw away at any time to get a new one. – Julian Knight May 30 '17 at 19:25

For a website I am creating we have to store a user id for people that do a test without creating a account.

Now hold on right there. The act of creating an account is, arguably, equivalent to the act of storing a user ID. So unless there is something subtle about this requirement, it is a nonsensical requirement.

Maybe the true requirement is that you must create test accounts that do not link to any actual person. The solution for this is anonymization; just create real accounts per your usual process, but use dummy PII. If you need a very large number of accounts, you can take a snapshot of actual user data fro your production database, then write a small program to reset their passwords and randomize their names and other sensitive information.

Not the answer you're looking for? Browse other questions tagged or ask your own question.