Answer the question
In order to leave comments, you need to log in
How to generate a cryptographically secure token for an API?
For authorization in the API, it is necessary to generate unique tokens. What is the best way to do this so that they are truly unique and protected?
I found this function in the manual :
string openssl_random_pseudo_bytes ( int $length [, bool &$crypto_strong ] )
If passed into the function, this will hold a boolean value that determines if the algorithm used was "cryptographically strong", eg, safe for usage with GPG, passwords, etc. TRUE if it did, otherwise FALSE
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question