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 */
});
Helpcenter section on password encryption should be useful here:
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?
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
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.
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);