Friday, 30 November 2018

Script to Encrypt or Decrypt ServiceNow Credential


Glide Record for Encryption and Decryption

var gr=new GlideRecord('discovery_credential)
gr.addQuery('name','xxx');
gr.query();
if(gr.next())
{
crypt=new GlideEncrypter();
pw_hash=gr.password;
var pw_txt=crypt.decrypt(pw_hash);
}



Function of Encryption and Decryption

var Encrypter = new GlideEncrypter();  
var encrypted = current.u_password; // current.<<your field name>>  
var decrypted = Encrypter.decrypt(encrypted);   

No comments:

Post a comment