Resources /
Blog

Salesforce Shield Platform Encryption: Admin Guide

Submit your details to get a book

9
Min Read
Resources /
Blog

Salesforce Shield Platform Encryption: Admin Guide

Download

Submit your details to get a book

9
Min Read
Glowing storage tank on a ringed platform, linked by a line to lock, key, shield, database and check tiles
Glowing storage tank on a ringed platform, linked by a line to lock, key, shield, database and check tiles

Salesforce Shield Platform Encryption encrypts sensitive Salesforce data at rest with 256-bit AES and key material you control. You get it as part of Salesforce Shield, alongside Event Monitoring, Field Audit Trail and Data Detect, though you can also buy each tool on its own.

There are two ways to encrypt, and they behave quite differently. Database Encryption covers most of your data and still lets you filter and sort, while field-level encryption protects the fields you pick but limits what you can do with them.

How is Shield Platform Encryption different from Classic Encryption?

Classic Encryption comes with the base user license and uses 128-bit AES. According to Salesforce's comparison of the two, it only works on its own custom field type, and that field tops out at 175 characters.

Shield Platform Encryption costs extra and uses 256-bit AES: AES CBC for field-level encryption and AES GCM for Database Encryption. The Shield Platform Encryption overview says you can use it on lots of standard and custom fields, plus files, search indexes and attachments, with key material you generate or upload yourself.

Turning it on won't touch fields you already protect with Classic Encryption, according to the Platform Encryption Q&A. Encrypted fields and files don't eat into your storage limits either, but encryption does count against your per-transaction Apex limits.

You'll need Enterprise, Performance or Unlimited Edition plus a Shield or Shield Platform Encryption license. If you just want to try it, the same overview says it's free in Developer Edition, and it shows up in sandboxes once it's provisioned for production.

Should you use Database Encryption or field-level encryption?

Database Encryption is available to Hyperforce customers who have a Shield or Shield Platform Encryption license. Once you're on it, Salesforce's Database Encryption page says most of your data gets encrypted by default with a tenant-specific key, and filtering and sorting still work.

Field-level encryption (FLE) is different, because it works at the app tier before your data is stored. You don't have to choose, though, since the same page says you can run both, and Database Encryption gets applied after the field-level encryption.

Salesforce's own comparison of FLE and Database Encryption lays out the main differences. It's a handy way to check whether Database Encryption on its own covers what your auditor wants.

What differsField-level encryptionDatabase Encryption
Requires HyperforceNoYes
What it encryptsStandard and custom fields you chooseThe full transactional database
Filtering and sortingFiltering limited to deterministic fields, no sortingYes, unless a field also uses field-level encryption
Key optionsSalesforce key, BYOK, cache-only keys, External Key ManagementSalesforce key or BYOK
Key rotationYou sync data from the Encryption Statistics pageSalesforce syncs data to the latest key over time

Be careful before you switch Database Encryption on, because the Q&A calls it a permanent action. If your Shield license lapses, you also lose the ability to manage and rotate your keys.

How do you set up Shield Platform Encryption?

Salesforce calls your encryption policy your plan for encrypting data, and for field-level encryption you set it up in a fixed order. The graphic below shows that order, and the list under it links each step to its Salesforce Help page.

Infographic of six steps for turning on Shield field-level encryption, from testing in a full copy sandbox and generating and exporting a tenant secret to analyzing fields, encrypting them one at a time and syncing existing records
  1. Try it in a full copy sandbox first and test it under real-world conditions, which is what the Platform Encryption Q&A recommends.
  2. In Encryption Settings, turn on Generate Initial Probabilistic Tenant Secret, which has to exist before you can generate a deterministic one.
  3. Export the tenant secret from Key Management and store the file somewhere safe, so you can import it again if you ever need to.
  4. In the Shield app, run the field analyzer on up to 100 fields at a time, since analysis is required before a field can be encrypted.
  5. Encrypt each field with the scheme you chose, one after another, because field-level encryption can't be turned on as a single bulk action.
  6. Sync your existing records from the Encryption Statistics and Data Sync page, which you can do once every 7 days.

Don't skip step 6, because turning a field on only encrypts new or modified records. Salesforce's steps for turning on FLE say your existing records need an encryption sync after that.

The field analyzer only shows blockers for now. If you want to see impacts too, like list views and report filters that encryption could break, the analyzer guide points you to the analyzer in the Shield Extension managed package.

Should you pick probabilistic or deterministic encryption?

With probabilistic encryption, the same value comes out as different ciphertext every time, while deterministic encryption always gives you the same one. Salesforce's scheme comparison says to stick with probabilistic by default whenever you don't need filtering or exact matches.

You pick the scheme field by field, and deterministic comes with tighter rules. Every row below comes from Salesforce's considerations for deterministic encryption and its general considerations page.

What you needProbabilisticDeterministic
Exact-match filters in reports and list viewsNot supportedSupported with equals and not equal to
SOQL WHERE clauseNot supportedSupported on non-formula fields
SOQL ORDER BY, GROUP BY, LIKE or STARTS WITHNot supportedNot supported
Custom matching rules for duplicatesNot supportedSupported
Field typesMost fields, files and attachmentsCustom URL, email, phone, text and text area fields

Watch out for case-insensitive deterministic encryption, because it has a hidden cost. The deterministic considerations explain that Salesforce stores a lowercase copy of the data as a custom field, so 200 custom fields plus one encrypted that way count as 201.

Which Salesforce features change when fields are encrypted?

Encryption keeps the data safe, but it also limits how you can query, filter and report on it. These points come from Salesforce's general Shield Platform Encryption considerations, which Salesforce updates as features change.

