packages feed

pwstore-fast 2.0 → 2.1

raw patch · 3 files changed

+13/−7 lines, 3 files

Files

Crypto/PasswordStore.hs view
@@ -80,9 +80,10 @@         -- * Utilities         Salt,         isPasswordFormatValid,  -- :: ByteString -> Bool-        genSaltIO,              -- :: IO ByteString-        genSaltRandom,          -- :: (RandomGen b) => b -> (ByteString, b)-        makeSalt                -- :: ByteString -> Salt+        genSaltIO,              -- :: IO Salt+        genSaltRandom,          -- :: (RandomGen b) => b -> (Salt, b)+        makeSalt,               -- :: ByteString -> Salt+        exportSalt              -- :: Salt -> ByteString   ) where  import qualified Crypto.Hash.SHA256 as H@@ -164,8 +165,8 @@ -- | Hash a password with a given strength (12 is a good default). The output of -- this function can be written directly to a password file or -- database. Generates a salt using high-quality randomness from--- @\/dev\/urandom@ or (if that is not available) 'System.Random', which is--- included in the hashed output.+-- @\/dev\/urandom@ or (if that is not available, for example on Windows)+-- 'System.Random', which is included in the hashed output. makePassword :: ByteString -> Int -> IO ByteString makePassword password strength = do   salt <- genSaltIO@@ -239,6 +240,11 @@     where check_length salt | B.length salt < 8 =                                  error "Salt too short. Minimum length is 8 characters."                             | otherwise = salt++-- | Convert a 'Salt' into a 'ByteString'. The resulting 'ByteString' will be+-- base64-encoded. Most users will not need to use this function.+exportSalt :: Salt -> ByteString+exportSalt (SaltBS bs) = bs  -- | Is the format of a password hash valid? Attempts to parse a given password -- hash. Returns 'True' if it parses correctly, and 'False' otherwise.
README.md view
@@ -17,7 +17,7 @@      cabal-install pwstore-fast -[Haddoc docs are here.](http://hackage.haskell.org/packages/archive/pwstore-fast/1.0/doc/html/Crypto-PasswordStore.html)+[Haddoc docs are here.](http://hackage.haskell.org/packages/archive/pwstore-fast/2.0/doc/html/Crypto-PasswordStore.html)   Usage
pwstore-fast.cabal view
@@ -1,5 +1,5 @@ Name:                pwstore-fast-Version:             2.0+Version:             2.1 Synopsis:            Secure password storage. Description:         To store passwords securely, they should be salted,                      then hashed with a slow hash function. This library