-
-
Save rajkosto/29c513b96ea6262d2fb1f965a52ce16f to your computer and use it in GitHub Desktop.
#!/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()) |
works just fine on windows thats what i use and what i made it on...
How do I use this script? Can provide some steps? Thank you so much!
@MarinSNB you can download python installer for windows at python.org.
Thank you so much!
If I'm correct, it generates MAC_KEY from a given MAC_ADDR, right?
@physx2494 correct
Thanks! Just what I needed for my DFP-34G-2C2
Here's a one liner bash version:
mac="xx:xx:xx:xx:xx:xx";MAC=${mac^^};echo -n "hsgq1.9a${MAC//:/}"|md5sum
Alguém poderia me ajudar a criar uma Mackey para meu MacAddress: Mac: F4:54:20:D8:36:C1
Alguém poderia me ajudar a criar uma Mackey para meu MacAddress: Mac: F4:54:20:D8:36:C1
$ mac="F4:54:20:D8:36:C1";MAC=${mac^^};echo -n "hsgq1.9a${MAC//:/}"|md5sum
b62d86edd98a504079caf2bf87da5ab3 -
Thank you my friend @akeyx, I needed it for my Xpon stick.
Could you tell me what software you used to run the script?
The bash shell.
Could anyone help me create a Mackey for my MacAddress: Mac:B8:DD:71:D6:D7:6E
thanks
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
Hello. Write a better generator to work from under Windows