Safe Haskell | None |
---|---|
Language | Haskell2010 |
System.POSIX.Crypt.SHA512
Contents
- cryptSHA512 :: ByteString -> ByteString -> Maybe ByteString
- cryptSHA512' :: Maybe Int -> ByteString -> ByteString -> ByteString
- cryptSHA512Raw :: Maybe Int -> ByteString -> ByteString -> ByteString
- encode64 :: ByteString -> ByteString
- encode64List :: [Word8] -> ByteString
Documentation
Arguments
:: ByteString | key |
-> ByteString | salt: |
-> Maybe ByteString |
Pure Haskell implementation of SHA512 crypt
method.
For libc
versions supporting SHA512 encryption scheme (6):
"$6$" `isPrefixOf` salt ==> crypt key salt = cryptSHA512 key salt
a snippet from glibc documentation
glibc
implementations of crypt
support additional encryption algorithms.
If salt is a character string starting with the characters "$id$"
followed by a string terminated by "$"
:
$id$salt$encrypted
then instead of using the DES machine, id identifies the encryption method used and this then determines how the rest of the password string is interpreted.
The id
value 6
corresponds to SHA-512 method (since glibc-2.17
).
If the salt string starts with
rounds=<N>$
where N is an unsigned decimal number the numeric value of N is used to modify the algorithm used. For example:
$6$rounds=77777$salt$encrypted
Arguments
:: Maybe Int | rounds |
-> ByteString | key |
-> ByteString | salt, will be base64 encoded |
-> ByteString |
Split salt-input variant of cryptSHA512
. Salt is encoded.
Arguments
:: Maybe Int | rounds, clamped into |
-> ByteString | key |
-> ByteString | salt, first 16 characters used. |
-> ByteString |
Raw input implementation of cryptSHA512
.
Utilities
encode64 :: ByteString -> ByteString Source #
Custom base64 encoding used by crypt SHA512 scheme.
encode64List :: [Word8] -> ByteString Source #
Custom base64 encoding used by crypt SHA512 scheme. See encode64
.