- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 03:54 AM
Hello Community,
How to decrypt the user password using script ?
I am trying below script but its not working
var gr = new GlideRecord('sys_user');
gr.get(gs.getUserID())
var Encrypter = new GlideEncrypter();
var decrypted = Encrypter.decrypt(gr.user_password);
gs.print(decrypted);
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 03:57 AM
Hi there,
This does not work for the password field on sys_user (which is of type Password (1 Way Encrypted)).
This would work on for example the basic_auth_credentials table for the password field (which is of type (Password (2 Way Encrypted)).
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 03:57 AM
Hi there,
This does not work for the password field on sys_user (which is of type Password (1 Way Encrypted)).
This would work on for example the basic_auth_credentials table for the password field (which is of type (Password (2 Way Encrypted)).
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 03:59 AM
Hello Mark,
Thanks for the response, could you please share any other scripts which decrypt the user password ?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 04:01 AM
For sys_user, you can't.
If my answer helped you in any way, please then mark it as helpful.
Kind regards,
Mark
2020-2022 ServiceNow Community MVP
2020-2022 ServiceNow Developer MVP
---
LinkedIn
Community article, blog, video list
Kind regards,
Mark Roethof
Independent ServiceNow Consultant
10x ServiceNow MVP
---
~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2022 04:03 AM
Okay, Thank you
As Password field in sys_user table is type password. is there any way to decrypt password of password2 type field ?