Open Baldhor opened 1 year ago
I know Martijn uses this to encrypt and decrypt: https://github.com/martijnpoppen/com.vag.core/blob/e9d5bec1d8ce7ce859cc75cb33f69de1b508b6b7/lib/helpers.js#L21
Yes maybe, I just don't catch how the cipher works, and I don't like using things I don't understand :) But it looks simple to use.
Also, unsure how he retrieve the secreteKey from env.
const secretKey = Homey.env.SECRET;
Current situation The encryptionKey and password are currently stored in the driver settings. They are stored in plain text. The consolre.re and 'collect debug info' functions offuscate them.
If the user install an app with homey-api-management permission, that said app could be able to retrive the settings of all the drivers from Homey, including ip address, encryptionKey and so on ...
Registered password and encryptionKey should be encrypted using a private key. Stored, and only decrypted when needed.
The private key itself should not be saved in the github.
DISCLAIMER: This will not protect the device from a direct and brutal attack, but it should mitigate the risk to steal the password/encryptionKey from ESPhome app.