From b76c1bd252721547e6365f96d87fe496eab673e1 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sat, 14 Jan 2017 19:32:37 +1100 Subject: Clarify that dollars in cost estimates are USD. This commit was sponsored by Ignacio on Patreon. --- CHANGELOG | 1 + Cost.hs | 6 ++++-- keysafe.1 | 4 ++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index b657f75..5baf899 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ keysafe (0.20161108) UNRELEASED; urgency=medium However, the stack.yaml is still using an old LTS version to avoid polynomial's failure to build with ghc 8.0 (https://github.com/mokus0/polynomial/issues/8) + * Clarify that dollars in cost estimates are USD. -- Joey Hess Tue, 29 Nov 2016 22:27:01 -0400 diff --git a/Cost.hs b/Cost.hs index dc2438e..a18a088 100644 --- a/Cost.hs +++ b/Cost.hs @@ -92,6 +92,7 @@ estimateAttackCost dc opcost = centsToDollars $ costcents newtype Cents = Cents Integer deriving (Num, Integral, Enum, Real, Ord, Eq, Show) +-- | USD newtype Dollars = Dollars Integer deriving (Num, Integral, Enum, Real, Ord, Eq) @@ -103,12 +104,13 @@ instance Show Dollars where , (1000, "thousand") ] where - go [] = "$" ++ show n + go [] = fmt (show n) go ((d, u):us) | n >= d = let n' = n `div` d - in "$" ++ show n' ++ " " ++ u + in fmt (show n' ++ " " ++ u) | otherwise = go us + fmt d = "$" ++ d ++ " (USD)" centsToDollars :: Cents -> Dollars centsToDollars (Cents c) = Dollars (c `div` 100) diff --git a/keysafe.1 b/keysafe.1 index a09bf6f..6b75c8a 100644 --- a/keysafe.1 +++ b/keysafe.1 @@ -28,8 +28,8 @@ the secret key with the password in a way that takes a lot of computation to decrypt. This makes it hard for an attacker to crack your password, because each guess they make costs them. .PP -Keysafe is designed so that it should take millions of dollars of computer -time to crack any fairly good password. With a truly good +Keysafe is designed so that it should take millions of dollars (US) +of computer time to crack any fairly good password. With a truly good password, such as four random words, the cracking cost should be many trillions of dollars. Keysafe checks your password strength (using the zxcvbn library), and shows an estimate of the cost to crack your password, -- cgit v1.2.3