We have created an EXE application where user can enter the appKey for EMS connectivity and EXE application will generate and update the config.json file with encrypted appKey.
This was working fine for EMS v5.4.7. EMS was able to connect to server without any issues.
However after Upgrade to EMS v5.4.10, the EXE application was able to generate the encrypted appKey, but EMS is not able to connect to the server.
Log file shows below error when trying to connect.
Also if we generate the encrypted appKey manually using below command and use that, EMS can successfully connect to the server.
“wsems.exe -encrypt <AppKey>”
Below is the code block used in the EXE application to automatically generate the encrypted appKey.
Could you please help identify what may be the reason for not able to decrypt, or what may be going wrong during the encryption process after EMS upgrade.
Thanks and Regards,
We tested to recreate the same error message you are getting and were able to do so by changing the encoded appkey in order to invalidate it. It sounds like something similar is happening on your end. Is something happening in your code to modify it? Or is the wrong hash being used?
If you hard code the unencrypted appkey in config.json and start it up so that it gets re-encrypted and test it, does it work? If so, it sounds like there is something happening in your program.
Thanks for the inputs.
If I punch in unencrypted key and start/restart the EMS, the key gets encrypted.
But the aim here is to get it encrypted using the process, as we do not want to expose the original appKey at any point of time.
So we have a tool where valid user can enter the appKey and run the tool to update encrypted appKey in config.Json.
There is no other code apart from what I have shared earlier that is processing the appKey.
The code does only the following.
"Encrypt using the command and update it in config.Json".
Please compare the appkey encrypted by the process and the one auto-encrypted by the EMS itself. Are they the same?
Maybe it's missing some suffix ?
I had verified that.
In both cases it is the same appKey in terms of suffice or prefix.
There is nothing missing.
Thanks and Regards,
Do note that EMS 5.4.10 at least automatically encrypts the AppKey upon restart if you set it as clear text, so you do not need to encrypt manually or via process command.
Just set it in the JSON, restart the EMS and it should automatically encrypt it. That's what I see in my wsems.