From d7696832e183cc3e98d094b35ee4392d0c8d3df5 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Tue, 16 Aug 2016 01:10:33 -0400 Subject: use zxcvbn-c for fairly good password entropy estimation This should be good enough to let the keysafe UI comment on how good a password the user chooses. --- Types.hs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'Types.hs') diff --git a/Types.hs b/Types.hs index 20ec63e..1b32286 100644 --- a/Types.hs +++ b/Types.hs @@ -8,7 +8,6 @@ module Types where import Types.Cost -import Entropy import qualified Data.ByteString as B import Data.String @@ -42,22 +41,10 @@ type ShardNum = Int newtype Password = Password B.ByteString deriving (IsString) --- | Naive calculation of the entropy of a password. --- Does not take common passwords and password generation patterns into --- account, so this is an overestimation of how hard a password --- is to crack. -passwordEntropy :: Password -> Entropy UnknownPassword -passwordEntropy (Password p) = Entropy $ floor $ totalEntropy p - -- | A name associated with a key stored in keysafe. newtype Name = Name B.ByteString deriving (Show) --- | Very naive calculation of the entropy of a name. --- Assumes that the attacker is not targeting a particular list of names. -nameEntropy :: Name -> Entropy UnknownName -nameEntropy (Name n) = Entropy $ floor $ totalEntropy n - -- | The type of the key that is stored in keysafe. newtype KeyType = KeyType B.ByteString deriving (Show) -- cgit v1.2.3