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
Arun BArun B 

Encrypting/decrypting data

Hello there,
I have a requirement where I need to encrypt/decrypt some data stored on the custom objects .. i.e., I need to encrypt some information, store them in a custom object, and then when needed , I need to query the encrypted information and decrypt it.

Does any API allows me to do this ? or any other way I can achieve this encryption for my data ? I am currently using Flex toolkit for for my project,

I would appreciate any response.

Arun B

Ron HessRon Hess
take a look at the crypto utilities in Apex Code

you can crypt using this i think, then store in a custom object.

how strong do you need to encrypt? just base64 or something more?
Even easier, just call support and ask them to enable the encrypted custom fields feature, and salesforce will do all the work for you.
But what if we need to put encrypted field in the managed package for our product? Do the customers who need to use our application has to call Salesforce support to enable their encrypted fields?

Is there no way to encrypt and decrypt data in Apex code? (We just saw the Crypto class but it seems it only provides encryption but not the decryption.)

Message Edited by Enzigma on 01-13-2009 02:50 AM
Sami CohenSami Cohen


I have the same issue.


Did anyone find something?



Are the encrypted fields stored in an encrypted manner in the Database as well or only at the application level?
Yes, encrypted fields are stored encrypted in the db.