diff --git a/Cargo.lock b/Cargo.lock index 1a099d2..5df3535 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,8 +36,8 @@ name = "atty" version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -53,11 +53,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "bdflib" -version = "0.2.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "xz2 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -173,6 +176,15 @@ dependencies = [ "build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crossbeam-channel" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "crossbeam-deque" version = "0.7.3" @@ -193,7 +205,7 @@ dependencies = [ "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -216,6 +228,15 @@ dependencies = [ "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crypto-mac" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)", + "subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "des" version = "0.3.0" @@ -231,19 +252,22 @@ name = "destools" version = "0.1.0" dependencies = [ "base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "bdflib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bdflib 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", "benchlib-rs 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "cfb-mode 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "des 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)", "pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "rayon 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)", - "regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)", "rpassword 4.0.5 (registry+https://github.com/rust-lang/crates.io-index)", "sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "spinners 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -269,7 +293,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -298,7 +322,7 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -312,10 +336,19 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.1.8" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hmac" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", + "digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -325,7 +358,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "libc" -version = "0.2.67" +version = "0.2.68" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -334,7 +367,7 @@ version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.50 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -350,10 +383,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "memoffset" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -361,8 +394,8 @@ name = "num_cpus" version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "hermit-abi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -380,7 +413,7 @@ name = "pbr" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.5 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", @@ -398,31 +431,31 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "proc-macro-error" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro-error-attr 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-error-attr 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro-error-attr" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", "syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", "version_check 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "proc-macro2" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -438,7 +471,7 @@ name = "quote" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -447,7 +480,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "rand_chacha 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "rand_core 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "rand_hc 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -525,7 +558,7 @@ dependencies = [ [[package]] name = "regex" -version = "1.3.5" +version = "1.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "aho-corasick 0.7.10 (registry+https://github.com/rust-lang/crates.io-index)", @@ -544,7 +577,7 @@ name = "rpassword" version = "4.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -559,32 +592,11 @@ dependencies = [ "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "scopeguard" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "sha2" version = "0.8.1" @@ -631,24 +643,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "structopt" -version = "0.3.11" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "structopt-derive 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)", + "structopt-derive 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "structopt-derive" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro-error 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro-error 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -665,6 +677,11 @@ dependencies = [ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "subtle" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "syn" version = "0.11.11" @@ -677,10 +694,10 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-xid 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -690,9 +707,9 @@ name = "syn-mid" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)", "quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -717,7 +734,7 @@ name = "termion" version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -744,7 +761,7 @@ name = "time" version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)", "winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -825,7 +842,7 @@ dependencies = [ "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" "checksum base64 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" -"checksum bdflib 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3462a43309b1dcdf09f2158552e19e48b27ddf77cfdcbf28bf716153b5bcded0" +"checksum bdflib 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "3f8650e45088248c307853a3a56bd2dc48651425dde522e1c176b717cf4bcfac" "checksum benchlib-rs 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "57e08932403b5810697eb9759dcaf839d1f03d65192b1dbbba5a888ae10d4e85" "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum blake2b_simd 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "d8fb2d74254a3a0b5cac33ac9f8ed0e44aa50378d9dbb2e5d83bd21ed1dc2c8a" @@ -841,10 +858,12 @@ dependencies = [ "checksum clap 2.33.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5067f5bb2d80ef5d68b4c87db81601f0b75bca627bc2ef76b141d7b846a3c6d9" "checksum constant_time_eq 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" "checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" +"checksum crossbeam-channel 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cced8691919c02aac3cb0a1bc2e9b73d89e832bf9a06fc579d4e71b68a2da061" "checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" "checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" "checksum crossbeam-queue 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c695eeca1e7173472a32221542ae469b3e9aac3a4fc81f7696bcad82029493db" "checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" +"checksum crypto-mac 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" "checksum des 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74ba5f1b5aee9772379c2670ba81306e65a93c0ee3caade7a1d22b188d88a3af" "checksum digest 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" "checksum dirs 2.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "13aea89a5c93364a98e9b37b2fa237effbb694d5cfe01c5b70941f7eb087d5e3" @@ -854,22 +873,23 @@ dependencies = [ "checksum generic-array 0.12.3 (registry+https://github.com/rust-lang/crates.io-index)" = "c68f0274ae0e023facc3c97b2e00f076be70e254bc851d972503b328db79b2ec" "checksum getrandom 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" "checksum heck 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" -"checksum hermit-abi 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1010591b26bbfe835e9faeabeb11866061cc7dcebffd56ad7d0942d0e61aefd8" +"checksum hermit-abi 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "725cf19794cf90aa94e65050cb4191ff5d8fa87a498383774c47b332e3af952e" +"checksum hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "5dcb5e64cda4c23119ab41ba960d1e170a774c8e4b9d9e6a9bc18aabf5e59695" "checksum lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -"checksum libc 0.2.67 (registry+https://github.com/rust-lang/crates.io-index)" = "eb147597cdf94ed43ab7a9038716637d2d1bf2bc571da995d0028dec06bd3018" +"checksum libc 0.2.68 (registry+https://github.com/rust-lang/crates.io-index)" = "dea0c0405123bba743ee3f91f49b1c7cfb684eef0da0a50110f758ccf24cdff0" "checksum lzma-sys 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "53e48818fd597d46155132bbbb9505d6d1b3d360b4ee25cfa91c406f8a90fe91" "checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" -"checksum memoffset 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "75189eb85871ea5c2e2c15abbdd541185f63b408415e5051f5cac122d8c774b9" +"checksum memoffset 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b4fc2c02a7e374099d4ee95a193111f72d2110197fe200272371758f6c3643d8" "checksum num_cpus 1.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "46203554f085ff89c235cd12f7075f3233af9b11ed7c9e16dfe2560d03313ce6" "checksum numtoa 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f8bdf33df195859076e54ab11ee78a1b208382d3a26ec40d142ffc1ecc49ef" "checksum opaque-debug 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" "checksum pbr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4403eb718d70c03ee279e51737782902c68cca01e870a33b6a2f9dfb50b9cd83" "checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" "checksum ppv-lite86 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" -"checksum proc-macro-error 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e7959c6467d962050d639361f7703b2051c43036d03493c36f01d440fdd3138a" -"checksum proc-macro-error-attr 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "e4002d9f55991d5e019fb940a90e1a95eb80c24e77cb2462dd4dc869604d543a" -"checksum proc-macro2 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6c09721c6781493a2a492a96b5a5bf19b65917fe6728884e7c44dd0c60ca3435" +"checksum proc-macro-error 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "18f33027081eba0a6d8aba6d1b1c3a3be58cbb12106341c2d5759fcd9b5277e7" +"checksum proc-macro-error-attr 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "8a5b4b77fdb63c1eca72173d68d24501c54ab1269409f6b672c85deb18af69de" +"checksum proc-macro2 1.0.10 (registry+https://github.com/rust-lang/crates.io-index)" = "df246d292ff63439fea9bc8c0a270bed0e390d5ebd4db4ba15aba81111b5abe3" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" "checksum quote 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2bdc6c187c65bca4260c9011c9e3132efe4909da44726bad24cf7572ae338d7f" "checksum rand 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" @@ -881,25 +901,23 @@ dependencies = [ "checksum redox_syscall 0.1.56 (registry+https://github.com/rust-lang/crates.io-index)" = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" "checksum redox_users 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "09b23093265f8d200fa7b4c2c76297f47e681c655f6f1285a8780d6a022f7431" -"checksum regex 1.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8900ebc1363efa7ea1c399ccc32daed870b4002651e0bed86e72d501ebbe0048" +"checksum regex 1.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7f6946991529684867e47d86474e3a6d0c0ab9b82d5821e314b1ede31fa3a4b3" "checksum regex-syntax 0.6.17 (registry+https://github.com/rust-lang/crates.io-index)" = "7fe5bd57d1d7414c6b5ed48563a2c855d995ff777729dcd91c369ec7fea395ae" "checksum rpassword 4.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "99371657d3c8e4d816fb6221db98fa408242b0b53bac08f8676a41f8554fe99f" "checksum rust-argon2 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2bc8af4bda8e1ff4932523b94d3dd20ee30a87232323eda55903ffd71d2fb017" -"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum sha2 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "27044adfd2e1f077f649f59deb9490d3941d674002f7d062870a60ebe9bd47a0" "checksum spinner 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e3a7cd01625b7e43e62815677d692cb59b221c2fdc2853d1eb86a260ee0c272" "checksum spinners 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e26e56abcec96e1336be97bb1953153f80e050ff0f86d67721127d30391b6472" "checksum stream-cipher 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8131256a5896cabcf5eb04f4d6dacbe1aefda854b0d9896e09cb58829ec5638c" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -"checksum structopt 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3fe43617218c0805c6eb37160119dc3c548110a67786da7218d1c6555212f073" -"checksum structopt-derive 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c6e79c80e0f4efd86ca960218d4e056249be189ff1c42824dcd9a7f51a56f0bd" +"checksum structopt 0.3.12 (registry+https://github.com/rust-lang/crates.io-index)" = "c8faa2719539bbe9d77869bfb15d4ee769f99525e707931452c97b693b3f159d" +"checksum structopt-derive 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f88b8e18c69496aad6f9ddf4630dd7d585bcaf765786cb415b9aec2fe5a0430" "checksum strum 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ca6e4730f517e041e547ffe23d29daab8de6b73af4b6ae2a002108169f5e7da" "checksum strum_macros 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3384590878eb0cab3b128e844412e2d010821e7e091211b9d87324173ada7db8" +"checksum subtle 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" -"checksum syn 1.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "123bd9499cfb380418d509322d7a6d52e5315f064fe4b3ad18a53d6b92c07859" +"checksum syn 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "0df0eb663f387145cab623dea85b09c2c5b4b0aef44e945d928e682fce71bb03" "checksum syn-mid 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7be3539f6c128a931cf19dcee741c1af532c7fd387baa739c03dd2e96479338a" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum term 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c0863a3345e70f61d613eab32ee046ccd1bcc5f9105fe402c61fcd0c13eeb8b5" diff --git a/Cargo.toml b/Cargo.toml index bbb60ff..d370bb4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,5 +19,8 @@ pbr = "1.0.2" spinners = "1.2.0" regex = "1.3.4" byteorder = "1.3.4" -bdflib = "0.2.0" -benchlib-rs = "0.3.4" \ No newline at end of file +benchlib-rs = "0.3.4" +bdflib = "0.4.0" +hmac = "0.7.1" +num_cpus = "1.12.0" +crossbeam-channel = "0.4.2" diff --git a/src/lib/crypt.rs b/src/lib/crypt.rs index 8d9af84..9a14245 100644 --- a/src/lib/crypt.rs +++ b/src/lib/crypt.rs @@ -1,4 +1,4 @@ -use crate::lib::hash::sha_checksum; +use crate::lib::hash::create_hmac; use cfb_mode::stream_cipher::{NewStreamCipher, StreamCipher}; use cfb_mode::Cfb; use des::Des; @@ -31,16 +31,14 @@ pub fn decrypt_data(data: &[u8], key: &[u8]) -> Vec { } /// Decrypts data using a dictionary -pub fn decrypt_with_dictionary( - data: &[u8], - dict: Vec<(&String, Vec)>, - checksum: &[u8], -) -> Option> { +pub fn decrypt_with_dictionary(data: &[u8], dict: Vec<(&String, &Vec)>) -> Option> { let decrypted = Mutex::>>::new(None); + let hmac = &data[data.len() - 32..]; + let encrypted_data = &data[..data.len() - 32]; let pass = dict.par_iter().find_first(|(_pw, key)| { - let decrypted_data = decrypt_data(&data, key); - let decr_check = sha_checksum(&decrypted_data); - return if decr_check == checksum { + let decrypted_data = decrypt_data(encrypted_data, &key[0..8]); + let decr_hmac = create_hmac(&key, &decrypted_data).expect("failed to create hmac"); + return if decr_hmac == hmac { let mut decry = decrypted.lock().unwrap(); *decry = Some(decrypted_data); true @@ -57,23 +55,3 @@ pub fn decrypt_with_dictionary( } None } - -/// Decrypts data by generating all possible keys -pub fn decrypt_brute_brute_force(data: &[u8], checksum: &[u8]) -> Option> { - let encryption_key = (0u64..std::u64::MAX) - .into_par_iter() - .find_first(|num: &u64| { - let key: &[u8] = &num.to_le_bytes(); - let decrypted_data = decrypt_data(&data, key); - let decr_check = sha_checksum(&decrypted_data); - - decr_check == checksum - }); - if let Some(num) = encryption_key { - let key: &[u8] = &num.to_le_bytes(); - println!("Key found: {:?}", key); - - return Some(decrypt_data(data, key)); - } - None -} diff --git a/src/lib/hash.rs b/src/lib/hash.rs index 45b3e94..9f49a47 100644 --- a/src/lib/hash.rs +++ b/src/lib/hash.rs @@ -1,6 +1,9 @@ -use sha2::{Digest, Sha256, Sha512}; +use hmac::crypto_mac::InvalidKeyLength; +use hmac::{Hmac, Mac}; +use sha2::{Digest, Sha256}; pub type PassKey = (String, Vec); +type HmacSha256 = Hmac; /// Hashes a text to a 32 bytes long key. pub fn create_key(pw: &str) -> Vec { @@ -21,15 +24,6 @@ pub fn sha256(pw: &str) -> Vec { result.to_vec() } -/// Hashes a text to sha512 -pub fn sha512(pw: &str) -> Vec { - let mut hasher = Sha512::default(); - hasher.input(pw); - let result = hasher.result(); - - result.to_vec() -} - /// Creates a sha256 hashsum from the input data pub fn sha_checksum(data: &Vec) -> Vec { let mut hasher = Sha256::default(); @@ -38,3 +32,11 @@ pub fn sha_checksum(data: &Vec) -> Vec { result.to_vec() } + +/// Creates a hmac hash to be appended after the encrypted message +pub fn create_hmac(key: &Vec, data: &Vec) -> Result, InvalidKeyLength> { + let mut mac = HmacSha256::new_varkey(key)?; + mac.input(data); + + Ok(mac.result().code().to_vec()) +} diff --git a/src/main.rs b/src/main.rs index 2bed0b8..67c8f98 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,12 @@ pub mod lib; -use crate::lib::crypt::{ - decrypt_brute_brute_force, decrypt_data, decrypt_with_dictionary, encrypt_data, -}; -use crate::lib::hash::{create_key, sha256, sha512, sha_checksum}; +use crate::lib::crypt::{decrypt_data, decrypt_with_dictionary, encrypt_data}; +use crate::lib::hash::{create_hmac, sha256}; use crate::lib::timing::TimeTaker; use bdf::chunks::{DataEntry, HashEntry, HashLookupTable}; use bdf::io::{BDFReader, BDFWriter}; use benchlib::benching::Bencher; +use crossbeam_channel::bounded; use pbr::ProgressBar; use rayon::prelude::*; use rayon::str; @@ -18,7 +17,7 @@ use spinners::{Spinner, Spinners}; use std::collections::HashMap; use std::fs; use std::fs::File; -use std::sync::mpsc::sync_channel; +use std::sync::{Arc, Mutex}; use std::thread; use std::time::Duration; use structopt::StructOpt; @@ -58,10 +57,6 @@ struct Encrypt { /// The output file #[structopt(short = "o", long = "output", default_value = "output.des")] output: String, - - /// The file for the checksum. - #[structopt(long = "checksum-file")] - output_checksum: Option, } #[derive(StructOpt, Clone)] @@ -74,10 +69,6 @@ struct Decrypt { #[structopt(short = "o", long = "output", default_value = "output.txt")] output: String, - /// The file for the checksum. - #[structopt(long = "checksum-file")] - input_checksum: Option, - /// A dictionary file containing a list of passwords /// The file needs to be in a csv format with calculated password hashes. /// The hashes can be calculated with the create-dictionary subcommand from a txt file. @@ -121,15 +112,12 @@ fn encrypt(_opts: &Opts, args: &Encrypt) { let output: String = (*args.output).parse().unwrap(); let data: Vec = fs::read(input).expect("Failed to read input file!"); - if let Some(output_checksum) = (args.clone()).output_checksum { - let checksum = sha_checksum(&data); - let checksum_b64 = base64::encode(checksum.as_slice()); - fs::write(output_checksum, checksum_b64.as_bytes()) - .expect("Failed to write checksum file!"); - } let pass = read_password_from_tty(Some("Password: ")).unwrap(); - let key = create_key(&pass); - let enc_data = encrypt_data(data.as_slice(), key.as_slice()); + let sha256_key = sha256(&pass); + let key = &sha256_key[0..8]; + let mut data_hmac = create_hmac(&sha256_key, &data).expect("failed to create hmac"); + let mut enc_data = encrypt_data(data.as_slice(), &key); + enc_data.append(&mut data_hmac); fs::write(output, enc_data.as_slice()).expect("Failed to write output file!"); } @@ -143,39 +131,21 @@ fn decrypt(_opts: &Opts, args: &Decrypt) { let dictionary = args.dictionary.clone(); let data = fs::read(input).expect("Failed to read input file!"); - if let Some(input_checksum) = (args.clone()).input_checksum { - let bin_content = fs::read(input_checksum).expect("Failed to read checksum file!"); - let data_checksum = base64::decode(bin_content.as_slice()).unwrap(); - - if let Some(dict) = dictionary { - tt.take("decryption-start"); - if let Some(dec_data) = decrypt_with_dictionary_file(dict, &data, &data_checksum) { - fs::write(output, &dec_data).expect("Failed to write output file!"); - println!( - "Decryption took {:.2}s", - tt.since("decryption-start").unwrap().as_secs_f32() - ); - println!("Finished {:.2}s!", tt.since("start").unwrap().as_secs_f32()); - } else { - println!("\nNo password found!"); - println!("Finished {:.2}s!", tt.since("start").unwrap().as_secs_f32()); - } + if let Some(dict) = dictionary { + tt.take("decryption-start"); + if let Some(dec_data) = decrypt_with_dictionary_file(dict, &data) { + fs::write(output, &dec_data).expect("Failed to write output file!"); + println!( + "Decryption took {:.2}s", + tt.since("decryption-start").unwrap().as_secs_f32() + ); + println!("Finished {:.2}s!", tt.since("start").unwrap().as_secs_f32()); } else { - let sp = spinner("Brute force decrypting file"); - if let Some(dec_data) = decrypt_brute_brute_force(&data, &data_checksum) { - sp.stop(); - fs::write(output, &dec_data).expect("Failed to write output file!"); - println!("Finished {:.2}s!", tt.since("start").unwrap().as_secs_f32()); - } else { - sp.stop(); - println!("\nNo fitting key found. (This should have been impossible)") - } + println!("\nNo password found!"); + println!("Finished {:.2}s!", tt.since("start").unwrap().as_secs_f32()); } } else { - let pass = read_password_from_tty(Some("Password: ")).unwrap(); - let key = create_key(&pass); - let result = decrypt_data(&data, key.as_slice()); - fs::write(output, &result).expect("Failed to write output file!"); + println!("No checksum file given!"); } } @@ -189,7 +159,6 @@ fn create_dictionary(_opts: &Opts, args: &CreateDictionary) { let input: String = (*args.input).parse().unwrap(); // TODO: Some form of removing duplicates (without itertools) let fout = File::create(args.output.clone()).unwrap(); - let handle; let content = fs::read_to_string(input).expect("Failed to read content"); let lines = content.par_lines(); @@ -198,7 +167,6 @@ fn create_dictionary(_opts: &Opts, args: &CreateDictionary) { let mut pb = ProgressBar::new(entry_count); pb.set_max_refresh_rate(Some(Duration::from_millis(200))); - let (rx, tx) = sync_channel::(100_00_000); let mut bdf_file = BDFWriter::new(fout, entry_count, args.compress != 0); bdf_file.set_compression_level(args.compress); @@ -209,18 +177,24 @@ fn create_dictionary(_opts: &Opts, args: &CreateDictionary) { .add_lookup_entry(HashEntry::new(SHA256.to_string(), 32)) .expect("Failed to add sha256 lookup entry"); - handle = thread::spawn(move || { - for entry in tx { - if let Err(e) = bdf_file.add_data_entry(entry) { - println!("{:?}", e); + let mut threads = Vec::new(); + let (rx, tx) = bounded::(100_00_000); + let bdf_arc = Arc::new(Mutex::new(bdf_file)); + let pb_arc = Arc::new(Mutex::new(pb)); + + for _ in 0..(num_cpus::get() as f32 / 4f32).max(1f32) as usize { + let tx = tx.clone(); + let bdf_arc = Arc::clone(&bdf_arc); + let pb_arc = Arc::clone(&pb_arc); + threads.push(thread::spawn(move || { + for entry in tx { + if let Err(e) = &bdf_arc.lock().unwrap().add_data_entry(entry) { + println!("{:?}", e); + } + pb_arc.lock().unwrap().inc(); } - pb.inc(); - } - pb.finish(); - bdf_file - .finish() - .expect("failed to finish the writing process"); - }); + })); + } tt.take("creation"); let re = Regex::new("[\\x00\\x08\\x0B\\x0C\\x0E-\\x1F\\t\\r\\a\\n]").unwrap(); @@ -238,9 +212,17 @@ fn create_dictionary(_opts: &Opts, args: &CreateDictionary) { .expect("Failed to send value to channel."); }); - if let Err(_err) = handle.join() { - println!("Failed to join!"); + for handle in threads { + if let Err(_err) = handle.join() { + println!("Failed to join!"); + } } + bdf_arc + .lock() + .unwrap() + .finish() + .expect("failed to finish the writing process"); + pb_arc.lock().unwrap().finish(); println!( "Rainbow table creation took {:.2}s", tt.since("creation").unwrap().as_secs_f32() @@ -256,48 +238,55 @@ fn spinner(text: &str) -> Spinner { /// Decrypts the file using a bdf dictionary /// The files content is read chunk by chunk to reduce the memory impact since dictionary /// files tend to be several gigabytes in size -fn decrypt_with_dictionary_file( - filename: String, - data: &Vec, - data_checksum: &Vec, -) -> Option> { +fn decrypt_with_dictionary_file(filename: String, data: &Vec) -> Option> { let sp = spinner("Reading dictionary..."); let f = File::open(&filename).expect("Failed to open dictionary file."); let mut bdf_file = BDFReader::new(f); - bdf_file - .read_metadata() - .expect("failed to read the metadata of the file"); + bdf_file.read_start().expect("failed to read the bdf file"); let mut chunk_count = 0; if let Some(meta) = &bdf_file.metadata { chunk_count = meta.chunk_count; } let mut pb = ProgressBar::new(chunk_count as u64); - let (rx, tx) = sync_channel::>(100); - let _handle = thread::spawn(move || { - let mut lookup_table = HashLookupTable::new(HashMap::new()); - if let Ok(table) = bdf_file.read_lookup_table() { - lookup_table = table.clone(); - } - while let Ok(next_chunk) = &mut bdf_file.next_chunk() { - if let Ok(entries) = next_chunk.data_entries(&lookup_table) { - if let Err(_) = rx.send(entries) {} + let bdf_arc = Arc::new(Mutex::new(bdf_file)); + let mut threads = Vec::new(); + let (rx, tx) = bounded::>(100); + + for _ in 0..(num_cpus::get() as f32 / 4f32).max(1f32) as usize { + let rx = rx.clone(); + let bdf_arc = Arc::clone(&bdf_arc); + + threads.push(thread::spawn(move || { + let mut lookup_table = HashLookupTable::new(HashMap::new()); + if let Some(table) = &bdf_arc.lock().unwrap().lookup_table { + lookup_table = table.clone(); } - } - }); + while let Ok(next_chunk) = &mut bdf_arc + .lock() + .expect("failed to lock bdf_arc to read next chunk") + .next_chunk() + { + if let Ok(entries) = next_chunk.data_entries(&lookup_table) { + if let Err(_) = rx.send(entries) {} + } + } + })); + } + drop(rx); sp.stop(); let mut result_data: Option> = None; for entries in tx { - let pw_table: Vec<(&String, Vec)> = entries + let pw_table: Vec<(&String, &Vec)> = entries .par_iter() .map(|entry: &DataEntry| { let pw = &entry.plain; let key: &Vec = entry.get_hash_value(SHA256.to_string()).unwrap(); - (pw, key[0..8].to_vec()) + (pw, key) }) .collect(); pb.inc(); - if let Some(dec_data) = decrypt_with_dictionary(&data, pw_table, &data_checksum) { + if let Some(dec_data) = decrypt_with_dictionary(&data, pw_table) { result_data = Some(dec_data); break; } @@ -314,8 +303,6 @@ fn benchmark() { .set_iterations(1_000_000) .print_settings() .bench("sha256", || test_key = sha256("abcdefghijklmnopqrstuvwxyz")) - .bench("sha512", || sha512("abcdefghijklmnopqrstuvwxyz")) - .compare() .bench("des encrypt", || { encrypted = encrypt_data(b"abcdefghijklmnopqrstuvwxyz", &test_key[..8]) })