How are camera passwords encrypted in the SQL database?

Currently, I’m working on modifying the SQL stored procedure (create_task_change_hardware_password) to set a custom password to be set on the camera hardware.

The problem I’m having is figuring out how the password in this stored procedure is encrypted - I suspect its encrypted using the key in the keys table from the SQL table but I am not sure what format. I am able to create my own example of the encrypted password by trying to change the hardware password via the management client - then checking the task table in the SQL table.

However - I would prefer to actually figure out the encryption mechanism being used here so I can use a script instead to inject my own custom password into the SQL stored procedure. Does anyone have any idea of how these passwords are encrypted?

Using the SQL Server directly is not documented and is not supported.

You can read a device password using MIP SDK and APIs. Let me point to one possibility - https://developer.milestonesys.com/s/question/0D53X0000CzKeitSQC/i-need-to-use-this-task-readpasswordhardware