What is a best practice for obfuscating unique tokens in logs?

What is a best practice for obfuscating unique tokens in logs?

Unique tokens are emailed to users and that token is what is used to trigger the workflow process. That token is stored encrypted in the database, but when the user clicks the link, the token is shown in clear text in the app logs. How can this best be handled?
alexmac05Asked:
Who is Participating?
 
Julian HansenCommented:
What are your concerns?

If you mail it to the user it is out in the open - if your token is a hash that is unguessable (or close) and a one time use - why do you need to protect it?

If an attacker get get access to your logs he/she can get access to the code that decrypts the data - and your data is exposed anyway.

Trying to understand what it is you want to achieve here?
1
 
alexmac05Author Commented:
What hash function do you recommend for this?

So, perhaps the answer is to have a token that is a hash that is unguessable or close.

All I am trying to achieve is an understanding of best practices about this particular workflow where you have to send a token to a customer in an email that they click that brings them back to the web application for some function and how to do this in a best practice way knowing that the token will be exposed in logs, emails, and on the front-end.

Thank you for your answer and your help!
0
 
nociSoftware EngineerCommented:
Unless correctly encrypted,  any email is a public medium ... (sealed letter vs. picture postcard).
You can use such onetime links to validate email addresses.. not a lot more.
They need to be time constrained anyway.
0
 
alexmac05Author Commented:
I think this is also called a one-click login.
0
 
Julian HansenCommented:
Usual practice is to use a GUID / UUID
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.