This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-02
Channels
- # aws-lambda (1)
- # beginners (28)
- # boot (54)
- # cider (11)
- # clara (28)
- # cljs-dev (74)
- # cljsrn (13)
- # clojure (342)
- # clojure-austin (3)
- # clojure-dusseldorf (4)
- # clojure-france (2)
- # clojure-greece (11)
- # clojure-italy (42)
- # clojure-poland (7)
- # clojure-russia (11)
- # clojure-spec (44)
- # clojure-uk (156)
- # clojure-ukraine (4)
- # clojurescript (102)
- # cursive (17)
- # datascript (19)
- # datomic (17)
- # dirac (39)
- # emacs (22)
- # funcool (56)
- # hoplon (25)
- # jobs (3)
- # jobs-discuss (31)
- # leiningen (2)
- # luminus (4)
- # lumo (3)
- # off-topic (47)
- # om (51)
- # onyx (57)
- # re-frame (13)
- # reagent (57)
- # remote-jobs (15)
- # ring (9)
- # ring-swagger (7)
- # robots (2)
- # rum (6)
- # specter (16)
- # sql (7)
- # test-check (37)
- # untangled (7)
- # yada (5)
@niwinz I have a question regarding buddy-hashers
I’d like to encrypt passwords in a consistent way
I mean encrypting the same password should give the same result
I tried to play with hashers/derive
But the problem is that the :salt
is implicit
Probalby, but how do I generate a good salt?
I need to use (nonce/random-bytes 8)
?
user=> (def salt (nonce/random-bytes 16))
#'user/salt
user=> (hs/derive "foo" {:salt salt})
"bcrypt+sha512$a19816aad5a6dea6c3d927a0fbca8e75$12$c679579c550318d9294c562540526860fc6e8877c7870f85"
user=> (hs/derive "foo" {:salt salt})
"bcrypt+sha512$a19816aad5a6dea6c3d927a0fbca8e75$12$c679579c550318d9294c562540526860fc6e8877c7870f85"
user=> (hs/derive "foo" {:salt salt})
"bcrypt+sha512$a19816aad5a6dea6c3d927a0fbca8e75$12$c679579c550318d9294c562540526860fc6e8877c7870f85"
How do I serialize the salt?
I mean I don’t want to generate a new salt each time my app loads...
Oh. Maybe I’m missing something (I’m not a security expert)
I don’t want to store plain passwords in the db
when a password is derived with derive
function the salt is publicy appended to the result:
bcrypt+sha512$a19816aad5a6dea6c3d927a0fbca8e75$12$c679579c550318d9294c562540526860fc6e8877c7870f85
I’d love to follow the best practice
yep, in this encoding scheme the salt is stored together with the algo, iteration count and the hash
I'm pretty security concerned and buddy-hashers follows the well established best practices for password hashing
it’s confusing when you don’t know that all the algo parameters are stored in the result of derive
By the way, why is it better to have a random salt stored in the encrypted password?
it’s just more convenient, e.g. you only need one column/attribute/property in the database for the whole thing
I mean: why not using the same salt for all the passwords
because the salt additionally to simple append to the final password string it is also feeded into the hasher
the salt should be stored in order to posterior verification, without knowing that salt it will be imposible verify the clear password with "encrypted" one
here, a good explanation of my point: http://security.stackexchange.com/questions/16686/recompute-rainbow-table-with-salt
BTW funcool
is really really cool 😎