I have custom user entity which contain username and password.
I encrypt password through Encrypt Password server action but how can I decrypt that password.
Hello Pawan Kumar Parmar,Basically, it is not wise to decrypt passwords. It is simple and a better approach to reset it, because once you hash a password reversing is almost mathematically impossible by design. This is valid not only for OS, but for the remain technologies.
However, you can validate it using this default Outsystems server action.
Hope this might help.Ana
Hi @Pawan Kumar Parmar, Why do you want to decrypt a password?
If you want to verify a password, instead of decrypting the user's password present in the database, you should encrypt the new value used for password and match that with the value present in the database.ThanksGitansh Anand
HiSo you are not using the Outsystems Default User Entity right
May I know which encryption you are using
You can use Validate password action from the dependencies, it will ask for the password encrypted one which is stored in the database, and plain text you have to pass the normal password, it will not decrypt the password but it will return whether the password in your database which is encrypted is same as the password you have entered.
But if you are looking for encryption and decryption then check this component.https://www.outsystems.com/forge/component-overview/437/cryptoapiMake sure the way you encrypt the password the same way you can decrypt it, I mean you must know which encryption you are doing example SHA, H2a
I hope this helps
Best RegardsTousif Khan
I use Users EncryptPassword server Action
Then use validate the password, Server action to validate password.
Hi Pawan,
If you follow the same way of how Outsystems is protecting the password entity, this is actually done through a hashing process which is inrevertible. If you would like to compare the password and see if the user is entering the correct one, the right way to do so is to also perform the encrypt password action on the entered text, and be comparing the 2 and see if they match. In this way, you can proceed without decrypting.
Cheers,
Hillman
No, you con't Decrypt password But you can encrypt password and compare with user table password