Yealink Forums

Full Version: AES Encryption from Python
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello!

I'm trying to aes encrypt general/mac configs using two 16-character keys before sending them over the wire to a Yealink T46G phone.

Using yealinkencrypt(the aes encryption binary from Yealink) I managed to provision the phone with the two keys. Today I found http://cuttingedge.io/yealink-device-pro...ython.html , which suggests it can do the same thing from Python, which would be much easier to work with when creating dynamic config files. I used the same keys, but it generates a slightly different output. The two encrypted files from Python also fail to parse from the Phone (logs say it fails to decrypt).

Does anyone know why the result of the python script differs from the yealink encryption tool? It would be awesome if config files can be encrypted from python! Angel

I'm not sure what i'm doing wrong here. File output looks almost the same, except y000000000028.cfg from Py is 512 bytes and from yealinkencrypt it is 496 bytes. The mac specific config from Py is 3328 bytes and from yealinkencrypt it is 3264 bytes. Could it be that the Py version includes the AES key in the output, and yealinkencrypt doesn't?
Although the filesizes differ, the yealinkencrypt version of the file can be decrypted using the Python version using the correct key, however the phone fails to decode the Python version.

Changing the blocksize to 16 produces a file with exact the same bytesize as yealinkencrypt produces. Using cmp it seems only the padding at the end of the file differs(?). Are there any Yealink specs on what type of AES is actually being used? (padding/blocksize/etc.) The documentation is kinda leaving me in the dark Sad
Reference URL's