summaryrefslogtreecommitdiffhomepage
path: root/Entropy.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-09-14 16:42:26 -0400
committerJoey Hess <joeyh@joeyh.name>2016-09-14 16:59:20 -0400
commita41cbda751d515032859d72656fda3d219300ecb (patch)
treefdc5324c56e0b67b6e74826cd6b8cd742984ecf0 /Entropy.hs
parenta68caf8b54b9d37deeaeddc6a28394d1587f1dc5 (diff)
downloadkeysafe-a41cbda751d515032859d72656fda3d219300ecb.tar.gz
Store information about backed up keys in ~/.keysafe/backup.log
This can be deleted by the user at any time, but it's useful in case a server is known to be compromised, or a problem is found with keysafe's implementation that makes a backup insecure. This commit was sponsored by Nick Daly on Patreon.
Diffstat (limited to 'Entropy.hs')
-rw-r--r--Entropy.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/Entropy.hs b/Entropy.hs
index 7fb5b94..198c798 100644
--- a/Entropy.hs
+++ b/Entropy.hs
@@ -13,12 +13,12 @@ import Text.Password.Strength (estimate, UserDict)
-- | Calculation of the entropy of a password.
-- Uses zxcvbn so takes word lists, and other entropy weakening problems
-- into account.
-passwordEntropy :: Password -> UserDict -> Entropy UnknownPassword
-passwordEntropy (Password p) userdict = Entropy $ floor $
+calcPasswordEntropy :: Password -> UserDict -> Entropy UnknownPassword
+calcPasswordEntropy (Password p) userdict = Entropy $ floor $
estimate (B.toString p) userdict
-- | 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 $
+calcNameEntropy :: Name -> Entropy UnknownName
+calcNameEntropy (Name n) = Entropy $ floor $
estimate (B.toString n) []