Michael Shnitzer
Michael Shnitzer

Reputation: 2505

Create a single use link

I'm writing a database front end for a website. Next to the records I want to include a link likes this:

 Record 1 - [Add][1] [Edit][2] [Delete][3]

But I want to protect these links from being used more than once. My thinking is to pass a hash value then store a list of valid HASH values in a table somewhere and only process requests with valid hash values. Is there a better way to do is?

Update: The answer to this question led me to ask this question: What is the difference between a "nonce" and a "GUID"?. Why exactly would you use a nonce instead of a GUID?

Upvotes: 2

Views: 4181

Answers (1)

SLaks
SLaks

Reputation: 887777

Your idea is correct, except that you should use cryptographically secure random bytes (a "nonce") instead of a hash.

Upvotes: 2

Related Questions