Tuya door lock - AES-128 ECB PKCS7Padding - PHP

402 Views Asked by At

I was trying to push a temporary key to a smart door using tuya developer, but I'm stuck with the encryption I'm doing it in PHP. Tuya ask for this:

The length of the original password is seven digits for Wi-Fi locks and six digits for Zigbee locks and Bluetooth locks. The password is encrypted by using the AES-128 algorithm with ECB mode and PKCS7Padding. To get the original key, decrypt the temporary key ticket_key with AES using the accessKey that is issued by the platform. The output format is hex.

I'm trying to use some libraries but they ask for IV, I was doing some reading, but couldn't figure out if it has to be random or nor, if has to be provided, does it matter what random IV I use or I have to use a format the server-side can understand??

thanks, I'm new in cryptographic

0

There are 0 best solutions below