Display Password as encrypted or with asterisk

Ruchi19
Mega Contributor

we have a field named password which needs to be filled in by support team when they close tasks related to 'reset password catalog service.'
we would like this field either encrypted or display the password with asterisk so it is non readable format on the Task form.
any suggestions ?

8 REPLIES 8

Hi Shane,



I am trying to decrypt password with below code but it is returning encrypted password only.



var Encrypter = new GlideEncrypter();


//var Encrypter = new Packages.com.glide.util.Encrypter();


var psw = Encrypter.decrypt(current.u_password);



I don't see decrypt function is working properly.



Any idea what's wrong here.



-Anand


This works only if the Password field is "Password (2 way encrypted)". The password1 is one way and the Encrypter().decrypt() won't work on it.



Also, GlideEncrypt() is not accessible in Scoped applications on Fuji and later.



Edit:


/ * *************** Setting Password 2 ********************* */


var gr = new GlideRecord(TABLE);


gr.initialize();


gr.COLUMN.setDisplayValue(VALUE);


gr.insert();




/ * *************** Getting Password 2 ********************* */


var gr = new GlideRecord(TABLE);


gr.query();


while(gr.next()) {


gs.info(gr.COLUMN.getDecryptedValue());


}



Thanks,


Pavan,


Scoped Application Security, ServiceNow


pavanw3b | A w3b Security Guy


Hi Pavan



I am using a Fuji version and I want to decrypt the password but I am not getting any solution for fuji version.So do you have any ides regarding this.



Thanks


Amar


pavan_poul
Kilo Expert

Hi Ruchi,



Could you please refer this link for Glide Encryption.


Decrypting a value to set as password not working



Thanks,


Pavan