Facing issues in password decryption
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 03:58 AM
I am sending encrypted value from subflow to virtual agent flow. In subflow, there is OOTB action 'Generate Random Password' which consists of a script for generating random password. In this script step, below line is returning encrypted password :
return sn_fd.GlideActionUtil.setEncryptedOutput((new global.ScopedEncrypter).encrypt(newPwd));
when this encrypted value is returned in virtual agent flow it shows the decrypted value:
var stringValue = vaInputs.new_password.getValue();
var strLength = stringValue.length;
var startPos = (strLength - 27)
var encryptValue = stringValue.substr(startPos,24);
var encrypter = new GlideEncrypter();
return 'Your new password is: ' + encrypter.decrypt(encryptValue);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 04:23 AM
Hi,
So it's failing intermittently?
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 05:25 AM
yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2022 04:24 AM
Hi
it seems that you have not provide all information because in the following code lines it is not clear why are cutting out only a part of the passed string
var strLength = stringValue.length;
var startPos = (strLength - 27)
var encryptValue = stringValue.substr(startPos,24);
And whatever the reason is, it seems to me not correct.
Kind regards
Maik