- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 03:54 AM
Hi,
I have a requirement to encrypt a password in scoped aplication (security Incident Response). Please help me in achieving the target. I know how to do the same in global scope using GlideEncrypter().
var encr = new GlideEncrypter();
workflow.scratchpad.password = encr.encrypt(example);
but GlideEncrypter() does not work in scoped applications, kindly help me with an alternative to implement this requirement.
Thanks,
Gazal
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 04:06 AM
Hi,
Create a new script include in the global context that takes your string value as a parameter and then use GlideEncrypter to do the work for you inside the script include function. You then return the the encrypted value to your calling script. In order to call the new include from a scope application script you can use similar to the following:
var encryptmypwd = new global.myEncrypterInclude(); //Note the global prefix
var encryptedpwd = encryptmypwd.encryptPwd("myrandompasswordstring");
encryptPwd above is the function inside my new script include that uses GlideEncrypter to encrypt for me.
Kindly mark it correct and helpful if it is applicable.
Thanks,
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 04:06 AM
Hi,
Create a new script include in the global context that takes your string value as a parameter and then use GlideEncrypter to do the work for you inside the script include function. You then return the the encrypted value to your calling script. In order to call the new include from a scope application script you can use similar to the following:
var encryptmypwd = new global.myEncrypterInclude(); //Note the global prefix
var encryptedpwd = encryptmypwd.encryptPwd("myrandompasswordstring");
encryptPwd above is the function inside my new script include that uses GlideEncrypter to encrypt for me.
Kindly mark it correct and helpful if it is applicable.
Thanks,
Priyanka
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 04:25 AM
Hi Priyanka,
This method worked. 🙂
Thanks a lot,
Gazal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 04:13 AM
Hi Gazal
Try this code in business rule.
var Encrypter = new GlideEncrypter();
var encrypted = current.u_password; // current.<<your field name>>
var decrypted = Encrypter.decrypt(encrypted);
gs.addInfoMessage("encrypted.. " + encrypted);
gs.addInfoMessage("decrypted.. " + decrypted);
Please mark the reply as Helpful/Correct, if applicable.
Saurabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2020 04:24 AM
Hey Saurabh,
I have tried ith new script include and calling it in my workflow. It worked 🙂
Thanks,
Gazal