Last active
April 1, 2021 12:01
-
-
Save joshschmelzle/463d28fb878e119d8c6baf5b06b4c395 to your computer and use it in GitHub Desktop.
Cisco Scrypt Secret 9 Generator Attempt - YMMV
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
import base64 | |
import scrypt | |
import os | |
import random | |
# password | |
password = "hashcat" | |
# translation table | |
base64chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/" | |
cisco64chars = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" | |
table = str.maketrans(base64chars, cisco64chars) | |
# salt | |
chars=[] | |
for i in range(14): | |
chars.append(random.choice(cisco64chars)) | |
salt = "".join(chars) | |
hash = scrypt.hash(password.encode(), salt.encode(), 16384, 1, 1, 32) | |
data = base64.b64encode(hash, altchars=b"-_") | |
#data = base64.b64encode(hash, altchars=b"-_") | |
# encode the hash | |
hash = base64.b64encode(hash).decode().translate(table)[:-1] | |
print(f"$9${salt}${hash}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment