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

Decrypting Property Value

ShirishMorkhade
16-Pearl

Decrypting Property Value

Hi ThingWorx Enthusiast,

 

Which service, resource to use to decrypt the property value which is encrypted using below snippet?

 

var params = {

data: "<Some_Value>" /* STRING */

};

// result: STRING

var result = Resources["EncryptionServices"].EncryptPropertyValue(params);

 

I didn't find relevant decrypt service under EncryptionServices resource and wonder how to get back the original value.

 

Thanks,

Shirish

4 REPLIES 4

Hello @ShirishMorkhade ,

 

Have you tried the following approach:

 

var property= me.Prop;
var params1 = {
data: property /* 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);

 

 

Hope it helps,

Hi @ShirishMorkhade , Please mark the solution as accepted if it worked for your query.

 

Regards
Ankur

@Ciprian-Traian @anarwal 

 

Yes we already tried this approach but use case don't allow us to rely on any key due to security measures. 

Hence I was very specifically in the question about EncryptPropertyValue

 

Thanks,

Shirish

Hello @ShirishMorkhade ,

 

It seems there isn't a direct way to decrypt, however, you can use the following from the Extension SDK: BaseTypes.ConvertToPrimitive, PasswordPrimitive.convertFromObject, PasswordPrimitive.getDecryptedValue

More information can be found on the ThingWorx Help Center Encryption

 

.Hope it helps,

 

Top Tags