cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - When posting, your subject should be specific and summarize your question. Here are some additional tips on asking a great question. X

EMS appKey Decryption not working

bmdeshmukh18
8-Gravel

EMS appKey Decryption not working

 Hi,

 

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.

bmdeshmukh18_0-1648118464347.png


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.

bmdeshmukh18_1-1648118832190.png

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,
Bhushan

 

5 REPLIES 5
slangley
23-Emerald II
(To:bmdeshmukh18)

Hi @bmdeshmukh18 

 

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.

 

Regards.

 

--Sharon

Hi Sharon,

 

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".

Thanks Regards,
Bhushan Deshmukh

Hi @bmdeshmukh18 

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 ?

Hi @VladimirRosu 

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,

Bhushan Deshmukh

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.

Top Tags