tplink-smarthome-crypto
TP-Link Smarthome Crypto
Supported Devices
Model | Type |
---|---|
HS100, HS105, HS107, HS110, HS200, HS210, HS220, HS300 |
Plug |
LB100, LB110, LB120, LB130, LB200, LB230 | Bulb |
Related Projects
- TP-Link Smarthome API
- TP-Link Smarthome Device Simulator - Useful for automated testing
- TP-Link Smarthome Crypto
- TP-Link Smarthome Homebridge Plugin
API
tplink-smarthome-crypto
TP-Link Smarthome Crypto
TCP communication includes a 4 byte header, UDP does not.
-
tplink-smarthome-crypto
-
.encrypt(input, [firstKey]) ⇒
Buffer
-
.encryptWithHeader(input, [firstKey]) ⇒
Buffer
-
.decrypt(input, [firstKey]) ⇒
Buffer
-
.decryptWithHeader(input, [firstKey]) ⇒
Buffer
-
.encrypt(input, [firstKey]) ⇒
Buffer
tplink-smarthome-crypto.encrypt(input, [firstKey]) ⇒ Encrypts input where each byte is XOR'd with the previous encrypted byte.
Kind: static method of tplink-smarthome-crypto
Returns: Buffer
- encrypted buffer
Param | Type | Default | Description |
---|---|---|---|
input |
Buffer | string
|
Buffer/string to encrypt | |
[firstKey] | number |
0xAB |
Buffer
tplink-smarthome-crypto.encryptWithHeader(input, [firstKey]) ⇒ Encrypts input that has a 4 byte big-endian length header; each byte is XOR'd with the previous encrypted byte.
Kind: static method of tplink-smarthome-crypto
Returns: Buffer
- encrypted buffer with header
Param | Type | Default | Description |
---|---|---|---|
input |
Buffer | string
|
Buffer/string to encrypt | |
[firstKey] | number |
0xAB |
Buffer
tplink-smarthome-crypto.decrypt(input, [firstKey]) ⇒ Decrypts input where each byte is XOR'd with the previous encrypted byte.
Kind: static method of tplink-smarthome-crypto
Returns: Buffer
- decrypted buffer
Param | Type | Default | Description |
---|---|---|---|
input | Buffer |
encrypted Buffer | |
[firstKey] | number |
0xAB |
Buffer
tplink-smarthome-crypto.decryptWithHeader(input, [firstKey]) ⇒ Decrypts input that has a 4 bype big-endian length header; each byte is XOR'd with the previous encrypted byte
Kind: static method of tplink-smarthome-crypto
Returns: Buffer
- decrypted buffer
Param | Type | Default | Description |
---|---|---|---|
input | Buffer |
encrypted Buffer with header | |
[firstKey] | number |
0xAB |
Credits
Thanks to George Georgovassilis and Thomas Baust for figuring out the HS1XX encryption.