Created
November 14, 2015 13:48
-
-
Save bholota/83a51383c358cf88353c to your computer and use it in GitHub Desktop.
Generate all combinations for given chars, combination fixed length and print them with sha256 hash
This file contains 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
# Simple script that generate all possible string combinations for given lenght | |
# and generates sha256 hashes for every combination. Combination allow to use | |
# single char zero or more times. | |
import hashlib | |
import itertools | |
possibleChars = ['a', 'l', 'i', 'n', 's', 'b'] | |
passLen = 7 | |
#generate all pass combinations | |
combinations = [] | |
for i in itertools.product(possibleChars, repeat=passLen): | |
combinations.append(''.join(map(str, i))) | |
hashes = [] | |
for i in combinations: | |
hashedPass = hashlib.sha256(i.lower()).hexdigest() | |
hashes.append(hashedPass) | |
print i + "\t\t" + hashedPass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment