Skip to content

Commit afe496b

Browse files
perpetual-hydrofoilSergio Andrés Virviescas Santana
authored andcommitted
Resolve timing attack vector.
1 parent 8117fc3 commit afe496b

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

examples/auth/README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,17 @@ These examples show you the usage of `router`. You can easily build a web applic
44

55
### Basic Authentication
66

7-
Basic Authentication (RFC 2617) for handles:
7+
This Basic Authentication example uses `simple-scrypt` for password hashing:
8+
9+
go get -u github.com/elithrar/simple-scrypt
10+
11+
Password hashing is used so that if your data store is compromised, the attackers will only have access to hashed passwords, which (if the hash is not itself compromised) will not be able to revert to the original plain text password.
12+
13+
After you have hashed the password and stored the hash in a data store, you should throw away the original plain-text password.
14+
15+
The next time the user attempts to log in, their password will be safely hashed and compared to the saved hash. If the hashes match, then the user will be accepted.
16+
17+
Only use constant time comparison functions that are built into your hash library to compare secret strings like passwords or hashes to prevent timing attacks.
818

919
```go
1020
package main

0 commit comments

Comments
 (0)