FeatureWhat changes when fields are encrypted
Sharing rules and lookupsEncrypted fields can't be used in criteria-based sharing rules, similar opportunities searches or external lookup relationships
SOQL and SOSLProbabilistic fields can't go into SOQL or SOSL aggregate functions or WHERE, GROUP BY and ORDER BY clauses
List views, reports and dashboardsList views can't sort by encrypted fields, and report charts and dashboard components that show encrypted values might be cached unencrypted
Duplicate matchingStandard matching rules that include encrypted fields don't detect duplicates, so custom matching rules have to reference deterministic fields
Paused flowsA paused flow interview is serialized to the database, so encrypted values the flow loaded can be saved unencrypted while it waits
Unique, External ID and custom metadataCustom fields with the Unique or External ID attribute can't take probabilistic encryption, and custom metadata types can't be encrypted at all

Shield Platform Encryption doesn't provide a masking feature, according to the same considerations page. If you need masked data in sandboxes, our guide to Salesforce data masking covers that separately.

How does encryption affect deployments and sandboxes?

Salesforce doesn't cap how many fields you can encrypt, but it does cap deployments. With Shield Platform Encryption on, Salesforce's deployment guide says you can deploy only 80 fields at a time and must split bigger packages into phases of fewer than 80 fields.

Salesforce also notes that the target org's Encrypted field attribute is the one that wins when you deploy. Encryption settings can also be deployed through the PlatformEncryptionSettings Metadata API type, and Salesforce checks every deployment against its encryption guidelines.

If you ship with change sets, our post on async metadata retrieval covers where they fall short. Our guide to profile metadata deployment covers the profile settings that usually travel with encrypted fields.

Sandbox refreshes copy encryption too. Salesforce's sandbox page says a refresh copies every encryption setting, tenant secrets from production included, and recommends rotating tenant secrets in the sandbox afterward.

Once a sandbox is refreshed, rotating or destroying its tenant secret doesn't affect production, per the same page. Our guide to Salesforce sandbox types explains what a full copy sandbox holds and when to use one.

How should admins manage tenant secrets and keys?

Losing a key is the one mistake Salesforce can't fix. The Destroy Key Material page warns that "Salesforce can't help you with deleted, destroyed, or misplaced tenant secrets and keys."

Its warning box makes you solely responsible for backing up your keys. It suggests keeping backups in source control with a current registry of your keys outside Salesforce, and notes that Database Encryption keys can't be destroyed.

Rotation has minimum intervals that vary by key type. In production, Salesforce's rotation table sets 24 hours for probabilistic fields and files, 7 days for deterministic fields and 3 months for Database Encryption.

When you rotate, older data stays readable as long as you don't destroy the old tenant secret. The Q&A also caps you at 50 active and archived field-level tenant secrets, keys held outside Salesforce included.

You don't have to let Salesforce generate your key material. With Bring Your Own Key, you create it in your own infrastructure and upload it, and you control when it's generated, activated, revoked or destroyed.

You can also keep keys outside Salesforce with the External Key Management or Cache-Only Key services, which fetch them on demand. The BYOK page notes that cache-only keys aren't available for Database Encryption.

Lock down who can touch keys as well. Generating, exporting and destroying key material needs the Manage Encryption Keys permission, and you can require multi-factor authentication for those tasks through Identity Verification.

Which compliance rules does Shield Platform Encryption support?

Encryption at rest shows up in several regulations, but it's one control among many. The HIPAA Security Rule lists encryption and decryption of electronic protected health information as an addressable specification.

GDPR names "the pseudonymisation and encryption of personal data" among the security measures in Article 32. Our Salesforce GDPR implementation guide covers the rest of what the regulation asks of your org.

Salesforce pitches Shield at HIPAA, SOX and PCI DSS work, with Field Audit Trail keeping field history. For SOX, our SOX compliance checklist covers the change controls that sit around encryption, and the Salesforce security model shows where encryption fits among the other layers.

Where does Flosum fit?

Encrypted fields still move through your release process like any other metadata. The Flosum DevOps platform keeps a dependency graph of your org and checks every change against it, so missing references surface before deployment.

Every change also goes through one platform with the same version control, approvals and audit trail. Flosum DevOps runs in Flosum's cloud or in your own cloud.

FAQs

What is Salesforce Shield?

Salesforce Shield is a paid security suite made up of Platform Encryption, Event Monitoring, Field Audit Trail and Data Detect. All four come with Shield, and you can also buy any one of them on its own.

How much does Salesforce Shield cost?

Salesforce doesn't publish a list price, and its Shield page says pricing varies with each customer's needs. You can try Shield Platform Encryption free in Developer Edition before you buy.

How do you know when encrypted data needs a sync?

In Setup, search for Platform Encryption and open Encryption Statistics. Its Sync Needed column shows Yes when fields, keys or schemes have changed and existing data still needs a sync.

Does Shield Platform Encryption slow Salesforce down?

Salesforce's Platform Encryption Q&A says users are unlikely to notice a difference day to day. It still recommends testing in a full copy sandbox under real-world conditions before you enable it in production.

Is there a limit on deploying encrypted fields?

Salesforce's deployment guide limits packages to 80 encrypted fields at a time. With 80 or more fields to encrypt, you deploy the package in phases of fewer than 80 fields each.

Book a demo to see how Flosum moves encrypted-field changes from sandbox to production.

Table Of Contents
Author
Stay Up-to-Date
Get flosum.com news in your inbox.

Thank you for subscribing

Ship Salesforce changes faster
Teams on Flosum report 40% higher development velocity and 75%
fewer merge conflicts.
Free to start  |  No credit card required