我正在爲express.js和postgresql db中的網站安全編碼。現在我一直在閱讀關於salting和hashing的內容,並且我已經使用crypto模塊使用pdkdf2設置了代碼,但是我的問題是我將如何在db中構建帳戶表。如果我將創建一個登錄角色,該角色將具有密碼的MD5加密格式,該密碼將是來自salt n hash「過程」的派生密鑰。這會不會是一種保護措施? 將會有一個表格如下:UID
這個代碼不工作: select *
from persons
where lower(email) = lower({email})
and (password = crypt('{password}', password))
and approved = 1
and now() between start_date and coales