GlideEncrypter API deprecation - help replacing a piece of code HowTo

AEterni
Mega Guru

Hello All,

We have the following code running within a Flow.

/*GET PASSOWRD*/
var pwvalue = new GlideappMaskedQuestion().decode(new GlideEncrypter().decrypt(fd_data._1__get_catalog_variables.password));
var encodedpw = new GlideappMaskedQuestion().decode(new GlideEncrypter("MY_ENCRYPTION_KEY").encrypt(pwvalue));

It recently started failing, so I logged a ticket with ServiceNow. They explained that the GlideEncrypter API is deprecated and shared this KB with me.

 

I managed to replace the first part of the code where I decrypt the value.

/*GET PASSOWRD*/
var pwvalue = new GlideappMaskedQuestion().decode(gr.password2field.getDecryptedValue(fd_data._1__get_catalog_variables.password));

I can't understand how to replace the part where I encrypt it again using "MY_ENCRYPTION_KEY".

 

Any idea?

 

Thank you.

1 REPLY 1

Sohail Khilji
Kilo Patron
Kilo Patron

Hi @AEterni ,

 

Yes GlideEncrypter API  is no more supported. 

 

you will need to use this as a replacement :

 

https://docs.servicenow.com/bundle/washingtondc-platform-security/page/administer/key-management-fra...

 

https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB1320986

 

I hope this helps...


☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....

LinkedIn - Lets Connect