- Post History
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
05-17-2021 11:27 PM - edited 10-11-2022 02:42 AM
In this video, we learn the ServiceNow GlideEncrypter API. ServiceNow Decrypt Password can be done via GlideEncrypter API .IN this video we are gonna decrypt the encrypted password to get the decrypted password.
GlideEncrypter provides methods to encrypt and decrypt strings using the Triple-DES algorithm. The GlideEncrypter class is used in server scripts in the global scope. The GlideEncrypter class has two constructors:
- GlideEncrypter()
- GlideEncrypter()
Creates an instance of the GlideEncrypter class using a default (static) encryption key.
Example
var encr = new GlideEncrypter();
GlideEncrypter(String key)
Creates an instance of the GlideEncrypter class using a given encryption key. Parameters Name Type Description key String Your encryption key must be exactly 24 characters. A key longer than 24 characters will be truncated.
Example
var encr = new GlideEncrypter(myKey);
decrypt(String encryptedString)
Decrypts a clear string using the Triple DES algorithm.
Parameters Name Type Description encryptedString String String to be decrypted. Returns Type Description String Clear text string.
Example
var encr = new GlideEncrypter();
var clearString = 'abcdefg';
var encrString = encr.encrypt(clearString);
var decrString = encr.decrypt(encrString);
gs.print("Decrypted string = " + decrString);
Decrypted string = abcdefg
Please put it in the comments which you wanna see in the future. If this video is helpful then, please do not forget to like, subscribe and share my youtube channel Technomonk.
- 11,626 Views

- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
You missed the "reencryptParamForAutomation" method. Which if you are doing automations I think is the most important one.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0856481
Conveniently it is missing from the Docs site. The example code in the KBA is assuming you are using it in a flow activity.
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Sadly, the GlideEncrypter API is going to be deprecated by ServiceNow, so this is no longer valid. The deprecation has been postponed I think to Zurich, so customer has still some time to revert to some alternatives.
Here a ServiceNow KB with alternatives to GlideEncrypter:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1320986
For decrypting a password2 field value from a GlideRecord, it would be as simple as calling gr.field_name.getDecryptedValue();
Same for encrypting a value in a password2 field, we can just call the setDisplayValue and passing the plain text value.
There are use cases, though, for example when sending a parameter to a probe, where we don't want to send it as plain text. Before we were using reencryptParamForAutomation from the GlideEncrypter API, while now due to the deprecation, we could use:
- Mark as Read
- Mark as New
- Bookmark
- Permalink
- Report Inappropriate Content
Sadly, the GlideEncrypter API is going to be deprecated by ServiceNow, so this is no longer valid. The deprecation has been postponed I think to Zurich, so customer has still some time to revert to some alternatives.
Here a ServiceNow KB with alternatives to GlideEncrypter:
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1320986
For decrypting a password2 field value from a GlideRecord, it would be as simple as calling gr.field_name.getDecryptedValue();
Same for encrypting a value in a password2 field, we can just call the setDisplayValue and passing the plain text value.
There are use cases, though, for example when sending a parameter to a probe, where we don't want to send it as plain text. Before we were using reencryptParamForAutomation from the GlideEncrypter API, while now due to the deprecation, we could use: