Skip to content

Instantly share code, notes, and snippets.

@pinebright
Created September 1, 2019 00:55
Show Gist options
  • Save pinebright/efd5b77dc4fbb903799cc00f363716e8 to your computer and use it in GitHub Desktop.
Save pinebright/efd5b77dc4fbb903799cc00f363716e8 to your computer and use it in GitHub Desktop.
dele で類推されるパスワードの生成に使っていたPythonスクリプトの再現
import argparse
import itertools
parser = argparse.ArgumentParser()
parser.add_argument('words', nargs='*')
parser.add_argument('--output', '-o')
args = parser.parse_args()
with open(args.output, "w") as f:
for i in range(1, len(args.words)):
perm = list(itertools.permutations(args.words, i))
for words in perm:
str = ""
for word in words:
str += word
print(str)
f.write(str + "\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment