What are best practices for finding an account in a SQL database during authentication? Is using `LIMIT 1` vulnerable to timing attacks?

I have a application where users can log in by providing a username or email address (both case insensitive) and a password. In the users table in the database, the relevant account information is stored in three columns lowercase_usernam… Continue reading What are best practices for finding an account in a SQL database during authentication? Is using `LIMIT 1` vulnerable to timing attacks?

Does this theoretical salted-hash-sleep scheme mitigate timing attacks?

This question is purely theoretical, I have no intention of ever implementing this scheme in practice. I’m familiar with the shortcomings of sleeping as means of mitigating timing attacks. I’m more interested in this from the attacker’s pe… Continue reading Does this theoretical salted-hash-sleep scheme mitigate timing attacks?

How to prevent a timing attack when I do/don’t perform password_verify (depending if the user exists)?

Here is the code which potentially can allow a timing attack
$user = getUserFromDatabase($input_username);

if ($user === false) { // potential timing attack
// user not exist
http_response_code(401);
echo json_encode(["me… Continue reading How to prevent a timing attack when I do/don’t perform password_verify (depending if the user exists)?

Is using a developer key to protect a REST API good practice?

I’d like to implement a RESTful API service over HTTP that developers can call from their server side environments.
I intend to use a cryptographically secure pseudo-random number generator (CSPRNG) to generate keys and then convert the bi… Continue reading Is using a developer key to protect a REST API good practice?

Should I be concerned about timing attacks on HTTP service for passwordless signin?

I have an service that accepts an HTTP POST request from the end-user’s browser. The user passes their only email. I intend the server to generate a token and store this in a database, and email them the HMAC’d token as a means of implemen… Continue reading Should I be concerned about timing attacks on HTTP service for passwordless signin?

Should I be concerned about timing attacks on HTTP service for passwordless signin?

I have an service that accepts an HTTP POST request from the end-user’s browser. The user passes their only email. I intend the server to generate a token and store this in a database, and email them the HMAC’d token as a means of implemen… Continue reading Should I be concerned about timing attacks on HTTP service for passwordless signin?