Created
September 1, 2018 07:09
-
-
Save jack126guy/a30ab03a1481771d70ac4826960bbffd to your computer and use it in GitHub Desktop.
Convert EFF's 3d20 passphrase word files ( https://www.eff.org/deeplinks/2018/08/dragon-con-diceware ) to raw lists
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
from argparse import ArgumentParser | |
import re | |
arg_parser = ArgumentParser(description="Convert EFF's 3d20 passphrase word files to raw lists") | |
arg_parser.add_argument("input_file", help="Original word file") | |
arg_parser.add_argument("output_file", help="Raw word list file") | |
args = arg_parser.parse_args() | |
word_line_regex = re.compile("^\d+-\d+-\d+ (.*)$") | |
with open(args.input_file, "r", errors="replace") as input_file: | |
with open(args.output_file, "w") as output_file: | |
for input_line in input_file: | |
regex_match = word_line_regex.match(input_line) | |
if regex_match: | |
output_file.write(regex_match.group(1) + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment