Safe Haskell | None |
---|---|
Language | Haskell2010 |
Main module generating passwords.
Synopsis
- type WordSet = Set Text
- type WordList = Vector Text
- resolveSymbolicLink :: FilePath -> IO FilePath
- readDict :: FilePath -> IO WordSet
- dictFiles :: FilePath -> IO [FilePath]
- readDicts :: [FilePath] -> IO (Set Text)
- readDictDir :: FilePath -> IO (Set Text)
- defaultDictionary :: FilePath
- randomPassword :: WordList -> Int -> Gen Text
- capitalized :: Text -> Text
- uncapitalized :: Text -> Text
- evenUpperOddLower :: Text -> Text
- evenLowerOddUpper :: Text -> Text
- randomCase :: Gen Text -> Gen Text
- caseVariants :: [Text -> Text]
- randomPasswordStrength :: Vector a -> Int -> Double
- numSymbols :: Int
- numNumericSeparators :: Int
- randomSeparator :: Gen Text
- randomNumericSeparator :: Gen Text
- (|||) :: (t -> Bool) -> (t -> Bool) -> t -> Bool
- randomElement :: Vector a -> Gen a
- symbolChars :: Vector Char
- randomSymbolSeparator :: Gen Text
Documentation
type WordSet = Set Text Source #
Explanatory type alias for the type of wordlists during preprocessing.
type WordList = Vector Text Source #
Explanatory type alias for immutable, preprocessed wordlist used by random number generator.
Reading inputs
resolveSymbolicLink :: FilePath -> IO FilePath Source #
Try to resolve symbolic link chain for given filename.
readDict :: FilePath -> IO WordSet Source #
Reads a dict format to get a list of unique words without any special chars.
defaultDictionary :: FilePath Source #
Filename for default dictionary (should be command line argument or default glob.)
randomPassword :: WordList -> Int -> Gen Text Source #
Pick a random password, given a words list, and a number of words it will contain.
capitalized :: Text -> Text Source #
First character uppercase, all others lowercase
uncapitalized :: Text -> Text Source #
First character lowercase, all others uppercase
evenUpperOddLower :: Text -> Text Source #
Swap case for each letter, starting from upper
evenLowerOddUpper :: Text -> Text Source #
Swap case, starting from lower
caseVariants :: [Text -> Text] Source #
Different uppercase/lowercase variants of each word.
randomPasswordStrength :: Vector a -> Int -> Double Source #
Estimate strength of random password with given inputs.
numSymbols :: Int Source #
Number of characters within alphabet.
numNumericSeparators :: Int Source #
Since we use two-digit separators, there are 100 different.
Random separators
randomSeparator :: Gen Text Source #
Randomly pick a word separator as a two-digit number, or a symbol character.
randomNumericSeparator :: Gen Text Source #
Two-digit number as a separator 10^2 = 6.6 bits of entropy.
randomElement :: Vector a -> Gen a Source #
symbolChars :: Vector Char Source #
List of symbol and punctuation characters in ASCII Should be 5 bits of entropy
randomSymbolSeparator :: Gen Text Source #
Text with random symbol character, 5 bits of entropy