I am working on an org in unlimited edition. Most of the 20 schools we are creating online applications for have separate banks. I am new to Salesforce and wondering what the best practice is for securing information like bank ID and password. My current thought is to create separate Bank Connection object with a bunch of records inside that each have bank id, bank pass, and school name. Then I was going to set the security settings so the apex code could query the information by school name, but not by id/pass.

Is there a better way out there? I looked at Custom Settings but I'm not sure if/how that's better than what I am thinking. Thanks for your input!

  • Don't store passwords in Salesforce; there is no good (secure) way of doing it. The rest will depend on the requirements, such as who should and shouldn't be able to see it. Can you expand on your requirements?
    – Mike Chale
    Jul 12, 2013 at 15:28
  • When the application makes a connection to the bank for the payment process, it needs to give it what I assume is that school's id and password for that bank, allowing the prospective student to pay to that account. That id/pass is what I am trying to make sure stays secure.
    – JR Smith
    Jul 12, 2013 at 15:36

1 Answer 1


There are a number of ways to secure sensitive data in Salesforce. Disclaimer: I'm not recommending a best practice, just giving you the options in Salesforce. I'd consult with a security person for what would work best in your case. Here are the options:

Encrypted Custom Fields - Encrypted custom fields are text fields that can contain letters, numbers, or symbols but are encrypted. The value of an encrypted field is only visible to users that have the “View Encrypted Data” permission.

Apex Crypto Class - The methods in the Crypto class provide standard algorithms for creating digests, message authentication codes, and signatures, as well as encrypting and decrypting information. These can be used for securing content in Force.com. You can only view data in Visualforce pages, standard pages will only show encrypted string.

Data Residency Option - Store only tokens in Salesforce and have a gateway on premise that converts tokens to the real values as it is retrieve. Very expensive.

Store the data somewhere else and then use web service calls between Salesforce and the other location to retrieve the data when you need it.

  • I'll have to check with the project architect, but it seems like storing the data somewhere else and accessing it through a web service call might be the most secure. Whether or not that will work with this client remains to be seen. Thanks for all your suggestions.
    – JR Smith
    Jul 12, 2013 at 15:40
  • Encrypted Custom Fields is probably the easiest solution (no code required), while the Crypto class is more flexible. You could use two fields for this case, one field to show a "mask" and accept new input, and a hidden backing field that stores the actual encrypted data. The third option might not work, because you can't callout during triggers, if that's a concern.
    – sfdcfox
    Jul 12, 2013 at 16:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .