Need to decrypt password2 field value from system property

Bird1
Mega Sage

Hello,

 

Currently we store the password2 field value in system property and using the GlideEncrypter to decrypt the value. Since ServiceNow is going to deprecated the GlideEncrypter in future, we need to find the solution how to decrypt the password2 value from system property?

 

var encryptedPass = gs.getProperty('abc');
var decryptedPass = encryptedPass.getDecryptedValue();
gs.info (decryptedPass);
 
Tried with above script but get Script: undefined as result.
 
Thanks.
1 ACCEPTED SOLUTION

Amit Verma
Kilo Patron
Kilo Patron

Hi @Bird1 

 

Suppose I have a system property of type Password2 to store Server Password :

AmitVerma_0-1724728092471.png

 

AmitVerma_1-1724728139527.png

 

If I want to retrieve the password in plain text from this system property, I can make use of below code :

var decryptedPassword = gs.getProperty('serverPassword');
gs.info(decryptedPassword);

 

Output :

AmitVerma_2-1724728266822.png

AmitVerma_3-1724728280183.png

 

Thanks and Regards

Amit Verma


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

View solution in original post

4 REPLIES 4

DrewW
Mega Sage
Mega Sage

Already reviewed but could not get the solution, so I post this topic for help.

Amit Verma
Kilo Patron
Kilo Patron

Hi @Bird1 

 

Suppose I have a system property of type Password2 to store Server Password :

AmitVerma_0-1724728092471.png

 

AmitVerma_1-1724728139527.png

 

If I want to retrieve the password in plain text from this system property, I can make use of below code :

var decryptedPassword = gs.getProperty('serverPassword');
gs.info(decryptedPassword);

 

Output :

AmitVerma_2-1724728266822.png

AmitVerma_3-1724728280183.png

 

Thanks and Regards

Amit Verma


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

Thanks Amit. It's very simple and I was overthinking.