I have been pondering this security issue and not exactly sure how to go about this. On my site people will be able to print out flyers and post them somewhere (like a university) and take a picture of themselves next to it. In return they will receive a user upgrade.
These are some of the problems that I have thought of:
- Users can print one flyer and take pictures in all sorts of places
- User can take a picture, turn the corner and take another picture
- Person A posts a flyer, Person B comes up and claims it as their own
Some possible solutions:
- Write the person’s username on the flyer when printing out
- Have the user hold a piece of paper with their username and date
- Limit to 1 photo per week
- Print a barcode, alphanumeric code, or something else on the flyer as well.
My main focus for this question is the last solution. I have been thinking of storing a random salt for each time a flyer is printed.
What are other ways to keep the flyers as secure? (I know it’s not possible to fully secure it.)
Programming Question: How should I generate a random code for each flyer? And how do I later verify it versus my system?
Use the username plus the current timestamp, then do a sha1() to the result. That should give you a very unique code.
For example