Variable Encryption
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 12:30 AM
We have set up integration between ServiceNow and an External System for automation. The requirement is that the user will enter the password in the ServiceNow catalog item, and it must be sent in the payload in an encrypted way to the external system (not ServiceNow). This allows the External System to decrypt it using the decryption key and use the same password for the reset. I can use the masked variable type to encrypt the password variable, but where do I get the decryption key to decrypt the password?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-24-2023 12:45 AM
Hi @PD6 ,
You can store username and password in basic_auth_credentials table .
And in business rule script you can use below one
var Encrypter = new GlideEncrypter();
var encrypted = current.u_password; // current.<<your field name>>
var decrypted = Encrypter.decrypt(encrypted);
gs.addInfoMessage("encrypted.. " + encrypted);
gs.addInfoMessage("decrypted.. " + decrypted);
Please mark it as solution proposed and helpful if it serves your purpose.
Thanks,
Anand