From 3c3572485544ac8adfe7c5bf85987ad0150fea31 Mon Sep 17 00:00:00 2001 From: Nicolas Pouillard Date: Sat, 17 Jan 2015 00:04:57 +0100 Subject: [PATCH] Add support for PBKDFs Supports version 1 and 2, with sha1, sha256 and sha512. Checked with the test vectors from: RFC6070 https://stackoverflow.com/questions/5130513/pbkdf2-hmac-sha2-test-vectors https://stackoverflow.com/questions/15593184/pbkdf2-hmac-sha-512-test-vectors --- default.nix | 4 +- hx.cabal | 2 +- hx.hs | 51 ++++++++++++++++-- .../TESTRECIPE | 42 +++++++++++++++ .../SHA256PBKDF2-password-salt-1-32.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../SHA256PBKDF2-password-salt-2-32.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../SHA512PBKDF2-password-salt-1-64.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../SHA512PBKDF2-password-salt-2-64.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdin | Bin 0 -> 9 bytes .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ tests/sha1pbkdf2-password-salt-1-20.t/stdin | 1 + tests/sha1pbkdf2-password-salt-1-20.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ tests/sha1pbkdf2-password-salt-2-20.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../sha1pbkdf2-password-salt-4096-20.t/stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdout | 1 + .../TESTRECIPE | 42 +++++++++++++++ .../stdin | Bin 0 -> 9 bytes .../stdout | 1 + 40 files changed, 781 insertions(+), 8 deletions(-) create mode 100644 tests/SHA256PBKDF2-password-salt-1-32.t/TESTRECIPE create mode 100644 tests/SHA256PBKDF2-password-salt-1-32.t/stdout create mode 100644 tests/SHA256PBKDF2-password-salt-2-32.t/TESTRECIPE create mode 100644 tests/SHA256PBKDF2-password-salt-2-32.t/stdout create mode 100644 tests/SHA256PBKDF2-password-salt-4096-32.t/TESTRECIPE create mode 100644 tests/SHA256PBKDF2-password-salt-4096-32.t/stdout create mode 100644 tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/TESTRECIPE create mode 100644 tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/stdout create mode 100644 tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/TESTRECIPE create mode 100644 tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/stdout create mode 100644 tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/TESTRECIPE create mode 100644 tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/stdout create mode 100644 tests/SHA512PBKDF2-password-salt-1-64.t/TESTRECIPE create mode 100644 tests/SHA512PBKDF2-password-salt-1-64.t/stdout create mode 100644 tests/SHA512PBKDF2-password-salt-2-64.t/TESTRECIPE create mode 100644 tests/SHA512PBKDF2-password-salt-2-64.t/stdout create mode 100644 tests/SHA512PBKDF2-password-salt-4096-64.t/TESTRECIPE create mode 100644 tests/SHA512PBKDF2-password-salt-4096-64.t/stdout create mode 100644 tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/TESTRECIPE create mode 100644 tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/stdout create mode 100644 tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE create mode 100644 tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdin create mode 100644 tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdout create mode 100644 tests/sha1pbkdf2-password-salt-1-20.t/TESTRECIPE create mode 100644 tests/sha1pbkdf2-password-salt-1-20.t/stdin create mode 100644 tests/sha1pbkdf2-password-salt-1-20.t/stdout create mode 100644 tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/TESTRECIPE create mode 100644 tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/stdout create mode 100644 tests/sha1pbkdf2-password-salt-2-20.t/TESTRECIPE create mode 100644 tests/sha1pbkdf2-password-salt-2-20.t/stdout create mode 100644 tests/sha1pbkdf2-password-salt-4096-20.t/TESTRECIPE create mode 100644 tests/sha1pbkdf2-password-salt-4096-20.t/stdout create mode 100644 tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/TESTRECIPE create mode 100644 tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/stdout create mode 100644 tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE create mode 100644 tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdin create mode 100644 tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdout diff --git a/default.nix b/default.nix index 828eb2e..4be18da 100644 --- a/default.nix +++ b/default.nix @@ -1,7 +1,7 @@ # This file was auto-generated by cabal2nix. Please do NOT edit manually! { cabal, aeson, attoparsec, base16Bytestring, binary, cryptohash -, either, hashable, haskoin, RFC1751, scientific, text +, either, hashable, haskoin, pbkdf, RFC1751, scientific, text , unorderedContainers }: @@ -13,7 +13,7 @@ cabal.mkDerivation (self: { isExecutable = true; buildDepends = [ aeson attoparsec base16Bytestring binary cryptohash either hashable - haskoin RFC1751 scientific text unorderedContainers + haskoin pbkdf RFC1751 scientific text unorderedContainers ]; meta = { homepage = "https://github.com/np/hx"; diff --git a/hx.cabal b/hx.cabal index 580e40e..adac6f1 100644 --- a/hx.cabal +++ b/hx.cabal @@ -17,7 +17,7 @@ executable hx ghc-options: -Wall build-depends: base >=4.6, haskoin, bytestring, base16-bytestring, scientific, binary, RFC1751 >= 0.3, containers, - aeson, cryptohash, + aeson, cryptohash, pbkdf, -- required by aeson attoparsec, hashable, unordered-containers, text, -- required by haskoin diff --git a/hx.hs b/hx.hs index fbfff9d..09338dc 100644 --- a/hx.hs +++ b/hx.hs @@ -16,6 +16,13 @@ import qualified Data.ByteString.Lazy as LBS import Crypto.MAC.HMAC (hmac) import qualified Crypto.Hash.SHA224 as SHA224 (hash) import qualified Crypto.Hash.SHA384 as SHA384 (hash) +import Crypto.PBKDF (sha1PBKDF1 + ,sha256PBKDF1 + ,sha512PBKDF1 + ,sha1PBKDF2 + ,sha256PBKDF2 + ,sha512PBKDF2 + ) import Network.Haskoin.Crypto import Network.Haskoin.Internals ( curveP, curveN, curveG, integerA, integerB @@ -445,7 +452,26 @@ hx_showtx _ = error "Usage: hx showtx [-j|--json] []" hx_hmac :: String -> (BS -> BS) -> Int -> [BS] -> BS hx_hmac _ h s [key,input] = encodeHex $ hmac h s (decodeHex "hmac key" key) (decodeHex "hmac data" input) -hx_hmac m _ _ _ = error $ "hx hmac-" ++ m ++ " []" +hx_hmac m _ _ _ = error $ "hx hmac-" ++ m ++ " []" + +hx_PBKDF1 :: (String -> String -> Int -> String) -> BS -> [BS] -> IO () +hx_PBKDF1 f m = interactArgsLn go + where + usage = "hx " ++ B8.unpack m ++ " [--hex] [--hex] " + go args0 = let (password,args1) = get_hex_arg "password" usage args0 + (salt,args2) = get_hex_arg "salt" usage args1 + (count,args3) = get_int_arg "count" usage args2 + in no_args usage args3 . B8.pack $ f (B8.unpack password) (B8.unpack salt) count + +hx_PBKDF2 :: (String -> String -> Int -> Int -> String) -> BS -> [BS] -> IO () +hx_PBKDF2 f m = interactArgsLn go + where + usage = "hx " ++ B8.unpack m ++ " [--hex] [--hex] " + go args0 = let (password,args1) = get_hex_arg "password" usage args0 + (salt,args2) = get_hex_arg "salt" usage args1 + (count,args3) = get_int_arg "count" usage args2 + (len,args4) = get_int_arg "length" usage args3 + in no_args usage args4 . B8.pack $ f (B8.unpack password) (B8.unpack salt) count len chksum32_encode :: BS -> BS chksum32_encode d = d <> encode' (chksum32 d) @@ -561,6 +587,12 @@ mainArgs ("hmac-sha224":args) = interactArgsLn (hx_hmac "sha224" SHA224.h mainArgs ("hmac-sha256":args) = interactArgsLn (hx_hmac "sha256" hash256BS 64) args mainArgs ("hmac-sha384":args) = interactArgsLn (hx_hmac "sha384" SHA384.hash 128) args mainArgs ("hmac-sha512":args) = interactArgsLn (hx_hmac "sha512" hash512BS 128) args +mainArgs (arg@"sha1pbkdf1":args) = hx_PBKDF1 sha1PBKDF1 arg args +mainArgs (arg@"sha256pbkdf1":args) = hx_PBKDF1 sha256PBKDF1 arg args +mainArgs (arg@"sha512pbkdf1":args) = hx_PBKDF1 sha512PBKDF1 arg args +mainArgs (arg@"sha1pbkdf2":args) = hx_PBKDF2 sha1PBKDF2 arg args +mainArgs (arg@"sha256pbkdf2":args) = hx_PBKDF2 sha256PBKDF2 arg args +mainArgs (arg@"sha512pbkdf2":args) = hx_PBKDF2 sha512PBKDF2 arg args mainArgs ("chksum32":args) = interactArgs hx_chksum32 args mainArgs ("chksum32-encode":args) = interactArgs hx_chksum32_encode args @@ -707,10 +739,19 @@ mainArgs _ = error $ unlines ["Unexpected arguments." ,"hx hash256 [0]" ,"" ,"# HASH BASED MACs" - ,"hx hmac-sha224 [] [0]" - ,"hx hmac-sha256 [] [0]" - ,"hx hmac-sha384 [] [0]" - ,"hx hmac-sha512 [] [0]" + -- TODO the second argument is not optional yet + ,"hx hmac-sha224 [] [0]" + ,"hx hmac-sha256 [] [0]" + ,"hx hmac-sha384 [] [0]" + ,"hx hmac-sha512 [] [0]" + ,"" + ,"# PASSWORD BASED KEY DERIVATION FUNCTIONS" + ,"hx sha1pbkdf1 [--hex] [--hex] [0]" + ,"hx sha256pbkdf1 [--hex] [--hex] [0]" + ,"hx sha512pbkdf1 [--hex] [--hex] [0]" + ,"hx sha1pbkdf2 [--hex] [--hex] [0]" + ,"hx sha256pbkdf2 [--hex] [--hex] [0]" + ,"hx sha512pbkdf2 [--hex] [--hex] [0]" ,"" ,"[0]: Not available in sx" ,"[1]: `hx showtx` is always using JSON output," diff --git a/tests/SHA256PBKDF2-password-salt-1-32.t/TESTRECIPE b/tests/SHA256PBKDF2-password-salt-1-32.t/TESTRECIPE new file mode 100644 index 0000000..f9cf97b --- /dev/null +++ b/tests/SHA256PBKDF2-password-salt-1-32.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA256PBKDF2-password-salt-1-32.t +command=hx +args=( SHA256PBKDF2 password salt 1 32 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA256PBKDF2-password-salt-1-32.t/stdout b/tests/SHA256PBKDF2-password-salt-1-32.t/stdout new file mode 100644 index 0000000..c00b3ce --- /dev/null +++ b/tests/SHA256PBKDF2-password-salt-1-32.t/stdout @@ -0,0 +1 @@ +120fb6cffcf8b32c43e7225256c4f837a86548c92ccc35480805987cb70be17b diff --git a/tests/SHA256PBKDF2-password-salt-2-32.t/TESTRECIPE b/tests/SHA256PBKDF2-password-salt-2-32.t/TESTRECIPE new file mode 100644 index 0000000..ebe5ab2 --- /dev/null +++ b/tests/SHA256PBKDF2-password-salt-2-32.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA256PBKDF2-password-salt-2-32.t +command=hx +args=( SHA256PBKDF2 password salt 2 32 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA256PBKDF2-password-salt-2-32.t/stdout b/tests/SHA256PBKDF2-password-salt-2-32.t/stdout new file mode 100644 index 0000000..6e2ce71 --- /dev/null +++ b/tests/SHA256PBKDF2-password-salt-2-32.t/stdout @@ -0,0 +1 @@ +ae4d0c95af6b46d32d0adff928f06dd02a303f8ef3c251dfd6e2d85a95474c43 diff --git a/tests/SHA256PBKDF2-password-salt-4096-32.t/TESTRECIPE b/tests/SHA256PBKDF2-password-salt-4096-32.t/TESTRECIPE new file mode 100644 index 0000000..fc7a334 --- /dev/null +++ b/tests/SHA256PBKDF2-password-salt-4096-32.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA256PBKDF2-password-salt-4096-32.t +command=hx +args=( SHA256PBKDF2 password salt 4096 32 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA256PBKDF2-password-salt-4096-32.t/stdout b/tests/SHA256PBKDF2-password-salt-4096-32.t/stdout new file mode 100644 index 0000000..d1b833b --- /dev/null +++ b/tests/SHA256PBKDF2-password-salt-4096-32.t/stdout @@ -0,0 +1 @@ +c5e478d59288c841aa530db6845c4c8d962893a001ce4e11a4963873aa98134a diff --git a/tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/TESTRECIPE b/tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/TESTRECIPE new file mode 100644 index 0000000..ce263a3 --- /dev/null +++ b/tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t +command=hx +args=( SHA256PBKDF2 passwordPASSWORDpassword saltSALTsaltSALTsaltSALTsaltSALTsalt 4096 40 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/stdout b/tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/stdout new file mode 100644 index 0000000..5dc072c --- /dev/null +++ b/tests/SHA256PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-40.t/stdout @@ -0,0 +1 @@ +348c89dbcbd32b2f32d814b8116e84cf2b17347ebc1800181c4e2a1fb8dd53e1c635518c7dac47e9 diff --git a/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/TESTRECIPE b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/TESTRECIPE new file mode 100644 index 0000000..e6620c6 --- /dev/null +++ b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t +command=hx +args=( SHA512PBKDF2 gloom\ knee\ orient\ skull\ dance\ awake\ payment\ unusual\ inflict\ cinnamon\ blush\ seed\ elder\ crawl\ size\ catch\ inflict\ perfect\ foster\ sugar\ fox mnemonic 2048 64 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/stdout b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/stdout new file mode 100644 index 0000000..71b7f7e --- /dev/null +++ b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonic-2048-64.t/stdout @@ -0,0 +1 @@ +1929625a9cb3ff0fc1a2bc5288807730469969278dc9629926a862cf3932bd888cb0d621f818ee7bee359281e9aa08f35deaa0dd559be5041bbc4c64ff57d7c6 diff --git a/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/TESTRECIPE b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/TESTRECIPE new file mode 100644 index 0000000..6a9e55b --- /dev/null +++ b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t +command=hx +args=( SHA512PBKDF2 gloom\ knee\ orient\ skull\ dance\ awake\ payment\ unusual\ inflict\ cinnamon\ blush\ seed\ elder\ crawl\ size\ catch\ inflict\ perfect\ foster\ sugar\ fox mnemonichunter2 2048 64 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/stdout b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/stdout new file mode 100644 index 0000000..0fa513d --- /dev/null +++ b/tests/SHA512PBKDF2-gloom-knee-orient-skull-dance-awake-payment-unusual-inflict-cinnamon-blush-seed-elder-crawl-size-catch-inflict-perfect-foster-sugar-fox-mnemonichunter2-2048-64.t/stdout @@ -0,0 +1 @@ +07630c4bd98dce320c60d103323907252ffedc4c68d7564e5536077f696946bd247532152ae61d4b7c34a5883ee30d2e691ad184818d3b6e68e4f93089ad8bbd diff --git a/tests/SHA512PBKDF2-password-salt-1-64.t/TESTRECIPE b/tests/SHA512PBKDF2-password-salt-1-64.t/TESTRECIPE new file mode 100644 index 0000000..63533c3 --- /dev/null +++ b/tests/SHA512PBKDF2-password-salt-1-64.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA512PBKDF2-password-salt-1-64.t +command=hx +args=( SHA512PBKDF2 password salt 1 64 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA512PBKDF2-password-salt-1-64.t/stdout b/tests/SHA512PBKDF2-password-salt-1-64.t/stdout new file mode 100644 index 0000000..af34254 --- /dev/null +++ b/tests/SHA512PBKDF2-password-salt-1-64.t/stdout @@ -0,0 +1 @@ +867f70cf1ade02cff3752599a3a53dc4af34c7a669815ae5d513554e1c8cf252c02d470a285a0501bad999bfe943c08f050235d7d68b1da55e63f73b60a57fce diff --git a/tests/SHA512PBKDF2-password-salt-2-64.t/TESTRECIPE b/tests/SHA512PBKDF2-password-salt-2-64.t/TESTRECIPE new file mode 100644 index 0000000..9e06cd7 --- /dev/null +++ b/tests/SHA512PBKDF2-password-salt-2-64.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA512PBKDF2-password-salt-2-64.t +command=hx +args=( SHA512PBKDF2 password salt 2 64 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA512PBKDF2-password-salt-2-64.t/stdout b/tests/SHA512PBKDF2-password-salt-2-64.t/stdout new file mode 100644 index 0000000..e81d9f0 --- /dev/null +++ b/tests/SHA512PBKDF2-password-salt-2-64.t/stdout @@ -0,0 +1 @@ +e1d9c16aa681708a45f5c7c4e215ceb66e011a2e9f0040713f18aefdb866d53cf76cab2868a39b9f7840edce4fef5a82be67335c77a6068e04112754f27ccf4e diff --git a/tests/SHA512PBKDF2-password-salt-4096-64.t/TESTRECIPE b/tests/SHA512PBKDF2-password-salt-4096-64.t/TESTRECIPE new file mode 100644 index 0000000..e742827 --- /dev/null +++ b/tests/SHA512PBKDF2-password-salt-4096-64.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA512PBKDF2-password-salt-4096-64.t +command=hx +args=( SHA512PBKDF2 password salt 4096 64 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA512PBKDF2-password-salt-4096-64.t/stdout b/tests/SHA512PBKDF2-password-salt-4096-64.t/stdout new file mode 100644 index 0000000..a36f3a1 --- /dev/null +++ b/tests/SHA512PBKDF2-password-salt-4096-64.t/stdout @@ -0,0 +1 @@ +d197b1b33db0143e018b12f3d1d1479e6cdebdcc97c5c0f87f6902e072f457b5143f30602641b3d55cd335988cb36b84376060ecd532e039b742a239434af2d5 diff --git a/tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/TESTRECIPE b/tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/TESTRECIPE new file mode 100644 index 0000000..e70850b --- /dev/null +++ b/tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t +command=hx +args=( SHA512PBKDF2 passwordPASSWORDpassword saltSALTsaltSALTsaltSALTsaltSALTsalt 4096 64 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/stdout b/tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/stdout new file mode 100644 index 0000000..ed49ecd --- /dev/null +++ b/tests/SHA512PBKDF2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-64.t/stdout @@ -0,0 +1 @@ +8c0511f4c6e597c6ac6315d8f0362e225f3c501495ba23b868c005174dc4ee71115b59f9e60cd9532fa33e0f75aefe30225c583a186cd82bd4daea9724a3d3b8 diff --git a/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE b/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE new file mode 100644 index 0000000..d25336c --- /dev/null +++ b/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha1pbkdf2-pass0word-sa0lt-4096-16.t +command=hx +args=( sha1pbkdf2 - --hex 7361006c74 4096 16 ) +exit_code=0 +stdin_file=stdin +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdin b/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdin new file mode 100644 index 0000000000000000000000000000000000000000..71c30a878a020b981eee777bcbd7ee0034e507b4 GIT binary patch literal 9 QcmXR&EG}j!&o4>=01-(8bN~PV literal 0 HcmV?d00001 diff --git a/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdout b/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdout new file mode 100644 index 0000000..38fc11b --- /dev/null +++ b/tests/sha1pbkdf2-pass0word-sa0lt-4096-16.t/stdout @@ -0,0 +1 @@ +56fa6aa75548099dcc37d7f03425e0c3 diff --git a/tests/sha1pbkdf2-password-salt-1-20.t/TESTRECIPE b/tests/sha1pbkdf2-password-salt-1-20.t/TESTRECIPE new file mode 100644 index 0000000..9bf5438 --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-1-20.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha1pbkdf2-password-salt-1-20.t +command=hx +args=( sha1pbkdf2 password --hex - 1 20 ) +exit_code=0 +stdin_file=stdin +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha1pbkdf2-password-salt-1-20.t/stdin b/tests/sha1pbkdf2-password-salt-1-20.t/stdin new file mode 100644 index 0000000..114d719 --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-1-20.t/stdin @@ -0,0 +1 @@ +73616c74 diff --git a/tests/sha1pbkdf2-password-salt-1-20.t/stdout b/tests/sha1pbkdf2-password-salt-1-20.t/stdout new file mode 100644 index 0000000..4abbd0c --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-1-20.t/stdout @@ -0,0 +1 @@ +0c60c80f961f0e71f3a9b524af6012062fe037a6 diff --git a/tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/TESTRECIPE b/tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/TESTRECIPE new file mode 100644 index 0000000..a538e4b --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha1pbkdf2-password-salt-16777216-20.t +command=hx +args=( sha1pbkdf2 password salt 16777216 20 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/stdout b/tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/stdout new file mode 100644 index 0000000..3638e9a --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-16777216-20.t.TOO-SLOW/stdout @@ -0,0 +1 @@ +eefe3d61cd4da4e4e9945b3d6ba2158c2634e984 diff --git a/tests/sha1pbkdf2-password-salt-2-20.t/TESTRECIPE b/tests/sha1pbkdf2-password-salt-2-20.t/TESTRECIPE new file mode 100644 index 0000000..205e714 --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-2-20.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha1pbkdf2-password-salt-2-20.t +command=hx +args=( sha1pbkdf2 password --hex 73616c74 2 20 ) +exit_code=0 +stdin_file=/dev/stdin +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha1pbkdf2-password-salt-2-20.t/stdout b/tests/sha1pbkdf2-password-salt-2-20.t/stdout new file mode 100644 index 0000000..07492d6 --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-2-20.t/stdout @@ -0,0 +1 @@ +ea6c014dc72d6f8ccd1ed92ace1d41f0d8de8957 diff --git a/tests/sha1pbkdf2-password-salt-4096-20.t/TESTRECIPE b/tests/sha1pbkdf2-password-salt-4096-20.t/TESTRECIPE new file mode 100644 index 0000000..dbf6907 --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-4096-20.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha1pbkdf2-password-salt-4096-20.t +command=hx +args=( sha1pbkdf2 password salt 4096 20 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha1pbkdf2-password-salt-4096-20.t/stdout b/tests/sha1pbkdf2-password-salt-4096-20.t/stdout new file mode 100644 index 0000000..85d8102 --- /dev/null +++ b/tests/sha1pbkdf2-password-salt-4096-20.t/stdout @@ -0,0 +1 @@ +4b007901b765489abead49d926f721d065a429c1 diff --git a/tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/TESTRECIPE b/tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/TESTRECIPE new file mode 100644 index 0000000..0bde19b --- /dev/null +++ b/tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t +command=hx +args=( sha1pbkdf2 passwordPASSWORDpassword saltSALTsaltSALTsaltSALTsaltSALTsalt 4096 25 ) +exit_code=0 +stdin_file=/dev/null +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/stdout b/tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/stdout new file mode 100644 index 0000000..da32d64 --- /dev/null +++ b/tests/sha1pbkdf2-passwordPASSWORDpassword-saltSALTsaltSALTsaltSALTsaltSALTsalt-4096-25.t/stdout @@ -0,0 +1 @@ +3d2eec4fe41c849b80c8d83662c0e44a8b291a964cf2f07038 diff --git a/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE b/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE new file mode 100644 index 0000000..a4b2dfe --- /dev/null +++ b/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/TESTRECIPE @@ -0,0 +1,42 @@ +#!/bin/bash + +testname=sha256pbkdf2-pass0word-sa0lt-4096-16.t +command=hx +args=( sha256pbkdf2 - --hex 7361006c74 4096 16 ) +exit_code=0 +stdin_file=stdin +stdout_file=stdout +stderr_file=/dev/null +sources=( ) +products=( ) + +# Environment variables: +env_vars=( ) + +setup(){ + : Perform here actions to be run before the tested program +} + +munge(){ + : Munge here the results of the tested program to ease the check +} + +check(){ + check_exit_code && + check_stderr && + check_stdout && + check_products && + : Perform here extra checks on the tested program +} + +explain(){ + explain_exit_code + explain_stdout + explain_stderr + explain_products + : Explain here more potential differences +} + +teardown(){ + : Undo here the actions of setup +} diff --git a/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdin b/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdin new file mode 100644 index 0000000000000000000000000000000000000000..71c30a878a020b981eee777bcbd7ee0034e507b4 GIT binary patch literal 9 QcmXR&EG}j!&o4>=01-(8bN~PV literal 0 HcmV?d00001 diff --git a/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdout b/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdout new file mode 100644 index 0000000..c1776f8 --- /dev/null +++ b/tests/sha256pbkdf2-pass0word-sa0lt-4096-16.t/stdout @@ -0,0 +1 @@ +89b69d0516f829893c696226650a8687