Created
November 18, 2022 12:56
-
-
Save rajkosto/29c513b96ea6262d2fb1f965a52ce16f to your computer and use it in GitHub Desktop.
ODI SFP XPON stick MAC_KEY generator
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 | |
#ODI DFP-34X-2C2 MAC_KEY key generator by rajkosto | |
import sys | |
import string | |
import hashlib | |
args = sys.argv | |
if len(args) != 2: | |
sys.exit("Usage: odi_keygen.py YOURMACADDR") | |
macAddr = args[1].strip().replace(':','') | |
if len(macAddr) != 12: | |
sys.exit("Mac address must be 12 hex digits (6 bytes)") | |
if not all(c in string.hexdigits for c in macAddr): | |
sys.exit("Mac address can only contain 0-9, A-F characters (hex digits)") | |
cmacPrefix = 'hsgq1.9a' | |
hashText = cmacPrefix+macAddr.upper() | |
encodedText = hashText.encode('ascii') | |
md5Hash = hashlib.md5(encodedText).digest().hex() | |
print('ELAN_MAC_ADDR='+macAddr.lower()) | |
print('MAC_KEY='+md5Hash.lower()) |
I created a CyberChef recipe So you don't need to know python or bash.
Just put your mac address. It will sanitize, but will not validate.
doing it for MAC OS didn't work, could you generate 84:0B:BB:72:C9:F0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Could anyone help me create a Mackey for my MacAddress: Mac:B8:DD:71:D6:D7:6E
thanks