summaryrefslogtreecommitdiffhomepage
path: root/keysafe.hs
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-08-11 20:10:55 -0400
committerJoey Hess <joeyh@joeyh.name>2016-08-11 20:10:55 -0400
commitf5a53103a95b93f5cdb3cfe0c7043c190e591f0c (patch)
tree834ff21f410a3502b268cb95a0a679a76311f4e3 /keysafe.hs
parent4ff25ca59ecb0ccba00b60dd542e8bc7e99b1206 (diff)
downloadkeysafe-f5a53103a95b93f5cdb3cfe0c7043c190e591f0c.tar.gz
show brute force cost estimate
Diffstat (limited to 'keysafe.hs')
-rw-r--r--keysafe.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/keysafe.hs b/keysafe.hs
index 112ac54..d73ff61 100644
--- a/keysafe.hs
+++ b/keysafe.hs
@@ -10,6 +10,7 @@ module Main where
import Types
import Tunables
import Encryption
+import Cost
import Shard
import Storage
import Storage.LocalFiles
@@ -22,12 +23,15 @@ main = do
storedemo :: IO ()
storedemo = do
kek <- genKeyEncryptionKey tunables name password
+ putStrLn "Very rough estimate of cost to brute-force the password:"
+ print $ estimateAttack spotAWS $ estimateBruteforceOf kek
+ (passwordEntropy password)
let esk = encrypt kek secretkey
let sis = shardIdents tunables name keyid
shards <- genShards esk tunables
print =<< mapM (uncurry (storeShard localFiles)) (zip (getIdents sis) shards)
where
- password = Password "foo"
+ password = Password "correct horse battery staple"
name = Name "bar"
tunables = testModeTunables -- defaultTunables
keyid = KeyId gpgKey "foobar"