We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Passwords must be compared using special functions, see example in nodejs link at the end. A simple == might lead to timing attacks. Therefore I think the examples should say that it is shown "as is" to illustrate a topic but shouldn't be used in production. In this example https://scalatra.org/guides/3.0/http/authentication.html the password is compared with == instead of a special function Extract from guide: protected def validate(userName: String, password: String): Option[User] = { if(userName == "scalatra" && password == "scalatra") Some(User("scalatra")) else None See https://en.wikipedia.org/wiki/Timing_attack https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/security/MessageDigest.html#isEqual(byte%5B%5D,byte%5B%5D)
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Passwords must be compared using special functions, see example in nodejs link at the end.
A simple == might lead to timing attacks.
Therefore I think the examples should say that it is shown "as is" to illustrate a topic but shouldn't be used in production.
In this example https://scalatra.org/guides/3.0/http/authentication.html the password is compared with == instead of a special function
Extract from guide:
protected def validate(userName: String, password: String): Option[User] = {
if(userName == "scalatra" && password == "scalatra") Some(User("scalatra"))
else None
See
https://en.wikipedia.org/wiki/Timing_attack
https://nodejs.org/api/crypto.html#cryptotimingsafeequala-b
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/security/MessageDigest.html#isEqual(byte%5B%5D,byte%5B%5D)
The text was updated successfully, but these errors were encountered: