gree-remote icon indicating copy to clipboard operation
gree-remote copied to clipboard

Error: the length of the provided data is not a multiple of the block lengt

Open jodewee opened this issue 2 years ago • 1 comments

image Any suggestions on this one?

jodewee avatar Jun 02 '22 06:06 jodewee

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

MotiGross avatar Jul 18 '22 20:07 MotiGross

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?

tomikaa87 avatar Aug 30 '22 07:08 tomikaa87

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.

marius-nicolae avatar Aug 30 '22 08:08 marius-nicolae

Duplicate of #52, closing this.

tomikaa87 avatar Sep 03 '22 06:09 tomikaa87