Closed Eroli closed 2 years ago
Glad to hear you've made it past the login steps and are now into the command-and-control part.
You've guessed correctly about the cause -- I ran into a similar problem and didn't comment it very well in the code.
The trick is that the AES context is not reset after each message, so the "IV" for the second message is the chained cipher text from the previous message as if they were one continuous communication. The HCSocket
python code uses the same self.aes_encrypt
object until self.reset()
is called after a reconnect, which reinitializes the encrypt/decrypt objects with the self.iv
value.
In fact, I also tried reusing the AES object for the various incoming messages before asking. Unfortunately that did not work either.
The solution was not to use the single calls AES.DecryptCbc but the variant with the CryptoStream. In addition, the CryptoStream must not be closed, which means it must be reused just like the AES object. Of course I checked this only now, before the CryptoStream was in a using block and was therefore disposed after each encryption.
Thanks again for the help, I'll clean up the implementation a bit now.
Maybe a follow-up question: Decrypting the messages sent via NOTIFY (which UID means what?) I imagine is still somewhat feasible. Do you have an idea how to find out what you would have to send, for example to start a certain program of the washing machine? So actively trigger an action instead of just waiting for the reactions?
Are you fetching the account/details
json like hc-login
line 133? Once you have that struct you can fetch a series of zip'ed XML files with "api/iddf/v1/iddf/" + app_id
that describe the enums and ids of different commands.
My application right now is just dashboarding, so I haven't explored sending commands to the devices, although it seems like it should be "a simple matter of programming" to use the various UIDs to make it do things.
Hi everybody,
i am currently working on a C# port of this nice project. I am working with a WAV28G40 washer from Bosch and i am facing a strange issue.
I can successfully connect to the washer and receive the welcome msg (resource: /ei/initialValues).
I can successfully respond to that message with the RESPONSE action. The washing machine should now answer with the registeredDevices
When i receive the next (2nd) message from the washer, the first 16 bytes are broken. The received message starts like this
?,?S???↕??→?7@?"msgID":216593xxx,"resource":"/ci/registeredDevices", ...
Based on this error I assume this should be an issue with the IV, since the remaining message is decrypted successfully. However, i am not able to find any difference to the python script. Therefore, i have some open questions looking to your feedback:Is the IV updated in any way or is the same one used for the whole communication?
If the IIV is updated, how does this take place?
If you have any hints for me regarding this error, please let me know :-)