Replies: 1 comment 1 reply
-
|
I read it somewhere on the internet. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I watched your decrypt function in grottdata.py.
This is some magic code to me. I tried to understand it. But I did not figure it out completely.
I assume the plain text gets encrypted with the key "Growatt".
I am really wondering how you came up with it.
Could you explain this part:
[decdata[i+8] ^ int(hex_mask[j],16)]
For reference the complete code
def decrypt(decdata) : ndecdata = len(decdata) len_decdata = len(decdata) # Create mask and convert to hexadecimal mask = "Growatt" hex_mask = ['{:02x}'.format(ord(x)) for x in mask] nmask = len(hex_mask) #start decrypt routine unscrambled = list(decdata[0:8]) #take unscramble header for i,j in zip(range(0,ndecdata-8),cycle(range(0, nmask))): unscrambled = unscrambled + [decdata[i+8] ^ int(hex_mask[j],16)]Beta Was this translation helpful? Give feedback.
All reactions