gree-remote
gree-remote copied to clipboard
Error: the length of the provided data is not a multiple of the block lengt
Any suggestions on this one?
i'm not sure where or what you're trying to do, but 1st you have to decode with Base64, and than you can decode the AES128. I hope this info helps. Moti
It's possible that the response from this specific unit it not recognized by the script, maybe it has a different format. @jodewee can you please try it with --verbose
?
I'm hit by the same issue, as well. It should be the same issue as #52. As described in the other issue, my Cooper&Hunter unit works OK but the newer Gree Soyal units display this error.
The --verbose
doesn't add that much extra info:
python3 ./gree.py search --broadcast 10.0.5.255 --verbose
Searching for devices using broadcast address: 10.0.5.255
Traceback (most recent call last):
File "./gree.py", line 245, in <module>
search_devices()
File "./gree.py", line 109, in search_devices
pack = json.loads(decrypt_generic(resp['pack']))
File "./gree.py", line 73, in decrypt_generic
return decrypt(pack_encoded, GENERIC_KEY)
File "./gree.py", line 66, in decrypt
pack_decrypted = decryptor.update(pack_decoded) + decryptor.finalize()
File "/usr/lib/python3/dist-packages/cryptography/hazmat/primitives/ciphers/base.py", line 159, in finalize
data = self._ctx.finalize()
File "/usr/lib/python3/dist-packages/cryptography/hazmat/backends/openssl/ciphers.py", line 178, in finalize
raise ValueError(
ValueError: The length of the provided data is not a multiple of the block length.
Duplicate of #52, closing this.