From e06561ba93d4f13da7f7b30a70cf1eb150033ed4 Mon Sep 17 00:00:00 2001 From: 3rd Iteration Date: Sat, 4 Nov 2023 13:31:41 -0400 Subject: [PATCH] Add ability to use gzipped passwordlists (and seedlists) --- btcrecover/btcrpass.py | 3 +++ docs/passwordlist_file.md | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/btcrecover/btcrpass.py b/btcrecover/btcrpass.py index 0d58de62..3ffafca8 100644 --- a/btcrecover/btcrpass.py +++ b/btcrecover/btcrpass.py @@ -5444,6 +5444,9 @@ def open_or_use(filename, mode = "r", # if tstr == str and "b" not in mode: file = io.open(filename, mode, encoding="utf_8_sig", errors=decoding_errors) + if filename[-3:] == ".gz": + file = gzip.open(filename, mode, encoding="utf_8_sig", errors=decoding_errors) + else: else: file = open(filename, mode) # diff --git a/docs/passwordlist_file.md b/docs/passwordlist_file.md index 2cf97430..3a88788e 100644 --- a/docs/passwordlist_file.md +++ b/docs/passwordlist_file.md @@ -1,7 +1,7 @@ contributors: gurnec ## The Passwordlist ## -If you already have a simple list of whole passwords you'd like to test, and you don't need any of the features described above, you can use the `--passwordlist` command-line option (instead of the `--tokenlist` option as described later in the [Running *btcrecover*](#running-btcrecover) section). If your password contains any non-[ASCII](https://en.wikipedia.org/wiki/ASCII) (non-English) characters, you should read the section on [Unicode Support](#unicode-support) before continuing. +If you already have a simple list of whole passwords you'd like to test, and you don't need any of the features described above, you can use the `--passwordlist` command-line option (instead of the `--tokenlist` option as described later in the [Running *btcrecover*](#running-btcrecover) section). The passwordlist is just a standard text file, with one password per line. (It can be either raw text or also compressed with gzip)If your password contains any non-[ASCII](https://en.wikipedia.org/wiki/ASCII) (non-English) characters, you should read the section on [Unicode Support](#unicode-support) before continuing. If you specify `--passwordlist` without a file, *btcrecover* will prompt you to type in a list of passwords, one per line, in the Command Prompt window. If you already have a text file with the passwords in it, you can use `--passwordlist FILE` instead (replacing `FILE` with the file name).