function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Sumant KuchipudiSumant Kuchipudi 

How to decrypt the encrpted password in apex?

Hi,
I have a custom object with an encrypted text field to store password from record. I'm trying to write a trigger to read the encrypted field and send via email. Would that be possible? I tried to decrypt the password but recieved the below error.
System.StringException: Unrecognized base64 character: *

 
Best Answer chosen by Sumant Kuchipudi
SwethaSwetha (Salesforce Developers) 
HI Sumant,
Can you share a reproducible code snippet that I can use to test in my org?

Related posts: https://salesforce.stackexchange.com/questions/145627/salesforce-decrypt-encrypted-field

https://salesforce.stackexchange.com/questions/90063/decrypting-salesforce-encrypted-fields

Thanks

All Answers

SwethaSwetha (Salesforce Developers) 
HI Sumant,
Can you share a reproducible code snippet that I can use to test in my org?

Related posts: https://salesforce.stackexchange.com/questions/145627/salesforce-decrypt-encrypted-field

https://salesforce.stackexchange.com/questions/90063/decrypting-salesforce-encrypted-fields

Thanks
This was selected as the best answer
Sumant KuchipudiSumant Kuchipudi
Hi Swetha,
I got the answer from both links you shared. Thank you.
Another question related to this: If an user who don't have the "Vew Encrypted Data" Permission sets enabled send email with the password (via trigger), would the be visible to the end