Copyright | © 2018-2021 IOHK |
---|---|
License | Apache-2.0 |
Safe Haskell | None |
Language | Haskell2010 |
Support for verifying hashed passwords from the old wallet codebase.
These passwords were encrypted by the
scrypt
package using the following
parameters:
- logN = 14
- r = 8
- p = 1
- outputLength = 64
It is possible to disable support for legacy password hashing by compiling
with the
-scrypt
Cabal flag.
Synopsis
- checkPassphrase :: Passphrase "encryption" -> PassphraseHash -> Maybe Bool
- preparePassphrase :: Passphrase "user" -> Passphrase "encryption"
- checkPassphraseTestingOnly :: Passphrase "encryption" -> PassphraseHash -> Bool
- encryptPassphraseTestingOnly :: MonadRandom m => Passphrase "encryption" -> m PassphraseHash
- haveScrypt :: Bool
- getSalt :: PassphraseHash -> Maybe ( Passphrase "salt")
- genSalt :: MonadRandom m => m ( Passphrase "salt")
Legacy passphrases
checkPassphrase :: Passphrase "encryption" -> PassphraseHash -> Maybe Bool Source #
Verify a wallet spending password using the legacy Byron scrypt encryption scheme.
preparePassphrase :: Passphrase "user" -> Passphrase "encryption" Source #
Testing-only scrypt password implementation
checkPassphraseTestingOnly :: Passphrase "encryption" -> PassphraseHash -> Bool Source #
This is for use by test cases only. Use only the implementation from the
scrypt
package for application code.
encryptPassphraseTestingOnly :: MonadRandom m => Passphrase "encryption" -> m PassphraseHash Source #
This is for use by test cases only.
Testing-only helper
haveScrypt :: Bool Source #
Internal functions
getSalt :: PassphraseHash -> Maybe ( Passphrase "salt") Source #
Extract salt field from pipe-delimited password hash. This will fail unless there are exactly 5 fields
genSalt :: MonadRandom m => m ( Passphrase "salt") Source #