How to encrypt /decrypt Passwords?

siva44
Tera Contributor

Hai I am using the run script for reset AD password through workflow but in script we are used the  GlideEncrypter  but servicenow The GlideEncrypter API is planned for deprecation so how to modify that script

 

script:

//Generate Random Password and Set AD password.

               var encr= new GlideEncrypter();

                var clearString = new PwdCryptoSecureAutoGenPassword().generatePassword();

                var encrString = encr.encrypt(clearString);  //Encrypted password for use in the Set AD Password Activity.

               

                workflow.scratchpad.pass = encrString;  //Set scratchpad password variable to the encrypted password string.

                var decrString = workflow.scratchpad.clearpass = encr.decrypt(encrString);  //Can be used as the clear text password

4 REPLIES 4

Anand Kumar P
Giga Patron
Giga Patron

Jeenet1
Tera Contributor

@siva44 Did you find any solutions that work?

Amit Verma
Kilo Patron
Kilo Patron

Hi @siva44 

 

You could have a Password2 type system property defined and get the property value within the workflow by using 

 

workflow.scratchpad.pass = gs.getProperty('name of the property');

 

 

Thanks and Regards

Amit Verma


Please mark this response as correct and helpful if it assisted you with your question.

Hi @Amit Verma  okay But How to store in system property those auto generate passowords