summaryrefslogtreecommitdiffhomepage
path: root/Types.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-16 01:10:33 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-16 01:14:29 -0400
commitd7696832e183cc3e98d094b35ee4392d0c8d3df5 (patch)
tree1d01e6796d359b04f2b09aa509270884a836f737 /Types.hs
parent6c4d1501b1067e47cbf8579eb206a30d9c3a7a1c (diff)
downloadkeysafe-d7696832e183cc3e98d094b35ee4392d0c8d3df5.tar.gz
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.
Diffstat (limited to 'Types.hs')
-rw-r--r--Types.hs13
1 files changed, 0 insertions, 13 deletions
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)