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

Decrypt password in Service

Garnet

Decrypt password in Service

Hi guys,

 

I have a password as a property on a thing.  I however need the password to run a service.

 

Where or how do I generate the key required to decrypt the password with the decrypt service in the EncryptionServices resource?

 

var result = Resources["EncryptionServices"].DecryptWithKey({

data: "" /* STRING */,
key: "" /* STRING */
});

5 REPLIES 5

Re: Decrypt password in Service

Re: Decrypt password in Service

Hi @posipova ,

 

Thank you for the response.  

 

I read through the documentation but it appears that is for licence encrypting.  I want to use a user password in a service.  I want to figure out if there is a way to safely decrypt it as an administrator user to be able to use the password in a service.


The decrypt service needs a key which I am not sure how to generate.  Can you perhaps give any suggestions?

Re: Decrypt password in Service

use encrpt/decrypt with custom key.

use 128 bit key

 

****************************


var params1 = {
data: passwd_input /* STRING */,
key: "FEDCBA98765432100123456789ABCDEF" /* STRING */
};

// result: STRING
var result1 = Resources["EncryptionServices"].EncryptWithCustomKey(params1);


var params2 = {
encryptedData: result1 /* STRING */,
key: "FEDCBA98765432100123456789ABCDEF" /* STRING */
};

// result: STRING
var result = Resources["EncryptionServices"].DecryptWithCustomKey(params2);

 

 

 

Re: Decrypt password in Service

Hello @AndreaSteyn,

 

When you say "I want to use a user password in a service" you mean you want to use the password of a selected User entity? I'm not sure ThingWorx even stores user passwords, so there's nothing to decrypt, only hashes.

 

/ Constantine

Re: Decrypt password in Service

To clarify I want to create a password property that is not visible to all users for security.

 

I then need to use this password in a service to run a export service. So I therefore need to decrypt the password to be able to use it in the service.

 

I hope this provides more clarification.

Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________