andywer / andywer/threads.js

docs: insecure example

Aperta
#369 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
documentation
Lingua principale
TypeScript
Stelle
3.5k
Fork
173
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

The current Quick Start guide shows an example where a password is hashed using SHA-256 - https://threads.js.org/getting-started

This is not a secure example, and may lead readers without a meter for secure code to copy-paste the example.

- SHA-256 is a *fast* cryptographic hash, and not a key derivation function (like bcrypt or scrypt)
- This means it is NOT suited to "hashing" passwords

_I would suggest using another example entirely that doesn't rely on password hashing_, but if you **must** use it, use the PBKDF2 algorithm from SubtleCrypto to derive a key from the user input, with sufficient rounds.

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.