File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed
Background Scripts/encryptAndDecryptPasswordFields Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ //For Non-password fields Encryption syntax using Key Management Framework Cryptographic module
2
+
3
+ var password = "Hello World" ;
4
+ var encryptOp = new sn_kmf_ns . KMFCryptoOperation ( "global.vamsi_glideencrypter" , "SYMMETRIC_ENCRYPTION" )
5
+ . withInputFormat ( "KMFNone" ) ;
6
+ var encryptedText = encryptOp . doOperation ( password ) ; //Encrypting Hello world
7
+ gs . info ( "After Encryption: " + encryptedText ) ;
8
+
9
+
10
+ //For Non-password fields Decryption syntax using Key Management Framework Cryptographic module
11
+
12
+ var encryptOp = new sn_kmf_ns . KMFCryptoOperation ( "global.vamsi_glideencrypter" , "SYMMETRIC_DECRYPTION" )
13
+ . withOutputFormat ( "KMFNone" ) ;
14
+ var clear_text = encryptOp . doOperation ( '91ddbb5d47c012101b589d2f316d438012p3lgrR72vEQW5yLk-WXKQ==aGqxYzUXuyLt3HTqcW6-HA==' ) ; //Pass Cipher text of Hello World (Which is the output of first script)
15
+ gs . info ( "After decryption: " + clear_text ) ;
Original file line number Diff line number Diff line change
1
+ Generally when you want to encrypt or decrypt any Non-password fields earlier we have Glide Encrypter API methods for encryption and decryption.
2
+ The GlideEncrypter API uses 3DES encryption standard with NIST 800-131 A Rev2 has recommended against using to encrypt data after 2023.
3
+ ServiceNow offers alternative cryptographic (Key Management Framwork) solutions to the GlideEncrypter API.
4
+
5
+ Note: ServiceNow recommending to deprecate GlideEncrypter API with in the instances as soon as possible. The actual dead line is September 2025.
6
+
7
+ These are the sample scripts I ran in my PDI: For Non-password fields. I used AES 256 algorithm for Symmetric Data Encryption/Decryption.
8
+
9
+ To test the scripts you need to create Cryptographic module and generate the key.
10
+
11
+ "global.vamsi_glideencrypter" is my cryptographic module name.
You can’t perform that action at this time.
0 commit comments