Skip to content

macchiato-framework/macchiato-crypto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

a library for securely hashing passwords

Following algorithms are supported:

CircleCI

Clojars Project

Usage

Pick an encryption algorithm, either bcrypt or scrypt:

(require '[macchiato.crypto.<algorithm> :as password])

Then use the encrypt function to apply a secure, one-way encryption algorithm to a password:

(def encrypted (password/encrypt "foobar"))

And the check function to check the encrypted password against a plaintext password:

(password/check "foobar" encrypted) ;; => true

The encrypt and check functions have async versions as well:

(password/encrypt-async
  "secret"
  (fn [err result]
    (is (scrypt/check "secret" result))))

(password/check-async
  "secret"
  (password/encrypt "secret")
  (fn [err result]
    (is result)))

About

Library for securely hashing passwords

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published