aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-07 22:59:05 -0700
committerAdam Soltys <[email protected]>2026-08-07 23:29:24 -0700
commit9f99bbdb765fc70373943930d543ce1cde7a5f35 (patch)
tree9b36328df6cc860d8288e4c839a476148b472a51 /lib
parent01784219f83f68c7d03eb19c35f05eeaedc74487 (diff)
downloadcoinos-server-9f99bbdb765fc70373943930d543ce1cde7a5f35.tar.gz
coinos-server-9f99bbdb765fc70373943930d543ce1cde7a5f35.zip
auth: hash passwords at bcrypt cost 12 with transparent upgrade (S2)
Registration, password change, and admin reset all hashed at bcrypt cost 4 (16 rounds, ~1,300 guesses/s/thread) — the single factor gating the custodial balance and the nip49 passphrase for the stored nostr key. Raise all three sites to cost 12, and on successful login re-hash any legacy cost-4 hash now that we hold the verified plaintext. Co-Authored-By: Claude Opus 4.8 <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/register.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/register.ts b/lib/register.ts
index bd1049c8..16aa5b02 100644
--- a/lib/register.ts
+++ b/lib/register.ts
@@ -32,7 +32,7 @@ export default async (user, ip) => {
if (password) {
user.password = await Bun.password.hash(password, {
algorithm: "bcrypt",
- cost: 4,
+ cost: 12,
});
}