GlideEncrypter - Global (deprecated)
The GlideEncrypter API provides methods to encrypt and decrypt strings using the Triple DES algorithm.
Note:
The GlideEncrypter API uses the three-key Triple DES encryption standard which NIST 800-131A Rev 2 has recommended against using to encrypt data after 2023. Please take a moment to review the information below.
- Starting with the Xanadu family release, the GlideEncrypter API is not recommended for use, as this API is deprecated according to NIST guidelines. With the Zurich release, the GlideEncrypter API will be upgraded to automatically use Key Management Framework.
- New instance installations and re-installations using the GlideEncrypter API in the ServiceNow AI Platform will not be permitted in the Zurich release planned for September 2025. Use the Instance Scan to identify where GlideEncrypter is used on your instance. Find this tool on your instance by navigating to .
- Review the following Knowledge Base article for migration guidance to the applicable replacement solution based on your current use case: Alternatives to deprecated GlideEncrypter APIs.
You can use this API in server scripts in the global scope. The
GlideEncrypter class has two constructors:
- GlideEncrypter()
- GlideEncrypter(String key)
GlideEncrypter - GlideEncrypter()
Creates an instance of the GlideEncrypter class using a default (static) encryption key.
| Name | Type | Description |
|---|---|---|
| None |
var encr = new GlideEncrypter();
GlideEncrypter - GlideEncrypter(String key)
Creates an instance of the GlideEncrypter class using a given encryption key.
| Name | Type | Description |
|---|---|---|
| key | String | Your encryption key must be exactly 24 characters. A key longer than 24 characters will be truncated. |
var encr = new GlideEncrypter(myKey);
GlideEncrypter - decrypt(String encryptedString)
Decrypts a clear string using the Triple DES algorithm.
| Name | Type | Description |
|---|---|---|
| encryptedString | String | String to be decrypted. |
| Type | Description |
|---|---|
| String | Clear text string. |
var encr = new GlideEncrypter();
var clearString = 'abcdefg';
var encrString = encr.encrypt(clearString);
var decrString = encr.decrypt(encrString);
gs.print("Decrypted string = " + decrString);
Output:
Decrypted string = abcdefgGlideEncrypter - encrypt(String clearString)
Encrypts a clear string using the Triple DES algorithm.
| Name | Type | Description |
|---|---|---|
| clearString | String | String to be encrypted. |
| Type | Description |
|---|---|
| String | Encrypted string. |
var encr = new GlideEncrypter();
var clearString = 'abcdefg';
var encrString = encr.encrypt(clearString);
gs.print("Encrypted string = " + encrString);
Output:
Encrypted string = 3wjpvKtUIi4=