Initial commit of AthonetTools
This commit is contained in:
24
generate_ep5g_password.py
Normal file
24
generate_ep5g_password.py
Normal file
@@ -0,0 +1,24 @@
|
||||
import hashlib
|
||||
import argparse
|
||||
|
||||
# Set up command line argument parsing
|
||||
parser = argparse.ArgumentParser(description="Generate EP5G password from serial.")
|
||||
parser.add_argument("serial", help="Hardware serial number")
|
||||
parser.add_argument("-s", "--seed", default="ANWEP5G", help="Seed value (default: ANWEP5G)")
|
||||
parser.add_argument("-p", "--prefix", default="EP5G", help="Password prefix (default: EP5G)")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
# Combine seed and serial
|
||||
seed_serial = args.seed + args.serial
|
||||
|
||||
# SHA-256 hash
|
||||
sha_dig = hashlib.sha256(seed_serial.encode('utf-8')).hexdigest()
|
||||
|
||||
# Extract password portion
|
||||
pointer = int(sha_dig[0], 16)
|
||||
twelve = sha_dig[pointer:pointer+12]
|
||||
password = f"{args.prefix}!{twelve}"
|
||||
|
||||
# Output
|
||||
print(password)
|
||||
Reference in New Issue
Block a user