Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 4066

How to safely store API Keys in a database for a REST API?

$
0
0

I'm building a REST API that uses API keys for authentication. I want to ensure that these API keys are stored securely in my database. If I were storing user passwords, I would use Argon2id for hashing. For other types of sensitive user data that require decryption, I would consider using AES encryption.

However, I'm unsure about the best practices for storing API keys. Specifically, I want to know:

  1. Should I hash API keys before storing them in the database, similar to user passwords?
  2. If hashing is recommended, what algorithms are best suited for this purpose?
  3. Are there any specific considerations or best practices for securely storing and managing API keys that differ from handling passwords or other sensitive data?

I reviewed the OWASP guidelines but couldn't find a definitive recommendation on this topic.


Viewing all articles
Browse latest Browse all 4066

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>