platform_encryption_guide
platform_encryption_guide
Encryption Implementation
Guide
names and marks. Other marks appearing herein may be trademarks of their respective owners.
CONTENTS
Shield Platform Encryption gives your data a whole new layer of security while preserving critical
EDITIONS
platform functionality. You can encrypt sensitive data at rest, not just when transmitted over a
network, so your company can confidently comply with privacy policies, regulatory requirements, Available in both Lightning
and contractual obligations for handling private data. Experience and Salesforce
Classic (not available in all
Important: Where possible, we changed noninclusive terms to align with our company
orgs).
value of Equality. We maintained certain terms to avoid any effect on customer
implementations. Available as an add-on
Shield Platform Encryption builds on the classic encryption options that Salesforce offers all license subscription in: Enterprise,
holders. Data stored in many standard and custom fields and in files and attachments is encrypted Performance, and
Unlimited Editions. Requires
using an advanced hardware security module (HSM)-based key derivation system. So it’s protected
purchasing Salesforce
even when other lines of defense are compromised.
Shield. Available in
Your data encryption key material is never saved or shared across orgs. You can choose to have Developer Edition at no
Salesforce generate key material for you, or you can upload your own. By default, Shield Platform charge.
Encryption uses a key derivation function (KDF) to derive data encryption keys on demand from a
primary secret and your org-specific key material. It then stores that derived data encryption key
(DEK) in an encrypted key cache. DEKs are never stored on disk, and your org-specific key material is always wrapped.
You can also opt out of key derivation on a key-by-key basis. Or you can store your DEK outside of Salesforce and have either the External
Key Management service or the Cache-Only Key Service fetch it on demand from a key service that you control. The DEKs that you provide
are always wrapped. No matter how you choose to manage your keys, Shield Platform Encryption secures your key material at every
stage of the encryption process.
You can try out Shield Platform Encryption at no charge in Developer Edition orgs. It’s available in sandboxes after it’s provisioned for
your production org.
Tip: Whether you’re using Shield Platform Encryption or Classic Encryption, you can track the encryption policy status across your
entire org. It’s a simple process with the Security Center app, which can capture many useful security metrics. See Take Charge of
Your Security Goals with Security Center.
IN THIS SECTION:
What You Can Encrypt
Shield Platform Encryption lets you encrypt a wide variety of standard fields and custom fields. You can also encrypt files and
attachments stored in Salesforce, Salesforce search indexes, and more. We continue to make more fields and files available for
encryption.
Platform Encryption Q&A
Here are some frequently asked questions about platform encryption.
How Shield Platform Encryption Works
Shield Platform Encryption relies on a unique tenant secret that you control and a primary secret that Salesforce maintains. By default,
we combine these secrets to create your unique data encryption key (DEK). You can also supply your own final DEK. We use your
DEK to encrypt data that your users put into Salesforce, and we use it to decrypt data when your authorized users need it.
1
Strengthen Your Data’s Security with Shield Platform What You Can Encrypt
Encryption
2
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
3
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Activity Description (encrypts Event—Description Selecting an Activity field encrypts that field
and Task—Comment) on standalone events, event series
(Lightning Experience), and recurring events
Subject (encrypts Event—Subject and (Salesforce Classic).
Task—Subject)
Response
4
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Cases Description
Subject
Contacts Assistant
Assistant Phone
Description
Email
Fax
Home Phone
Mailing Address (encrypts Mailing Street
and Mailing City)
5
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Email Messages From Name If you use Email-to-Case, these fields are also
encrypted on the customer emails that
From Name generate cases.
To Address
CC Address
BCC Address
Subject
Text Body
HTML Body
Headers
6
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Opportunities Description
Next Step
Opportunity Name
7
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Recommendations Description
Regulatory Code Violation Corrective Action Description Emergency Response Management for
Public Sector standard objects and fields are
Description available to users who have the Emergency
Response for Public Sector permission set
license.
8
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
User Email
9
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Financial Account Financial Account Number
Name
Note: Deterministic encryption is unavailable for long text fields and fields that have Notes in the name.
Object Fields
Care Plan Template Problem Name
10
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Care Program Provider Name
11
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Member Plan Affiliation
Group Number
Issuer Number
Member Number
Name
Primary Care Physician
Source System Identifier
Object Fields
Application Form Seller Item Vehicle Identification Number
Engine Number
Vehicle Registration Number
PropertyAddress
Scheduled Delivery Date
Property UnitI dentifier
Make
Model
Trim
12
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Interaction Description
Name
13
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Mandate Effective Date
Bank Account Number
Bank Routing Number
Disbursement Address
Bank Branch Address
Object Fields
Budget Participant Comments
Object Fields
Business Milestone Milestone Description
Milestone Name
14
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Event Name
Object Fields
Gift Entry City
Country
Email
Expiry Month
Expiry Year
First Name
Home Phone
Last 4
Last Name
Mobile Phone
Organization Name
State/Province
Street
Object Fields
Application Form Evaluation Participant Comments
15
Strengthen Your Data’s Security with Shield Platform Which Standard Fields Can I Encrypt?
Encryption
Object Fields
Case Proceeding Participant Comments
Object Fields
Lookup Data Lookup Data
16
Strengthen Your Data’s Security with Shield Platform Which Custom Fields Can I Encrypt?
Encryption
Object Fields
Street Address
Street Address_2
SEE ALSO:
Set Up Field-Level Encryption
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the Available in both Salesforce
difference? Classic (not available in all
orgs) and Lightning
• Email Experience.
• Phone
Available as an add-on
• Text subscription in: Enterprise,
• Text Area Performance, and
• Text Area (Long) Unlimited Editions. Requires
purchasing Salesforce Shield
• Text Area (Rich) or Shield Platform
• URL Encryption. Available in
• Date Developer Edition at no
charge.
• Date/Time
Note: To enable encryption on any custom object, you navigate directly to the object in
Object Manager
17
Strengthen Your Data’s Security with Shield Platform Which Files Are Encrypted?
Encryption
After a custom field is encrypted, you can’t change the field type. For custom phone and email fields, you also can’t change the field
format.
Important: When you encrypt the Name field, enhanced lookups are automatically enabled. Enhanced lookups improve the
user’s experience by searching only through records that have been looked up recently, and not all existing records. Switching to
enhanced lookups is a one-way change. You can’t go back to standard lookups, even if you disable encryption.
You can’t use Schema Builder to create an encrypted custom field.
To encrypt custom fields that have the Unique or External ID attribute, you can only use deterministic encryption.
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
SEE ALSO:
Set Up Field-Level Encryption
18
Strengthen Your Data’s Security with Shield Platform What Other Data Elements Can I Encrypt?
Encryption
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
Note: Enabling Encryption for Chatter encrypts all eligible Chatter fields. You can’t choose to encrypt only some Chatter fields.
19
Strengthen Your Data’s Security with Shield Platform Platform Encryption Q&A
Encryption
CRM Analytics
Encrypts new CRM Analytics datasets.
Note: Data that was in CRM Analytics before encryption was enabled isn’t encrypted. If existing data is imported from Salesforce
objects through the dataflow, the data becomes encrypted on the next dataflow run. Other existing data, such as CSV data,
must be reimported to become encrypted. Although existing data isn’t encrypted, it’s still accessible and fully functional in its
unencrypted state when encryption is enabled.
Data Cloud
Encrypt data at rest in Data Cloud with a customer-managed root key.
Salesforce B2B Commerce
Shield Platform Encryption for B2B Commerce versions 4.10 and later add an extra layer of security to the data your customers enter
in Salesforce B2B Commerce ecommerce storefronts. For a list of the supported fields, see Enable Shield Platform Encryption for B2B
Commerce for Visualforce Objects.
Search Indexes
When you encrypt search indexes, each file created to store search results is encrypted.
20
Strengthen Your Data’s Security with Shield Platform Platform Encryption Q&A
Encryption
21
Strengthen Your Data’s Security with Shield Platform How Shield Platform Encryption Works
Encryption
If I can see encrypted data, can Salesforce Support representatives also see the data?
Yes, if they have access to the object, record and field.
22
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption Terminology
Encryption
Important: Where possible, we changed noninclusive terms to align with our company Available in both Salesforce
value of Equality. We maintained certain terms to avoid any effect on customer Classic (not available in all
orgs) and Lightning
implementations.
Experience.
Cache Key Encrypting Key (Cache KEK)
Data encryption keys temporarily reside in the encrypted key cache for deriving final data Available as an add-on
encryption keys. The cache KEK encrypts these components while they’re in the cache. subscription in: Enterprise,
Performance, and
Data Encryption Unlimited Editions. Requires
The process of applying a cryptographic function to data that results in ciphertext. The Shield purchasing Salesforce Shield
Platform Encryption process uses symmetric key encryption, a 256-bit Advanced Encryption or Shield Platform
Standard (AES) algorithm that uses cipher block chaining (CBC) mode, and a randomized 128-bit Encryption. Available in
initialization vector (IV) to encrypt data stored on the Salesforce Platform. Data encryption and Developer Edition at no
decryption occur on the application servers. charge.
Data Encryption Key (DEK)
Shield Platform Encryption uses DEKs to encrypt and decrypt data. DEKs are derived on the key
management servers (KMS). They use key material split between a per-release primary secret and an org-specific tenant secret stored
encrypted in the database. The 256-bit derived keys use a key derivation function (KDF) and exist in memory until evicted from the
cache. DEKs are sometimes also provided using the External Key Management service by an external key service that you control.
Encrypted Data at Rest
Data that’s encrypted when persisted on disk. Salesforce supports encryption for fields stored in the database; documents stored in
files, content, libraries, and attachments; search index files; CRM Analytics datasets; and archived data.
Encryption Key Management
All aspects of key management, such as key generation, processes, and storage. Administrators or users who have the Manage
Encryption Keys permission can work with Shield Platform Encryption key material.
23
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption Terminology
Encryption
24
Strengthen Your Data’s Security with Shield Platform Components Involved in Deriving Keys
Encryption
Tenant Secret
An organization-specific secret used in conjunction with the primary secret and key derivation function (KDF) to generate a derived
data encryption key (DEK). No Salesforce employees have access to these keys in cleartext.
SEE ALSO:
How Key Material Is Stored
Important: Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain
terms to avoid any effect on customer implementations.
Application Servers
Servers in production environments that run Salesforce. When a customer attempts to read or write encrypted data or generate a
tenant secret, the application server communicates with a regional KMS to process the request.
External Key Management Service
Service that you use when fully managing your own data encryption keys by using the External Key Management Service or the
Cache-Only Key Service.
Primary HSM (nShield® Connect HSM model XC)
A FIPS 140-2 Level 3 hardware-compliant network appliance that generates per-release secrets and secret-wrapping keys and signs
the public keys of regional HSMs. The primary HSM is located in the primary KMS. Access to the HSM is controlled through a High
Assurance Virtual Ceremony (HAVC).
The primary HSM public signing key is used to sign and verify each regional HSM’s public encryption key. At the start of each release,
the primary and regional HSM public encryption keys are used to separately encrypt a per-release primary key wrapping key, which
is used to encrypt the remainder of the per-release secrets used to derive data encryption keys.
Salesforce Search Index
Servers in production environments that manage Salesforce searches. When a user attempts to query encrypted data, the search
index processes the request.
Shield KMS Server
Shield Platform Encryption uses a single primary KMS and multiple regional KMSs. The primary KMS is the first KMS to receive the
per-release secrets. It makes those secrets available to regional KMSs, and it services key material requests like any regional KMS
server.
25
Strengthen Your Data’s Security with Shield Platform Differences Between Classic Encryption and Shield Platform
Encryption Encryption
Generate Keys
PCI-DSS L1 Compliance
26
Strengthen Your Data’s Security with Shield Platform Differences Between Classic Encryption and Shield Platform
Encryption Encryption
Sorting
Except on fields also
encrypted with
field-level encryption
API Access
27
Strengthen Your Data’s Security with Shield Platform How Key Material Is Stored
Encryption
Method Description
Application Servers Servers in production environments that run Salesforce. When a customer attempts to read
or write encrypted data or generate a tenant secret, the application server communicates
with a regional KMS to process the request.
External Key Management Service Service that you use when fully managing your own data encryption keys by using the
External Key Management Service or the Cache-Only Key Service.
Primary HSM (nShield® Connect HSM A FIPS 140-2 Level 3 hardware-compliant network appliance that generates per-release
model XC) secrets and secret-wrapping keys and signs the public keys of regional HSMs. The primary
HSM is located in the primary KMS. Access to the HSM is controlled through a High Assurance
Virtual Ceremony (HAVC).
The primary HSM public signing key is used to sign and verify each regional HSM’s public
encryption key. At the start of each release, the primary and regional HSM public encryption
keys are used to separately encrypt a per-release primary key wrapping key, which is used
to encrypt the remainder of the per-release secrets used to derive data encryption keys.
Salesforce Search Index Servers in production environments that manage Salesforce searches. When a user attempts
to query encrypted data, the search index processes the request.
Shield KMS Server Shield Platform Encryption uses a single primary KMS and multiple regional KMSs. The
primary KMS is the first KMS to receive the per-release secrets. It makes those secrets available
to regional KMSs, and it services key material requests like any regional KMS server.
28
Strengthen Your Data’s Security with Shield Platform Behind the Scenes: The Shield Platform Encryption Process
Encryption
29
Strengthen Your Data’s Security with Shield Platform Behind the Scenes: The Search Index Encryption Process
Encryption
• After retrieving or deriving the key, the encryption service generates a random initialization vector (IV) and encrypts the data by
using 256-bit AES encryption.
• The ciphertext is saved in the database or file storage. The IV and corresponding ID of the tenant secret used to derive the data
encryption key are saved in the database. Salesforce generates a new primary secret at the start of each release.
Note: If Salesforce admins disable encryption on a field, all index segments that were encrypted are unencrypted and the key ID
is set to null. This process can take up to seven days.
4. After retrieving the key, the encryption service generates a random initialization vector (IV) and encrypts the data using NSS or JCE’s
AES-256 implementation.
5. The key ID (identifier of the key being used to encrypt the index segment) and IV are saved in the search index.
30
Strengthen Your Data’s Security with Shield Platform How Shield Platform Encryption Works in a Sandbox
Encryption
SEE ALSO:
EKM in a Sandbox Org
31
Strengthen Your Data’s Security with Shield Platform Why Isn’t My Encrypted Data Masked?
Encryption
during a High Assurance Virtual Ceremony (HAVC) by using a hardware security module (HSM). The tenant secret is unique to your org,
and you control when it’s generated, activated, revoked, or destroyed.
You have four options for setting up your key material.
• Use Shield Platform Encryption to generate your org-specific tenant secrets.
• Use the infrastructure of your choice, such as an on-premises HSM, to generate and manage your tenant secret outside of Salesforce.
Then upload that tenant secret to the regional Salesforce KMS. This option is known as Bring Your Own Key, although the element
you’re really bringing is the tenant secret from which the key is derived.
• Opt out of the Shield Platform Encryption key derivation process with the Bring Your Own Key service. Use the infrastructure of your
choice to create a data encryption key instead of a tenant secret. Then upload this data encryption key to the regional Shield KMS.
When you opt out of derivation on a key-by-key basis, the Shield Platform Encryption bypasses the derivation process and uses this
key material as your final data encryption key. You can rotate customer-supplied data encryption keys just like you can rotate a
customer-supplied tenant secret.
• Generate and store your key material outside of Salesforce by using a key service of your choice. Then use either the External Key
Management Service or the Salesforce Cache-Only Key Service to fetch your key material on demand. Your key service transmits
your key material over a secure channel that you configure. It’s then encrypted and stored in the cache for immediate encryption
and decryption operations.
SEE ALSO:
Work with External Key Material
32
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption in Hyperforce
Encryption
Masking might not be enough for your credit card numbers. You may or may not want to encrypt them in the database as well. (You
probably should.) If you do, authenticated users will still see the same masked values.
In this way, masking and encryption are different solutions for different problems. You mask data to hide it from users who are authenticated
but not authorized to see that data. You encrypt data to prevent someone from stealing the data. (Or, more precisely, to make the data
useless if someone does steal it.)
Notification values such as ????? and 01/01/1777 are strings reserved for masking notifications and can’t be used as data values in
encrypted fields. While you aren’t restricted from saving a record with one of these reserved masking notification strings into an encrypted
field, the field is saved with a blank value. For example, if a Date field is encrypted and you enter 07/07/1777, when you save the record,
the contents of that field are empty.
33
Strengthen Your Data’s Security with Shield Platform How Do I Deploy Shield Platform Encryption?
Encryption
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
34
Strengthen Your Data’s Security with Shield Platform Set Up Your Encryption Policy
Encryption
35
Strengthen Your Data’s Security with Shield Platform Which User Permissions Does Shield Platform Encryption
Encryption Require?
The Customize Application and Manage Certificates permissions are automatically enabled for users with the System Administrator
profile.
This restriction applies to actions taken through the API or from Setup pages, such as the Encryption Policy page or the Object Manager.
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
36
Strengthen Your Data’s Security with Shield Platform Generate and Manage Tenant Secrets
Encryption
37
Strengthen Your Data’s Security with Shield Platform Generate and Manage Tenant Secrets
Encryption
You can have up to 50 active and archived tenant secrets of each type. For example, you can have 1 active and 49 archived Fields and
Files (Probabilistic) tenant secrets and the same number of Analytics tenant secrets. This limit includes Salesforce-generated and key
material that you supply.
If you run into this limit, destroy an existing key before reactivating, rearchiving, or creating a callout to another one. Before destroying
a key, synchronize the data that it encrypts with an active key.
38
Strengthen Your Data’s Security with Shield Platform Set Up Field-Level Encryption
Encryption
Note: This information is about Shield Platform Encryption and not Classic Encryption.
39
Strengthen Your Data’s Security with Shield Platform Set Up Field-Level Encryption
Encryption
IN THIS SECTION:
Apply Encryption to Standard Fields in Salesforce Classic
Applying encryption to multiple standard fields at the same time on one or more standard objects is the same process in Salesforce
Classic and Lightning Experience. Applying encryption to a standard field on a custom object, a custom field on a standard object,
or a custom field on a custom object, in Salesforce Classic is slightly different from the process in Lightning Experience.
Apply Encryption to Standard Fields in Lightning Experience
You can apply encryption to one or more standard fields at the same time on one or more standard objects by using the Encrypt
Standard Fields page. To apply encryption to a standard field on a custom object, a custom field on a standard object, or a custom
field on a custom object, do one field at a time.
Encrypt Custom Fields in Installed Managed Packages
If an installed managed package supports Shield Platform Encryption, you can encrypt custom fields in that package. Turn on
encryption for custom fields in installed managed packages from the Encryption Settings page, and then apply encryption to custom
fields in your installed managed package.
SEE ALSO:
Sync Data with Self-Service Background Encryption
4. Click Edit.
40
Strengthen Your Data’s Security with Shield Platform Set Up Field-Level Encryption
Encryption
Note: This page describes how to apply encryption to a field in Salesforce Classic. To configure a field in Lightning Experience,
see Apply Encryption to Standard Fields in Lightning Experience on page 42.
1. From the management settings for the object, go to Fields.
2. In the Custom Fields & Relationships section, create a field or edit an existing one.
If encryption is available for the field, the Encrypt contents of this field checkbox appears.
41
Strengthen Your Data’s Security with Shield Platform Set Up Field-Level Encryption
Encryption
Note: This page describes how to apply encryption to a field in Lightning Experience. To configure encryption for a field in
Salesforce Classic, see Apply Encryption to Standard Fields in Salesforce Classic on page 40.
1. From Setup, select Object Manager, and then select your object.
2. Click Fields & Relationships.
42
Strengthen Your Data’s Security with Shield Platform Set Up Field-Level Encryption
Encryption
3. When you create or edit a custom field, select Encrypt the contents of this field.
By default, data is encrypted using a probabilistic encryption scheme. To apply deterministic encryption to your data, select a
deterministic option listed under Advanced Encryption Settings.
All new data entered in this field is encrypted.
4. Save your work.
The automatic Platform Encryption validation service checks for settings in your org that can block encryption. You receive an email with
suggestions for fixing incompatible settings. Depending on the size of your org, enabling a standard field for encryption can take a few
minutes.
Field values are automatically encrypted only in records created or updated after you’ve enabled encryption. Synchronize existing data
with your active key material on the Encryption Statistics and Data Sync page.
See Also
• Filter Encrypted Data with Deterministic Encryption
• Sync Data with Self-Service Background Encryption
2. In the Advanced Encryption Settings section, turn on Encrypt Custom Fields in Managed Available as an add-on
Packages. subscription in: Enterprise,
You can also enable encryption for managed packages programmatically. For more information, Performance, and
Unlimited Editions. Requires
see PlatformEncryptionSettings in Metadata API Developer Guide.
purchasing Salesforce Shield
From now on, if an installed managed package supports encryption, you can encrypt custom or Shield Platform
fields in that package. Don’t know if your application supports encrypted fields? Look for the Encryption. Available in
Designed to Work With Salesforce Shield marker in your application’s AppExchange listing. Developer Edition at no
charge.
USER PERMISSIONS
To view setup:
• View Setup and
Configuration
To encrypt files:
• Customize Application
43
Strengthen Your Data’s Security with Shield Platform Encrypt New Files and Attachments
Encryption
Note: Before you begin, make sure that your org has an active encryption key. If you’re not Available in both Salesforce
sure, check with your Salesforce admin. Classic (not available in all
orgs) and Lightning
1. From Setup, in the Quick Find box, enter Encryption Settings, and then select Experience.
Encryption Settings.
Available as an add-on
2. In the Encryption Policy section, turn on Encrypt Files and Attachments. subscription in: Enterprise,
Important: Users with access to the file can work normally with it regardless of their Performance, and
encryption-specific permissions. Users who are logged in to your org and have read access Unlimited Editions. Requires
purchasing Salesforce Shield
can search and view the body content.
or Shield Platform
Users can continue to upload files and attachments per the usual file size limits. Expansion of file Encryption. Available in
sizes caused by encryption doesn’t count against these limits. Developer Edition at no
Turning on file and attachment encryption affects new files and attachments. It doesn’t automatically charge.
encrypt files and attachments that are already in Salesforce. Apply your active key material to existing
data with on the Encryption Statistics and Data Sync page. USER PERMISSIONS
To check whether a file or attachment is encrypted, look for the encryption indicator on the detail
To view setup:
page of the file or attachment. You can also query the isEncrypted field on the ContentVersion
• View Setup and
object (for files) or on the Attachment object (for attachments).
Configuration
To encrypt files:
• Customize Application
44
Strengthen Your Data’s Security with Shield Platform Encrypt Data in Chatter
Encryption
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
45
Strengthen Your Data’s Security with Shield Platform Encrypt Data Cloud with Customer-Managed Root Keys
Encryption
Note: Root keys don’t control the data encryption keys used to encrypt unstructured data flows in Data Cloud.
Root keys are compatible with Data Cloud’s Sub-Second Real-Time feature. When you enable Sub-Second Real-Time in an org
with an active Salesforce root key for Data Cloud, the feature can take up to 24 hours to start using that root key.
For Sub-Second Real-Time customers who require customer-managed keys (CMK) encryption in Data Cloud, Salesforce uses tenant
level isolation for storing encrypted keys for unified profiles. This isolation ensures that each tenant's data is encrypted with its
own keys.
46
Strengthen Your Data’s Security with Shield Platform Encrypt Search Index Files with a Tenant Secret
Encryption
47
Strengthen Your Data’s Security with Shield Platform Encrypt Search Index Files with a Root Key
Encryption
Search index DEKs are never stored unwrapped. When needed, they’re unwrapped by the root key and cached for immediate use by
the search index service.
1. From Setup, in the Quick Find box, enter Encryption Settings, and then select Encryption Settings.
2. In the Encryption Policy section, turn on Encrypt Search Indexes.
Salesforce begins creating your root key and DEK. You’re notified when the new DEK is ready.
3. From Setup, in the Quick Find box, enter Platform Encryption, and then select Key Management.
4. In the Key Management Table, select Search Index.
Review the page. When the new DEK is Active, your search indexes are being encrypted.
Note: Using Setup is the only way to manage Search Index DEKs. You can’t manage them Available in both Lightning
using Apex. Experience and Salesforce
Classic (not available in all
1. From Setup, in the Quick Find box, enter Platform Encryption, and then select Key orgs).
Management.
Available as an add-on
2. Select the Search Index tab. Then click Generate DEK. subscription to Hyperforce
The new DEK is generated. This DEK is used to encrypt all new data in the search index, which orgs in: Enterprise,
builds dynamically as it captures new search data. Performance, and
Periodically, more than one iteration of your DEK is needed to encrypt search indexes as they’re Unlimited Editions. Requires
built. Automatically generated DEK iterations are identifiable by the Automated Process value purchasing Salesforce
listed in the Created By column. These iterations of your DEK share a version number. Shield. Available in
Developer Edition at no
When you generate another DEK, all DEKs of the previous version are archived. charge.
USER PERMISSIONS
48
Strengthen Your Data’s Security with Shield Platform Encrypt CRM Analytics Data
Encryption
49
Strengthen Your Data’s Security with Shield Platform Encrypt Event Bus Data
Encryption
5. In the Encryption Policy section, turn on Encrypt Change Data Capture Events and Platform
Events. USER PERMISSIONS
Warning: If you don’t enable Shield Platform Encryption for change data capture events To view setup:
and platform events, events are stored in clear text in the event bus. • View Setup and
Configuration
To manage key material:
• Manage Encryption Keys
SOQL/SOSL queries
You’ve selected a field that’s used in an aggregate function in a SOQL query, or in a WHERE, GROUP BY, or ORDER BY clause.
Formula fields
You’ve selected a field that’s referenced by a custom formula field in an unsupported way. Formulas can use BLANKVALUE, CASE,
HYPERLINK, IF, IMAGE, ISBLANK, ISNULL, NULLVALUE, and concatenation (&). Custom formula fields can reference encrypted data
in Salesforce Classic but not Lightning Experience or via SOQL.
50
Strengthen Your Data’s Security with Shield Platform Disable Encryption on Fields
Encryption
Note: By default, your results only list the first 250 errors per element. You can increase the number of errors listed in your
results to 5000. Contact Salesforce for help.
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
51
Strengthen Your Data’s Security with Shield Platform Filter Encrypted Data with Deterministic Encryption
Encryption
IN THIS SECTION:
How Deterministic Encryption Supports Filtering
By default, Shield Platform Encryption uses a probabilistic encryption scheme to encrypt data. Each bit of data is turned into a fully
random ciphertext string every time it’s encrypted. Encryption doesn’t generally impact users who are authorized to view the data.
The exceptions are when logic is executed in the database or when encrypted values are compared to a string or to each other. In
these cases, because the data has been turned into random, patternless strings, filtering isn’t possible. For example, you might run
a SOQL query in custom Apex code against the Contact object, where LastName = 'Smith'. If the LastName field is encrypted with
probabilistic encryption, you can’t run the query. Deterministic encryption addresses this problem.
Encrypt Data with the Deterministic Encryption Scheme
Generate key material specific to data encrypted with deterministic encryption schemes. You can apply either case-sensitive
deterministic encryption or case-insensitive deterministic encryption schemes to your data, depending on the kind of filtering that
you want to perform. When you apply a deterministic encryption scheme to a field or change between deterministic encryption
schemes, synchronize your data. Syncing data makes sure that your filters and queries produce accurate results.
52
Strengthen Your Data’s Security with Shield Platform Encrypt Data with the Deterministic Encryption Scheme
Encryption
Even if an attacker successfully matched cleartext to encrypted values for one field, the attacker would have to do it all over again for
another field, and again for the same field in another object.
In this way, deterministic encryption decreases encryption strength only as minimally necessary to allow filtering.
Deterministic encryption comes in two types: case-sensitive and case-insensitive. With case-sensitive encryption, a SOQL query against
the Contact object, where LastName = Jones, returns only Jones, not jones or JONES. Similarly, when the case-sensitive deterministic
scheme tests for unicity (uniqueness), each version of “Jones” is unique.
For case-insensitive, a SOQL query against the Lead object, where Company = Acme, returns Acme, acme, or ACME. When the
case-insensitive scheme tests for unicity (uniqueness), each version of Acme is considered identical.
Important: Probabilistic encryption is not supported on the email address field for the Contact object. To avoid creating duplicate
accounts during self-registration, use deterministic encryption.
2. From Setup, in the Quick Find box, enter Encryption Settings, and then select Encryption Settings.
3. In the Advanced Encryption Settings section, turn on Generate Initial Deterministic Tenant Secret.
You can also enable deterministic encryption programmatically. For more information, see PlatformEncryptionSettings in the Metadata
API Developer Guide.
4. Enable encryption for each field, and choose a deterministic encryption scheme. How you do that depends on whether it’s a standard
field or a custom field.
• For standard fields, from Setup, select Encryption Settings. In the Advanced Encryption Settings section, click Select Fields.
The Encrypt Standard Fields page opens. For each field that you want to encrypt, select the field name, and then choose either
Deterministic—Case Sensitive or Deterministic—Case Insensitive from the Encryption Scheme list.
53
Strengthen Your Data’s Security with Shield Platform Encrypt Data with the Deterministic Encryption Scheme
Encryption
• For custom fields, open the Object Manager and edit the field that you want to encrypt. Select Encrypt the contents of this
field, and select an encryption scheme.
You can mix and match probabilistic and deterministic encryption, encrypting some fields one way and some fields the other.
You receive an email notifying you when the enablement process finishes.
Note: Expect the enablement process to take longer when you apply deterministic encryption to a field with a large number
of records. To support filtering, the enablement process also rebuilds field indexes.
54
Strengthen Your Data’s Security with Shield Platform Key Management and Rotation
Encryption
5. When you apply or remove deterministic encryption to a field, it’s possible that existing data in that field doesn’t appear in queries
or filters. To apply full deterministic functionality to existing data, synchronize all your data with your active key material from the
Encryption Statistics and Data Sync page. For more information, see Synchronize Your Data Encryption with the Background Encryption
Service.
USER PERMISSIONS
IN THIS SECTION:
Work with Salesforce Key Material To manage key material:
By using Shield Platform Encryption, you can generate a unique tenant secret for your org, or • Manage Encryption Keys
generate a tenant secret or key material using your own external resources. In either case, you
manage your own key material: You can rotate it, archive it, and designate other users to share
responsibility for it.
Get Statistics About Your Encryption Coverage
The Encryption Statistics page provides an overview of all data encrypted with Shield Platform Encryption. This information helps
you to stay on top of your key rotation and management tasks. You can also use encryption statistics to identify which objects and
fields you may want to update after you rotate your key material.
Synchronize Your Data Encryption with the Background Encryption Service
Periodically, you change your encryption policy. Or you rotate your keys. To get the most protection out of your encryption strategy
with Shield Platform Encryption, synchronize new and existing encrypted data under your most recent encryption policy and keys.
You can do this yourself or ask Salesforce for help.
Work with External Key Material
So you can maintain tighter control over your key material, Salesforce offers you three options: BYOK (Bring Your Own Key), EKM
(External Key Management), and the Cache-Only key service.
SEE ALSO:
Monitor Setup Changes with Setup Audit Trail
55
Strengthen Your Data’s Security with Shield Platform Work with Salesforce Key Material
Encryption
SEE ALSO:
Work with External Key Material
56
Strengthen Your Data’s Security with Shield Platform Work with Salesforce Key Material
Encryption
57
Strengthen Your Data’s Security with Shield Platform Work with Salesforce Key Material
Encryption
Active
The key can be used to encrypt and decrypt new and existing data.
Activation Pending
The key is generated in Salesforce but waiting for another process to complete activation.
Archived
The key can’t encrypt new data. It can be used to decrypt data previously encrypted with this key when it was active.
Canceled
The root key activation process is canceled.
Destroyed
The key can’t encrypt or decrypt data. Data encrypted with this key when it was active can no longer be decrypted. Files and
attachments encrypted with this key can no longer be downloaded.
Inactive
The root key is present but inactive, which prevents DEKs that it controls from encrypting and decrypting data.
58
Strengthen Your Data’s Security with Shield Platform Work with Salesforce Key Material
Encryption
Note: You can have up to 50 active and archived tenant secrets of each type. For example, you can have 1 active and 49
archived Fields and Files (Probabilistic) tenant secrets, and the same number of Analytics tenant secrets. This limit includes
Salesforce-generated and key material that you supply.
If you run into this limit, destroy an existing key before reactivating, rearchiving, or creating a callout to another one. Before
destroying a key, synchronize the data it encrypts with an active key.
5. If you want to re-encrypt field values with your active key material, synchronize new and existing encrypted data under your most
recent and keys. You can sync data from the Encryption Statistics and Data Sync page in Setup.
Remember that exported key material is a copy of the key material in your org. To import an exported USER PERMISSIONS
tenant secret, first destroy the original in your org. See Destroy a Tenant Secret on page 60.
To generate, destroy, export,
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the import, upload, and
difference? configure tenant secrets and
customer-supplied key
material:
• Manage Encryption Keys
59
Strengthen Your Data’s Security with Shield Platform Work with Salesforce Key Material
Encryption
60
Strengthen Your Data’s Security with Shield Platform Get Statistics About Your Encryption Coverage
Encryption
Available as an add-on subscription in: Enterprise, Performance, and Unlimited Editions. Requires purchasing Salesforce Shield.
Available in Developer Edition at no charge for orgs created in Summer ’15 and later.
IN THIS SECTION:
Gather Encryption Statistics
The Encryption Statistics and Data Sync page shows you how much of your data is encrypted by Shield Platform Encryption, and
how much of that data is encrypted by active key material. Use this information to inform your key rotation actions and timelines.
You can also use the Encryption Statistics page to collect information about the fields and objects you want to synchronize with the
background encryption service.
Interpret and Use Encryption Statistics
The Encryption Statistics page offers a snapshot of your encrypted data. You can use the information to help you make informed
decisions about managing your encrypted data.
USER PERMISSIONS
61
Strengthen Your Data’s Security with Shield Platform Get Statistics About Your Encryption Coverage
Encryption
Note:
• You can gather statistics once every 24 hours, either by clicking Gather Statistics or running the self-service background
encryption service.
• Feed Item doesn’t display statistics because it’s derived from Feed Post. Gathering statistics for Feed Post is sufficient to confirm
the encryption status of both Feed Post and Feed Item.
Available as an add-on subscription in: Enterprise, Performance, and Unlimited Editions. Requires purchasing Salesforce Shield.
Available in Developer Edition at no charge.
The page offers three views of your encrypted data: summary cards for encrypted data categories, a field-level encryption summary
panel, and an encrypted field detail view.
Summary Cards
Shield Platform Encryption encrypts some compatible databases in bulk, such as search indexes and Data Cloud. Summary cards show
encryption statistics for these databases, including whether encryption is enabled for that category of data and if that data is encrypted.
When an encryption key is present, the summary cards also show the status of that key and when it was last rotated.
62
Strengthen Your Data’s Security with Shield Platform Get Statistics About Your Encryption Coverage
Encryption
• Object—Lists your standard and custom objects. Data about standard objects are aggregated for all standard objects of a given
type. Data about custom objects are listed for each custom object.
• Data Encrypted—The total percentage of data in an object that’s encrypted. In the example above, 50% of all data in Account objects
is encrypted.
• Uses Active Key—The percentage of your encrypted data in that object or object type that’s encrypted with your active key material.
• Sync Needed—Recommends whether to synchronize your data with the background encryption service. This column displays Yes
when you add or disable encryption on fields, change a field’s encryption scheme, or rotate key material.
When the numbers in the Data Encrypted and Uses Active Key columns are the same, and the Sync Needed column is No, all your
encrypted data is synchronized. In the example above, the Case object is synchronized.
Sometimes the Sync Needed column is Yes for an object when the Encrypted Data and Uses Active Key columns have the same values.
This combination of values happens when encryption policy settings or keys change since the last time that you gathered statistics or
synchronized your data. This combination also happens when statistics are gathered for newly encrypted data but the object hasn’t
been synchronized. In the example above, the Account, Contact, Lead, and Opportunity objects meet one or more of these conditions.
A double dash (--) means that statistics haven’t been gathered for that object or object type yet. In the example, statistics haven’t been
gathered for the Opportunity and Attachment objects.
63
Strengthen Your Data’s Security with Shield Platform Get Statistics About Your Encryption Coverage
Encryption
Fields
The Fields tab displays data about field data in each object.
• Field—All encryptable standard and custom fields in the object that contain data
Note: Not all field data is stored in the same field that displays data in the UI. For example, some Person Account field
data is stored in the corresponding Contact fields. If you have Person Accounts enabled but don’t see encrypted fields
under the Account detail view, gather statistics for the Contact object and check there.
Similarly, Chatter data is stored in the Feed Attachment, Feed Comment, Feed Poll Choice, Feed Post, and Feed Revision
objects. The Encryption Statistics page lists these objects and all fields that hold encrypted Chatter data in the database.
Some fields listed on the Encryption Statistics page aren’t visible in the UI by the same name, but they store all encrypted
data that’s visible in the UI. See Which Standard Fields Can I Encrypt? in Salesforce Help for a list of the encrypted Chatter
fields.
History
The History tab shows data about field history and feed tracking changes.
• Field—All encryptable standard and custom fields in the object that contain data.
• API Name—The API name for fields that contain data.
• Encrypted Field History—The number of encrypted field history values for a field type across all objects of a given type. For
example, you select the Account object and see “2” in the Encrypted Field History column for Account Name, which means that
Account Name has two encrypted field history values.
• Unencrypted Field History—The number of plaintext field history values stored for a field.
• Encrypted Feed Tracking—The number of encrypted feed tracking values stored for a field.
• Unencrypted Feed Tracking—The number of plaintext feed tracking values stored for a field.
64
Strengthen Your Data’s Security with Shield Platform Synchronize Your Data Encryption with the Background
Encryption Encryption Service
• Rotate keys—To encrypt all your data with your active key material, review the encryption summary pane on the left side of the
page. If the Uses Active Key value is lower than the Data Encrypted value, some of your data uses archived key material. To synchronize
your data, click the Sync button or contact Salesforce Customer Support.
• Synchronize data—Key rotation is an important part of any encryption strategy. When you rotate your key material, apply the active
key material to existing data. To synchronize your data with your active key, click the Sync button.
If self-service background encryption is unavailable, review the Uses Active Key and Mixed Tenant Secret Status columns to identify
any fields that include data encrypted with an archived key. Make a note of these objects and fields, then contact Salesforce Customer
Support to request the background encryption service. Salesforce Customer Support can focus just on those objects and fields that
you want to synchronize, keeping the background encryption process as short as possible.
Note: Note: Synchronizing your data encryption doesn't modify the record LastModifiedDate or LastModifiedById timestamps.
It doesn't execute triggers, validation rules, workflow rules, or any other automated service. However, it does modify the
SystemModStamp.
65
Strengthen Your Data’s Security with Shield Platform Synchronize Your Data Encryption with the Background
Encryption Encryption Service
Tip: Also check that your field values aren’t too long for encryption.
Tip: If you’re not sure which data is already encrypted, visit the Encryption Statistics page, which keeps a record of all fields that
you have encrypted.
Note: Keep these points in mind when disabling encryption on data encrypted with destroyed material.
• When you disable encryption for files that were encrypted with a key that’s been destroyed, the files don’t automatically go
away. You can ask Salesforce support to delete the files.
• The automatic decryption process takes longer when you disable encryption on fields encrypted with a key that’s been
destroyed. Salesforce notifies you by email when the process finishes.
66
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
IN THIS SECTION:
Sync Data with Self-Service Background Encryption
Synchronizing your data with your active key material keeps your encryption policy up to date. You can sync data in standard and
custom fields, the Attachment—Content Body field, and for field history and feed tracking changes from the Encryption Statistics
and Data Sync page in Setup. To synchronize all other encrypted data, contact Salesforce Customer Support.
Note: The sync process time varies depending on how much data you have in your object. You get an email notification when
the sync process finishes. You can sync your data from the Encryption Statistics and Data Sync page once every 7 days.
If you have lots of data in Attachment—Content Body fields, the sync process breaks your request into batches and syncs them
in sequence. However, sometimes we can’t encrypt all these batches at once. This service protection helps Salesforce maintain
functional network loads. If the sync process finishes but the encryption statistics status is less than 100% complete, click Sync
again. The background encryption service picks up where it left off.
67
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
IN THIS SECTION:
Bring Your Own Key (BYOK)
When you supply your own tenant secret or data encryption key (DEK), you get the benefits built into to Salesforce Shield Platform
Encryption, plus the extra assurance that comes from exclusively managing your own key material.
External Key Management
Shield External Key Management (EKM) connects your Salesforce implementation to your keys in AWS KMS and uses those keys for
encryption operations on Salesforce data. EKM fetches your keys on demand from AWS KMS over a secure channel. EKM stores your
key in the key cache and uses your key for immediate encrypt and decrypt operations. Salesforce doesn’t retain or persist your cached
EKM keys in any system of record or backups. You can revoke key material at any time.
Cache-Only Key Service
Shield Platform Encryption’s Cache-Only Key Service addresses a unique need for non-persisted key material. You can store your key
material outside of Salesforce in any key repository or service that you control and have the Cache-Only Key Service fetch your key
on demand from that key service. Your key service transmits your key over a secure channel that you configure, and the Cache-Only
Key Service uses your key for immediate encrypt and decrypt operations. Salesforce doesn’t retain or persist your cache-only keys
in any system of record or backups. You can revoke key material at any time.
Configure Your Cache-Only Key Callout Connection
Use a named credential to specify the endpoint for your callout, and identify the key that you want to fetch from your endpoint.
SEE ALSO:
Work with Salesforce Key Material
Cache-Only Key Service
68
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
69
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
70
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
5. When the Certificate and Key Detail page appears, click Download Certificate.
71
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Note: You can use a tenant secret as a BYOK key only one time. If you need multiple BYOK Available in both Salesforce
keys, you need to use a unique tenant secret for each one. Classic (not available in all
orgs) and Lightning
1. Generate a 256-bit tenant secret using the method of your choice. Experience.
You can generate your tenant secret in one of 2 ways:
Available as an add-on
• Use your own on-premises resources to generate a tenant secret programmatically, using subscription in: Enterprise,
an open-source library such as Bouncy Castle or OpenSSL. Performance, and
Unlimited Editions. Requires
Tip: We've provided a script on page 72 that may be useful as a guide to the process. purchasing Salesforce Shield
or Shield Platform
• Use a key brokering partner that can generate, secure, and share access to your tenant Encryption. Available in
secret. Developer Edition at no
charge.
2. Wrap your tenant secret with the public key from the BYOK-compatible certificate you generated,
using the SHA512 padding algorithm.
Specify the OAEP padding scheme. Make sure the resulting encrypted tenant secret and hashed USER PERMISSIONS
tenant secret files are encoded using base64.
Edit, upload, and download
Note: For legacy BYOK (those not used for tenant secrets, such as BYOK for Search Index HSM-protected certificates
encryption and Database Encryption), you can still use the SHA1 padding algorithm. with the Shield Platform
Encryption Bring Your Own
3. Encode this encrypted tenant secret to base64. Key service:
• Manage Certificates
4. Calculate an SHA-256 hash of the plaintext tenant secret.
AND
5. Encode the SHA-256 hash of the plaintext tenant secret to base64.
Customize Application
AND
Manage Encryption Keys
72
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
The files ending in .b64 are your base 64-encoded encrypted tenant secret and base 64-encoded hash of the plaintext tenant secret.
You’ll need both of these files for the next step.
Note: You can have up to 50 active and archived tenant secrets of each type. For example, you can have one active and 49
archived Fields and Files (Probabilistic) tenant secrets, and the same number of Analytics tenant secrets. This limit includes
Salesforce-generated and customer-supplied key material.
If you reach the limit, destroy an existing key before reactivating, rearchiving, or creating a callout to another one. Before
destroying a key, synchronize the data that it encrypts with an active key.
73
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
5. Export your tenant secret, and back it up as prescribed in your organization’s security policy.
To restore a destroyed tenant secret, reimport it. The exported tenant secret is different from the tenant secret you uploaded. It’s
encrypted with a different key and has additional metadata embedded in it. See Back Up Your Tenant Secret in Salesforce Help.
2. In the Root Key Inventory table, check that a root key exists. If a root key exists, go on to step 3.
a. Click Generate Root Key.
The Configure a Key Management Service dialog appears
74
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
.
b. Click Shield Key Management Service and then click Done.
Salesforce begins the process for generating the root key. This can take a while. You’re notified by email when the root key is
ready. When you have confirmation, go on to the next step.
75
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
6. In the Upload Data Encryption Key section, attach both the encrypted key material and the hashed plaintext key material. Click
Upload.
This DEK automatically becomes the active data encryption key for Search Indexes.
From here on, the Shield KMS uses your DEK to encrypt and decrypt your users’ search data.
76
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
8. In the Upload Tenant Secret section, attach your encrypted data encryption key and your hashed plaintext data encryption key.
9. Click Upload.
This data encryption key automatically becomes the active key. From now on, the Shield Key Management Service (KMS) skips the
derivation process and uses your data encryption key to directly encrypt and decrypt your data. You can review the derivation status
of all key material on the Key Management page.
77
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
10. Export your data encryption key and back it up as prescribed in your organization’s security policy.
To restore your data encryption key, reimport it. The exported data encryption key is different from the data encryption key that you
uploaded. It’s encrypted with a different key and has additional embedded metadata. See Back Up Your Tenant Secret in Salesforce
Help.
78
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
• You don’t have write permission in the folder you’re trying to run the script from. Try running Available as an add-on
the script from a folder that you have write permission for. subscription in: Enterprise,
• The certificate that the script references is missing. Make sure you’ve properly generated Performance, and
Unlimited Editions. Requires
the certificate.
purchasing Salesforce Shield
• The certificate is missing or isn’t being referenced by the correct name. Make sure you’ve or Shield Platform
entered the correct file name for your certificate in the script. Encryption. Available in
I want to use the script you provide, but I also want to use my own random number Developer Edition at no
generator. charge.
The script we provide uses a random number generator to create a random value that is then
used as your tenant secret. If you want to use a different generator, replace head -c 32
/dev/urandom | tr '\n' = (or, in the Mac version, head -c 32 /dev/urandom > $PLAINTEXT_SECRET)
with a command that generates a random number using your preferred generator.
What if I want to use my own hashing process to hash my tenant secret?
No problem. Make sure that the result meets these requirements:
• Uses an SHA-256 algorithm.
• Results in a base64 encoded hashed tenant secret.
• Generates the hash of the random number BEFORE encrypting it.
If any of these three criteria aren’t met, you can’t upload your tenant secret.
79
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Your certificate isn’t active, or isn’t Ensure that your certificate settings are compatible with the Bring Your Own Key feature. Under
a valid Bring Your Own Key the Certificate and Key Edit section of the Certificates page, select a 4096-bit certificate size,
certificate. disable Exportable Private Key, and enable Platform Encryption. Read more about expired
certificates in the “My certificate is about to expire” section.
You haven’t attached both the Make sure that you attach both the encrypted tenant secret and the hashed tenant secret. Both
encrypted tenant secret and the of these files should have a .b64 suffix.
hashed tenant secret.
Your tenant secret or hashed Several problems can cause this error. Usually, the tenant secret or hashed tenant secret wasn't
tenant secret wasn’t generated generated using the correct SSL parameters. If you’re using OpenSSL, you can refer to the script
properly. for an example of the correct parameters you should use to generate and hash your tenant
secret. If you’re using a library other than OpenSSL, check that library's support page for help
with finding the correct parameters to both generate and hash your tenant secret.
Still stuck? Contact your Salesforce account executive. They'll put you in touch with someone
at Salesforce who can help.
I’m still having problems with my key. Who should I talk to?
If you still have questions, contact your account executive. They’ll put you in touch with a support team specific to this feature.
80
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
IN THIS SECTION:
USER PERMISSIONS
How Salesforce Shield EKM Works
For EKM, Shield Platform Encryption relies on the customer’s external KMS to generate and To generate, destroy, export,
secure the data encryption keys (DEKs) used by the Shield Platform encryption service. These import, upload, and
configure tenant secrets and
DEKs reside with the Shield Platform encrypted key cache in a wrapped state. When encryption
customer-supplied key
or decryption operations are needed, the Shield Platform service passes the wrapped DEK to material:
the customer’s external key service to be unwrapped. The customer key service unwraps the • Manage Encryption Keys
DEK and sends it securely back to the Shield Platform encryption service.
EKM Prerequisites
To use EKM, you must create a data encryption key (DEK) of sufficient strength in a supported external key management service.
You should also check that an external application can communicate with the key service to securely retrieve the DEK.
Key Coordination Policy Setup
Track the status of both the AWS key and the Salesforce EKM key that depends on it.
EKM Considerations
Take care when managing your external keys. Your Salesforce application depends on your external keys to encrypt and decrypt
your data. If the key status changes, your users could permanently lose access to encrypted data.
Connect Salesforce to AWS KMS and Create a Data Encryption Key
When you configure your connection between Salesforce and AWS, you provide information about the AWS KMS key that you want
Salesforce to use (key identifier, region, and description). You then generate a JSON structure and add that structure to your key
policy in the AWS console for your key.
Key Maintenance and Auditing for EKM
Common key operations include auditing, deactivating, reactivating, rotating, and checking the connection to your external keys.
These operations affect the keys identified in your Salesforce setup. The original keys in AWS are managed by a separate AWS process.
EKM in a Sandbox Org
A sandbox org that’s copied, refreshed, or cloned from a source org that uses EKM keys is granted minimum access to the source
org’s keys, so that it can decrypt any encrypted data it inherited from the source org. A sandbox org can’t manage its source org's
keys in any way, because sandboxes have limited access to those keys. Rotate the keys in a sandbox org as soon as you create it.
81
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
4. The customer KMS uses the root key to create and wrap the new DEK, which it sends back via
a secure channel.
5. The encryption service stores the wrapped DEK in the TenantSecret table.
82
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
When the Shield Platform encryption service detects encryption operations that require the EKM DEK, it checks its encrypted key cache
for it. If the unwrapped DEK isn’t present in the cache, the Shield Platform encryption service requests that the key service unwrap the
83
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
DEK. The key service unwraps the DEK and sends it back to the Shield Platform encryption service over a secure channel
(TLS(Awskms-SFKMS)/mTls). Then the Shield Platform encryption service adds the unwrapped key to the encrypted key cache.
1. A user accesses or saves encrypted data.
2. The Shield Platform encryption service gets the DEK from the TenantSecret table.
3. The encryption service sends the wrapped key to the customer KMS over a secure channel to be unwrapped.
4. The customer KMS uses the root key to unwrap the DEK and sends it back to the encryption service.
5. The encryption service stores the unwrapped key in the encrypted key cache for immediate use.
84
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
If the unwrapped DEK is present in the cache, the Shield Platform encryption service uses it for encryption and decryption of customer
data.
Because EKM DEKs bypass the key-derivation process, they’re used to directly encrypt and decrypt your data.
As a core offering of the Shield KMS, enhanced cache controls ensure that key material is stored securely while in the cache. The Shield
KMS encrypts the fetched key material with an org-specific AES 256-bit cache encryption key and stores the encrypted key material in
the cache for encrypt and decrypt operations. HSM-protected keys secure the cache encryption key in the cache, and the cache encryption
key is rotated along with key lifecycle events such as key destruction and rotation.
The enhanced cache controls provide a single source of truth for key material that’s used to encrypt and decrypt your data. Subsequent
encryption and decryption requests go through the encrypted key cache. They are unwrapped by the customer KMS until the DEK is
revoked or rotated or when the cache is flushed. After the cache is flushed, the EKM service again fetches the DEK from your specified
key service. The cache is flushed regularly every 72 hours. Certain Salesforce operations flush the cache, on average, every 24 hours.
Destroying a DEK invalidates the corresponding DEK that’s stored in the cache.
EKM Prerequisites
To use EKM, you must create a data encryption key (DEK) of sufficient strength in a supported
EDITIONS
external key management service. You should also check that an external application can
communicate with the key service to securely retrieve the DEK. Available in both Lightning
Salesforce EKM supports AWS Key Management Service key material only. Refer to the AWS KMS Experience and Salesforce
documentation for information about creating, accessing, and managing keys in AWS. Classic (not available in all
orgs).
Before you configure your connection in Salesforce, create your key material in AWS KMS. Salesforce
requires: Available in: Enterprise,
Performance, Unlimited,
• Symmetric key type
and Developer Editions.
• Single region (MultiRegion = False) Requires purchasing
• An ARN that’s in the same AWS region as the current Hyperforce instance within which your Salesforce Shield or Shield
core org resides. Platform Encryption, and
either the EKM Service or the
Make sure that you can access key material in both Salesforce and AWS KMS.
Cache-Only Key Service.
Exercise careful accounting between the Salesforce Key Management Setup page and the AWS
KMS dashboard. AWS KMS has no information about the status of Salesforce EKM secrets.
USER PERMISSIONS
85
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Set up an operational accounting policy that governs how the key states are communicated and Available in: Enterprise,
managed. If you no longer need an EKM key, you can deactivate it on the Key Management page Performance, Unlimited,
in Setup. But what do you do with the AWS key? We recommend that you back it up. To avoid and Developer Editions.
losing access to data, document the who, what, when, where, why, and how of all your key Requires purchasing
relationships. Make that documentation available to the people who need it. Salesforce Shield or Shield
Platform Encryption, and
either the EKM Service or the
SEE ALSO: Cache-Only Key Service.
Set Up Your Encryption Policy
USER PERMISSIONS
86
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
EKM Considerations
Take care when managing your external keys. Your Salesforce application depends on your external
EDITIONS
keys to encrypt and decrypt your data. If the key status changes, your users could permanently lose
access to encrypted data. Available in both Lightning
• Make sure that your encryption policy includes key-rotation and key-backup strategies as Experience and Salesforce
safeguards against unplanned key loss. Deactivate and destroy operations evict encrypted key Classic (not available in all
material from the cache. If the external key or the associated Salesforce data encryption keys orgs).
are disabled, deactivated, or deleted, related Salesforce data encrypted with them is no longer Available in: Enterprise,
accessible. Performance, Unlimited,
• External keys created in production can’t be activated or deactivated in sandboxes. As a best and Developer Editions.
practice, rotate data encryption keys in sandboxes immediately after a refresh. Rotation ensures Requires purchasing
that production and sandbox orgs use different data encryption keys, and that you’ll have full Salesforce Shield or Shield
control over them. Platform Encryption, and
either the EKM Service or the
• If a key isn’t available on the AWS side, after the key is flushed from the cache, neither encryption
Cache-Only Key Service.
nor decryption is possible. Users who try to access encrypted data see three question marks
(???) instead of the ciphertext. Any attempts to write data to encrypted fields fail. Users see
an error message that says the key is unavailable. USER PERMISSIONS
• When the AWS key isn’t available, we change the status of the key to Unavailable. This
To generate, destroy, export,
means we stop trying to call AWS KMS to get the key. You can check the connection to attempt import, upload, and
to reconnect to the key and update its status. configure tenant secrets and
• If you’re using EKM, you can still rotate the other types of keys available to your product (EKM, customer-supplied key
BYOK, Cache-only key, or a Salesforce-generated key). material:
• Manage Encryption Keys
SEE ALSO:
How Shield Platform Encryption Works in a Sandbox
Set Up Your Encryption Policy
Check the Connection to Your EKM Key
Connect Salesforce to AWS KMS and Create a Data Encryption Key
EKM Prerequisites
87
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
7. Log in to your AWS KMS console. Paste the copied JSON text into your key policy. Make sure that it references your key ID and not
an alias name, and then save your changes.
For example, use key/key_id instead of alias/alias_name in your ARN.
8. In Salesforce, on the Key Management page, click Done.
You receive a notification that AWS KMS is now connected to Salesforce and that a Salesforce data encryption key is created. Check the
connection and new data encryption key on the Key Management page.
SEE ALSO:
Check the Connection to Your EKM Key
88
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
89
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
USER PERMISSIONS
USER PERMISSIONS
90
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
USER PERMISSIONS
91
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
92
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
USER PERMISSIONS
93
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Providing limited EKM key access is essential to ensure a consistent experience in your sandbox Available in: Enterprise,
orgs. We strongly recommend that you rotate your keys on newly created sandbox orgs and sync Performance, Unlimited,
your data via Encryption Statistics right away. By rotating your keys, you avoid complications that and Developer Editions.
could happen if the original encryption keys are deactivated or destroyed. More specifically: Requires purchasing
Salesforce Shield or Shield
• In order to access their source org’s keys, sandboxes must share their source org's region when
Platform Encryption, and
using EKM. either the EKM Service or the
• Consider changes in the source org's AWS KMS Key Policy that restrict source org access to data Cache-Only Key Service.
encryption keys. These changes propagate to the sandbox orgs that still depend on those keys
at the time of change. If you rotate your keys, your sandbox is unaffected by changes in the
USER PERMISSIONS
source org’s key policies.
• We recommend that you clone a sandbox only after you rotate your keys and sync all the To generate, destroy, export,
encrypted data in the original sandbox. import, upload, and
configure tenant secrets and
• Access to keys is automatically extended at the time of sandbox creation, refresh or clone. We
customer-supplied key
also remove such access to EKM-based keys at the time of permanent sandbox org deletion. material:
• When you clone a sandbox org (with EKM keys), access is extended only for the EKM keys that • Manage Encryption Keys
belong to the source sandbox org, not any keys that the sandbox org inherited between the
time the original sandbox was created and the time the clone was created.
SEE ALSO:
Get Statistics About Your Encryption Coverage
94
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
SEE ALSO:
How Key Material Is Stored
External Key Management
95
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
encrypted data elements, the Cache-Only Key Service makes a callout to your key service. Your key service passes key material, wrapped
securely in JSON Web Encryption format, through a secure, authenticated channel that you set up.
96
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Prerequisites
• The Cache-Only Key Service is available for tenant secrets only. It isn’t compatible with root keys, such as those used with Search
Index Encryption.
• Prepare your Salesforce org. Make sure that your org has at least one active Data in Salesforce key, either Salesforce-generated or
one that you supply. You can create a tenant secret by clicking Generate Tenant Secret on the Key Management page in Setup.
• Generate and host key material. The cache-only key exchange protocol and format requires that keys are wrapped in an opinionated
JSON Web Encryption (JWE). This format uses RSAES-OAEP for key encryption and AES GCM for content encryption.
• Use a secure, trusted service to generate, store, and back up your key material.
• Use and maintain a reliable high-availability key service. To mitigate any potential impact to business continuity, choose a
high-availability key service with an acceptable service level agreement (SLA), predefined maintenance procedures, and processes.
• When the connection between Salesforce and your key service is broken, the Cache-Only Key Service can encrypt and decrypt data
as long as your key material is in the cache. However, keys don’t stay in the cache for long. The cache is regularly flushed every 72
hours, but some Salesforce operations flush the cache about every 24 hours.
• If your key material isn’t in the cache and the connection to your key service is broken, users can’t encrypt or decrypt records. Make
sure that you use a key service that Salesforce can connect to at any time, especially during busy times, such as the end of the year
or quarter.
• Maintain a secure callout endpoint. The cache-only key exchange protocol requires that keys are wrapped in an opinionated JSON
format. Host your wrapped key inside the key response at a location Salesforce can request.
• The Cache-Only Key Service uses named credentials to establish a secure, authenticated connection to allowed IP addresses and
domains. You can configure your named credentials to use popular authentication formats, such as Mutual TLS and OAuth. You can
change these authentication protocols at any time.
Note: A named credential for cache-only keys must specify a named principal. Creating a cache-only keys named credential
requires the basic Named Credentials process with the added step of adding the autoproc user to a permission set. See
Use a Named Principal-Based Credential for a Cache-Only Key for full details.
• Actively monitor your key service logs for errors. While Salesforce is here to help you with the Shield Platform Encryption service,
you’re responsible for maintaining the high-availability key service that you use to host your key material. You can use the
RemoteKeyCalloutEvent object to review or track cache-only key events.
Warning: Because you’re in control of your keys, you’re responsible for securing and backing up your key material. Salesforce
can’t retrieve lost key material stored outside of our encrypted key cache.
• Know how to format and assemble your key material. Format key material hosted outside of Salesforce in a way that’s compatible
with the Cache-Only Key Service. Make sure that you can generate these components in the required formats.
97
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Component Format
BYOK-compatible certificate A 4096-bit RSA certificate whose private key is encrypted with a
derived, org-specific tenant secret key
Unique key identifier Allows numbers, uppercase and lowercase letters, periods,
hyphens, and underscores
JSON web token ID (JTI) A 128-bit hex encoded, randomly generated identifier
Read more about assembling your key material in Create and Assemble Your Key Material on page 104. See Cache-Only Key Wrapper in
GitHub for examples and a sample utility.
Terminology
Here are some terms that are specific to the Cache-Only Key Service.
Content Encryption Key
For each key request, your key service endpoint generates a unique content encryption key. The content encryption key wraps the
data encryption key, which is then encrypted by the key encrypting key. After that it’s placed in the JWE header of the key response.
JSON Web Encryption
The JSON-based structure that the Shield Platform Encryption service uses to encrypt content. JSON Web Encryption, or JWE, uses
RSAES-OAEP for key encryption and AES GCM for content encryption.
JSON Web Token ID
A unique identifier for the JSON web token, which enables identity and security information to be shared across security domains.
Key Identifier
The Key ID (KID) is the unique identifier for your key. The KID is used as the suffix in the named credential and for validation of the
KID in the response. In Setup, enter this identifier in the Unique Key Identifier field.
98
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
99
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
5. Save the new external named credential. Salesforce shows the properties page for your new named credential.
Leave the properties page open and then go on to configure an external named principal.
100
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
1. In Setup, in the Quick Find box, enter Permission Sets, and then select Permission Sets.
2. Select New.
3. Enter a label and an API name for the permission set.
4. Save the permission set.
Salesforce shows the properties page for your new permission set.
5. While you're here, get the ID of the permission set from the browser address bar. You need the permission set ID later when you
assign users.
The permission set ID is everything to the right of %2F in the URL:
6. To show the principal access properties, select External Credential Principal Access.
7. In the External Credential Principal Access section, click Edit.
Salesforce shows the external principal chooser.
8. Select the principal that you want to use, click Add, and then save your changes.
Next, assign the Automated Process user (autoproc) to the permission set.
101
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
4. To verify the assignment, return to your permission set property page, and then click Manage Assignments.
The Automated Process user is the only account assigned to the permission set.
Next, create the named credential.
For guidance on the other New Named Credentials parameters, see Create or Edit an External Credential.
102
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Note: If you're asked for a certificate, create or select a self-signed or CA-signed certificate. See Generate a BYOK-Compatible
Certificate.
Salesforce checks the connection to the endpoint specified by the named credential. If Salesforce can reach the endpoint, the key
specified for the unique key identifier becomes the active key. All data marked for encryption by your encryption policy is encrypted
with your cache-only key.
If Salesforce can’t reach the specified endpoint, it displays an error to help you troubleshoot the connection.
103
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
6. Encrypt the content encryption key with the public key from the BYOK certificate using the RSAES-OAEP algorithm. Then encode
this encrypted content encryption key as BASE64URL(Encrypted CEK).
l92QA-R7b6Gtjo0tG4GlylJti1-Pf-519YpStYOp28YToMxgUxPmx4NR_myvfT24oBCWkh6hy_dqAL7JlVO4
49EglAB_i9GRdyVbTKnJQ1OiVKwWUQaZ9jVNxFFUYTWWZ-sVK4pUw0B3lHwWBfpMsl4jf0exP5-5amiTZ5oP
0rkW99ugLWJ_7XlyTuMIA6VTLSpL0YqChH1wQjo12TQaWG_tiTwL1SgRd3YohuMVlmCdEmR2TfwTvryLPx4K
bFK3Pv5ZSpSIyreFTh12DPpmhLEAVhCBZxR4-HMnZySSs4QorWagOaT8XPjPv46m8mUATZSD4hab8v3Mq4H3
3CmwngZCJXX-sDHuax2JUejxNC8HT5p6sa_I2gQFMlBC2Sd4yBKyjlDQKcSslCVav4buG8hkOJXY69iW_zhz
tV3DoJJ90l-EvkMoHpw1llU9lFhJMUQRvvocfghs2kzy5QC8QQt4t4Wu3p7IvzeneL5I81QjQlDJmZhbLLor
FHgcAs9_FMwnFYFrgsHP1_v3Iqy7zJJc60fCfDaxAF8Txj_LOeOMkCFl-9PwrULWyRTLMI7CdZIm7jb8v9AL
xCmDgqUi1yvEeBJhgMLezAWtxvGGkejc0BdsbWaPFXlI3Uj7C-Mw8LcmpSLKZyEnhj2x-3Vfv5hIVauC6ja1
B6Z_UcqXKOc
7. Generate an initialization vector for use as input to the data encryption key’s AES wrapping. Then encode it in base64url.
N2WVMbpAxipAtG9O
8. Wrap your data encryption key with your content encryption key.
a. Encode the JWE header as ASCII(BASE64URL(UTF8(JWE Protected Header))).
b. Reform authenticated encryption on the data encryption key with the AES GCM algorithm. Use the content encryption key as
the encryption key, the initialization vector (the bytes, not the base64 URL encoded version), and the Additional Authenticated
Data value, requesting a 128-bit Authentication Tag output.
c. Encode the resulting ciphertext as BASE64URL(Ciphertext).
d. Encode the Authentication Tag as BASE64URL(Authentication Tag).
63wRVVKX0ZOxu8cKqN1kqN-7EDa_mnmk32DinS_zFo4
and
HC7Ev5lmsbTgwyGpeGH5Rw
104
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
9. Assemble your JWE as a compact serialization of all the preceding values. Concatenate values separated by a period.
eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkEyNTZHQ00iLCJraWQiOiI5ODJjMzc1Yi1mNDZiLTQ0MjMtOGMy
ZC00ZDFhNjkxNTJhMGIifQ.l92QA-R7b6Gtjo0tG4GlylJti1-Pf-519YpStYOp28YToMxgUxPmx4NR_myvf
T24oBCWkh6hy_dqAL7JlVO449EglAB_i9GRdyVbTKnJQ1OiVKwWUQaZ9jVNxFFUYTWWZ-sVK4pUw0B3lHwWB
fpMsl4jf0exP5-5amiTZ5oP0rkW99ugLWJ_7XlyTuMIA6VTLSpL0YqChH1wQjo12TQaWG_tiTwL1SgRd3Yoh
uMVlmCdEmR2TfwTvryLPx4KbFK3Pv5ZSpSIyreFTh12DPpmhLEAVhCBZxR4-HMnZySSs4QorWagOaT8XPjPv
46m8mUATZSD4hab8v3Mq4H33CmwngZCJXX-sDHuax2JUejxNC8HT5p6sa_I2gQFMlBC2Sd4yBKyjlDQKcSsl
CVav4buG8hkOJXY69iW_zhztV3DoJJ90l-EvkMoHpw1llU9lFhJMUQRvvocfghs2kzy5QC8QQt4t4Wu3p7Iv
zeneL5I81QjQlDJmZhbLLorFHgcAs9_FMwnFYFrgsHP1_v3Iqy7zJJc60fCfDaxAF8Txj_LOeOMkCFl-9Pwr
ULWyRTLMI7CdZIm7jb8v9ALxCmDgqUi1yvEeBJhgMLezAWtxvGGkejc0BdsbWaPFXlI3Uj7C-Mw8LcmpSLKZ
yEnhj2x-3Vfv5hIVauC6ja1B6Z_UcqXKOc.N2WVMbpAxipAtG9O.63wRVVKX0ZOxu8cKqN1kqN-7EDa_mnmk
32DinS_zFo4.HC7Ev5lmsbTgwyGpeGH5Rw
For more detailed examples of this process, check out the sample Cache-Only Key Wrapper in Github. You can use either the utility in
this repository or another service of your choosing.
e5ab58fd2ced013f2a46d5c8144dd439 AND
Manage Encryption Keys
2. Echo this nonce in the JWE protected header, along with the algorithm used to encrypt the
content encryption key, the algorithm used to encrypt the data encryption key, and the unique To generate, destroy, export,
import, upload, and
ID of the cache-only key. Here’s an example.
configure tenant secrets and
customer-supplied key
material:
• Manage Encryption Keys
{"alg":"RSA-OAEP","enc":"A256GCM","kid":"982c375b-f46b-4423-8c2d-4d1a69152a0b","jti":"e5ab58fd2ced013f2a46d5c8144dd439"}
3. From Setup, in the Quick Find box, enter Encryption Settings, and then click Encryption Settings.
4. In the Advanced Encryption Settings section, turn on Enable Replay Detection for Cache-Only Keys.
You can also enable replay detection programmatically. For more information, see EncryptionKeySettings in the Metadata API
Developer Guide.
From now on, every callout to an external key service includes a unique RequestIdentifier.
Warning: If you enable replay detection but don’t return the nonce with your cache-only key material, Salesforce aborts the
callout connection and displays a POTENTIAL_REPLAY_ATTACK_DETECTED error.
105
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
1. From Setup, enter Platform Encryption in the Quick Find box, then select Key Available in: Enterprise,
Management. Performance, Unlimited,
and Developer Editions.
2. Choose the Certificate Unique Name and Named Credential associated with your Unique Key
Requires purchasing
Identifier.
Salesforce Shield or Shield
3. In the Actions column, next to the key material you want to check, click Details. Platform Encryption, and the
4. On the Cache-Only Key: Callout Check page, click Check. Cache-Only Key Service.
Details about your callout connection display on the page. It can take a few moments for the
callout check to complete and display the results. USER PERMISSIONS
5. Review the details about your callout connection. If your callout connection was unsuccessful, you see a descriptive error message
at the bottom of the results pane. Use this message to make the appropriate adjustments to your key service.
106
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
USER PERMISSIONS
2. Find your key in the table and click Activate. Available in: Enterprise,
The Shield Key Management Service fetches the reactivated cache-only key from your key Performance, Unlimited,
service and uses it to access data that was previously encrypted with it. and Developer Editions.
Requires purchasing
Note: You can sync your data to your active cache-only key just like you can with any Salesforce Shield or Shield
other key material. Platform Encryption, and the
Cache-Only Key Service.
USER PERMISSIONS
107
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
CRM Analytics
Backups of CRM Analytics data are encrypted with your Shield Platform Encryption keys. If you encrypt data in CRM Analytics datasets
with a cache-only key, make sure that the Analytics cache-only key is in the same state as your Fields and Files (Probabilistic) cache-only
key.
108
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Service Protections
To protect against Shield KMS interruptions and ensure smooth encryption and decryption processes, you can have up to 10 active and
archived cache-only keys of each type.
If you reach your key limit, destroy an existing key so that you can create, upload, reactivate, rearchive, or create a callout to another one.
Remember to synchronize your data with an active key before destroying key material.
Hyperforce Migration
When your org moves from a non-Hyperforce platform to Hyperforce, you may need to revisit your AWS KMS IP connection settings.
We recommend that Hyperforce customers adopt the best practices listed in the topic Preferred Alternatives to IP Allowlisting on
Hyperforce as soon as possible.
EMPTY_RESPONSE The remote key service callout Contact your remote key
returned an empty response. service.
Contact your remote key
service for help.
ERROR_HTTP_CODE The remote key service To find out what went wrong,
returned an unsupported review the HTTP response
HTTP response code: {000}. A code.
successful HTTP response
returns a 200 code.
ILLEGAL_PARAMETERS_IN_JWE_HEADER Your JWE header must use {0}, Remove the unsupported
but no others. Found: {1}. parameters from your JWE
header.
109
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
INCORRECT_DATA_ENCRYPTION_KEY_SIZE Data encryption keys encoded in a JWE Make sure that your data encryption key
must be 32 bytes. Yours is {value} bytes. is 32 bytes.
INCORRECT_ENCRYPTION_ALGORITHM_IN_JWE_HEADER The remote key service returned a JWE The algorithm for encrypting the data
header that specified an unsupported encryption key in your JWE header must
encryption algorithm (enc): {your enc}. be in A256GCM format.
INCORRECT_KEYID_IN_JSON The remote key service returned JSON with Check that you set up your named
an incorrect key ID. Expected: {valid keyID}. credential properly and are using the
Actual: {invalid keyID}. correct BYOK-compatible certificate.
INCORRECT_KEYID_IN_JWE_HEADER The remote key service returned a JWE Check that you set up your named
header with an incorrect key ID. Expected: credential properly and are using the
{valid keyID}. Actual: {invalid keyID}. correct BYOK-compatible certificate.
MALFORMED_CONTENT_ENCRYPTION_KEY The remote key service returned a content Check that you set up your named
encryption key in the JWE that couldn’t be credential properly and are using the
decrypted with the certificate’s private key. correct BYOK-compatible certificate.
Either the JWE is corrupted, or the content
encryption key is encrypted with a
different key.
MALFORMED_DATA_ENCRYPTION_KEY The content encryption key couldn’t Check that you set up your named
decrypt the data encryption key that was credential properly and are using the
returned in the remote key service’s JWE. correct BYOK-compatible certificate.
The data encryption key is either Named credentials must call out to an
malformed, or encrypted with a different HTTPS endpoint.
content encryption key.
MALFORMED_JSON_RESPONSE We can’t parse the JSON returned by your Contact your remote key service.
remote key service. Contact your remote
key service for help.
MALFORMED_JWE_RESPONSE The remote key service returned a Contact your remote key service.
malformed JWE token that can’t be
decoded. Contact your remote key service
for help.
MISSING_PARAMETERS_IN_JWE_HEADER Your JWE header is missing one or more Make sure that your JWE header includes
parameters. Required: {0}. Found:{1}. all required values. For example, if Replay
Detection is enabled, the JWE header must
include the nonce value extracted from
the cache-only key callout.
POTENTIAL_REPLAY_ATTACK_DETECTED The remote key service returned a JWE Make sure that your JWE header includes
header with an incorrect nonce value. the RequestID included in the callout.
Expected: {0}. Actual: {1}
110
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
RESPONSE_TIMEOUT The remote key service callout took too If your key service is unavailable after
long and timed out. Try again. multiple callout attempts, contact your
remote key service.
UNKNOWN_ERROR The remote key service callout failed and Contact your remote key service.
returned an error: {000}.
UNKNOWN_ERROR The remote key service callout failed and The certificate for your cache-only key has
returned an error: expired. Update your cache-only key
java.security.cert.CertificateExpiredException: material to use an active BYOK-compatible
NotAfter: {date and time of expiration} certificate.
The following key service errors can prevent the callout from completing. If you see errors related to these problems, contact your
key service administrator for help.
• The JWE is corrupt or malformed.
• The data encryption key is malformed.
• The key service returned a malformed JWE token.
• The key service returned an empty response.
For uniform resource use, Salesforce limits the amount of time for each key service callout to 3 seconds. If the callout takes more
than the allotted time, Salesforce fails the callout with a timeout error. Check that your key service is available. Make sure that your
named credential references the correct endpoint—check the URL, including the IP address.
Can I execute a remote callout in Apex?
Yes. Salesforce manages all authentication for Apex callouts that specify a named credential as the callout endpoint so that your
code doesn’t have to. To reference a named credential from a callout definition, use the named credential URL. A named credential
URL contains the scheme callout, the name of the named credential, and an optional path. For example:
callout:My_Named_Credential/some_path.
See Named Credentials as Callout Endpoints in the Apex Developer Guide.
Can I monitor my callout history?
If you want to review or track cache-only key events, use the RemoteKeyCalloutEvent standard object. Either use the
describeSObjects() call to view event information, or an after insert Apex trigger to perform custom actions after each
callout. For example, you can write a trigger that stores RemoteKeyCallout events in a custom object. When you store
RemoteKeyCallout events in a custom object, you can monitor your callout history. See the RemoteKeyCalloutEvent entry in
the Salesforce Object Reference for more information.
The Setup Audit Trail tracks changes in key material state and named credential settings. Callout history isn’t recorded in log files.
111
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
I see “?????”, !!!!!, 08/08/1888, or 01/01/1777 instead of my data when I try to access data encrypted with a cache-only key,
Why?
The value that you see is a string reserved for masking notifications. The presence of a reserved masked value means one of two
things. Either the connection to your key service is broken and we can’t fetch your key, or the data is encrypted with a destroyed
key. Check that your key service is available and that your named credential references the correct endpoint. If any key versions are
marked as Destroyed as a result of a key service failure, recover the connection and activate the key version by hand. The topic Why
Isn’t My Encrypted Data Masked? on page 32 lists all the reserved masking notification strings.
I see either “????? ?????” or the error "UNKNOWN_EXCEPTION, Urgent: your key service unavailable. You can’t edit, view, or
create encrypted records without the encryption key provided by this service. Contact your Salesforce security admin.”
whenever I open records that contain previously encrypted data, Why?
This error can result if your Cache-Only key Key Management Server is unavailable. If you’re confident that your cache-only key exists,
check that the connections from AWS to Hyperforce are allowed. Your AWS KMS must permit access to the required the Salesforce
Hyperforce IP addresses.
We recommend that Hyperforce customers adopt best practices as documented in the topic Preferred Alternatives to IP Allowlisting
on Hyperforce.
My certificate is about to expire. What do I do?
An expired certificate doesn’t affect the active state of the secret that it wraps. Your certificate gives assurance to the recipient that
the received secret was sent and wrapped by you. If you use an expired certificate, your secret is still protected, but the receiving
party is notified that the certificate is expired. Salesforce does not block your secret if it’s wrapped with an expired certificate.
Do I have to make a new named credential every time I rotate a key?
Nope. You can use a named credential with multiple keys. As long as you host your key material at the endpoint specified in an
existing named credential, you’re all set. When you rotate your key material, change the key ID in the Unique Key Identifier field.
Double-check that your new key is stored at the specified endpoint URL in your named credential.
Can I use legacy named credentials with cache-only keys?
Yes. You can use whichever type is supported by your external key service.
I’m still having problems with my key. Who should I talk to?
If you still have questions, contact your account executive or Salesforce Customer Support. They’ll put you in touch with a support
team specific to this feature.
112
Strengthen Your Data’s Security with Shield Platform Work with External Key Material
Encryption
Note: Some endpoints support legacy named credentials, and others require named Available in both Salesforce
principal-based named credentials. This topic doesn’t show you how to configure a named Classic (not available in all
orgs) and Lightning
principal-based credential. See Use a Named Principal-Based Credential for a Cache-Only Key.
Experience.
1. Make sure that your org has an active Fields and Files (Probabilistic) key, either
Salesforce-generated or customer-supplied. Available in: Enterprise,
Performance, Unlimited,
• From Setup, in the Quick Find box, enter Encryption Settings, and then select Encryption and Developer Editions.
Settings. Turn on Generate Initial Probabilistic Tenant Secret. Requires purchasing
• From Setup, in the Quick Find box, enter Key Management, and then select Key Salesforce Shield or Shield
Management. Select the Fields and Files (Probabilistic)tab, and then click Generate Platform Encryption, and
Tenant Secret. Cache-Only Keys.
2. From Setup, in the Quick Find box, enter Named Credential, and then select Named
Credential. USER PERMISSIONS
Tip: A named credential provides an authenticated callout mechanism through which To create, edit, and delete
named credentials:
Salesforce can fetch your key material. Because named credentials are allowlisted, they’re
• Customize Application
a secure and convenient channel for key material stored outside of Salesforce.
To allow cache-only keys
Learn more about named credentials, how to define a named credential, and how to
with BYOK:
grant access to authentication settings for named credentials in Salesforce Help.
• Customize Application
AND
3. Create a named credential. Specify an HTTPS endpoint from which Salesforce can fetch your
key material. Manage Encryption Keys
4. From Setup, in the Quick Find box, enter Encryption Settings, and then select To generate, destroy, export,
import, upload, and
Encryption Settings.
configure tenant secrets and
5. In the Advanced Encryption Settings section, turn on Allow Cache-Only Keys. customer-supplied key
You can also enable the Cache-Only Key Service programmatically. For more information, see material:
• Manage Encryption Keys
EncryptionKeySettings in the Metadata API Developer Guide.
Note: If you turn off Allow Cache-Only Keys, data that’s encrypted with cache-only
key material remains encrypted and Salesforce continues to invoke secured callouts.
However, you can’t modify your cache-only key configuration or add new ones. If you
don’t want to use cache-only keys, rotate your key material to use customer-supplied
(BYOK) key material. Then synchronize all your data, and turn off Allow Cache-Only Keys.
6. From Setup, in the Quick Find box, enter Platform Encryption, and then select Key Management.
7. In the Key Management Table, select a key type.
8. Click Bring Your Own Key.
9. Select a BYOK-compatible certificate from the Choose Certificate dropdown.
10. Select Use a Cache-Only Key.
11. For Unique Key Identifier, enter your KID—the unique key identifier for your data encryption key. Your identifier can be a number,
a string (2018_data_key), or a UUID (982c375b-f46b-4423-8c2d-4d1a69152a0b).
113
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption Customizations
Encryption
12. In the Named Credential dropdown, select the named credential associated with your key. You can have multiple keys associated
with each named credential.
Salesforce checks the connection to the endpoint specified by the named credential. If Salesforce can reach the endpoint, the key
specified for the Unique Key Identifier becomes the active key. All data marked for encryption by your encryption policy is encrypted
with your cache-only key.
If Salesforce can’t reach the specified endpoint, an error displays to help you troubleshoot the connection.
Cache-only key status is recorded as Fetched on the Key Management page. In Enterprise API, the TenantSecret Source value is listed
as Remote.
Tip: You can monitor key configuration callouts in the Setup Audit Trail. When a callout to an active or archived cache-only key
is successful, the Setup Audit Trail logs an Activated status. Individual callouts aren’t monitored in Setup Audit Trail.
114
Strengthen Your Data’s Security with Shield Platform Apply Encryption to Fields Used in Matching Rules
Encryption
Tip: Standard matching rules are automatically deactivated when encryption is added to a field referenced by that rule. To
encrypt fields referenced in standard matching rules, follow steps 3–8.
8. After you get the email verifying encryption’s been enabled on your fields, reactivate your matching rule and associated duplicate
management rule.
Matching rules used in duplicate management now return exact and fuzzy matches on encrypted data.
Example: Let’s say that you encrypted the Billing Address on your Contacts, and you want to add this field to a custom matching
rule. First, deactivate the rule or rules that you want to add this field to. Make sure that the Billing Address field is encrypted with
the deterministic encryption scheme. Then add Billing Address to your custom matching rule, just like how you add any other
field. Finally, reactivate your rule.
When you rotate your key material, you must update custom matching rules that reference encrypted fields. After you rotate your key
material, deactivate and then reactivate the affected matching rules. Then contact Salesforce to request the background encryption
process. When the background encryption process finishes, your matching rules can access all data encrypted with your active key
material.
115
Strengthen Your Data’s Security with Shield Platform Use Encrypted Data in Formulas
Encryption
Important: To ensure accurate matching results, customers who used the beta version of this feature must deactivate any
matching rules that reference encrypted fields and then reactivate them. If your custom matching rule fails on reactivation, contact
Salesforce for help with reactivating your match index.
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
Available as an add-on subscription in: Enterprise, Performance, and Unlimited Editions. Requires purchasing Salesforce Shield or
Shield Platform Encryption. Available in Developer Edition at no charge.
Note: Formula fields that reference encrypted data are supported only in Salesforce Classic. They aren't supported in Lightning
Experience or via SOQL. If you work exclusively in Lightning Experience or have dependencies on formula fields that require
Lightning Experience, we recommend that you don't reference encrypted fields in formulas. The following examples apply to
Salesforce Classic.
This works:
(encryptedField__c & encryptedField__c)
116
Strengthen Your Data’s Security with Shield Platform Use Encrypted Data in Formulas
Encryption
Why it doesn’t work: LOWER isn’t a supported function, and the input is an encrypted value.
Case
CASE returns encrypted field values, but doesn’t compare them.
This works:
CASE(custom_field__c, "1", cf2__c, cf3__c))
Why it works: custom_field__c is compared to “1”. If it’s true, the formula returns cf2__c because it’s
not comparing two encrypted values.
This works:
OR(ISBLANK(encryptedField__c), ISNULL(encryptedField__c))
Why it works: Both ISBLANK and ISNULL are supported. OR works in this example because ISBLANK and
ISNULL return a Boolean value, not an encrypted value.
Spanning
This works:
(LookupObject1__r.City & LookupObject1__r.Street) &
(LookupObject2__r.City & LookupObject2__r.Street) &
(LookupObject3__r.City & LookupObject3__r.Street) &
(LookupObject4__r.City & LookupObject4__r.Street)
How and why you use it: Spanning retrieves encrypted data from multiple entities. For example, let’s say you work in the
customer service department for Universal Containers. A customer has filed a case about a distribution
problem, and you want to see the scope of the issue. You want all the shipping addresses related
to this particular case. This example returns all the customers’ shipping addresses as a single string
in your case layout.
117
Strengthen Your Data’s Security with Shield Platform Tradeoffs and Limitations of Shield Platform Encryption
Encryption
Validation
The encryption validation service checks your org to make sure that it’s compatible with encrypted formula field types.
When you encrypt a given field, the validation service:
• Retrieves all formula fields that reference the field
• Verifies that the formula fields are compatible with encryption
• Verifies that the formula fields aren’t used elsewhere for filtering or sorting
Limits
Up to 200 formula fields can reference a given encrypted custom field. A field that is referenced by more than 200 formula fields can’t
be encrypted. If you must reference an encrypted custom field from more than 200 formula fields, contact Salesforce.
When you specify multiple fields to encrypt at one time, the 200-field limit is applied to the whole batch. If you know that you’re encrypting
fields that have multiple formula fields pointing to them, encrypt those fields one at a time.
These considerations apply to data encrypted with Shield Platform Encryption’s deterministic
encryption scheme. Some considerations manifest differently depending on whether data is
encrypted with the case-sensitive or case-insensitive deterministic encryption scheme.
Shield Platform Encryption and the Lightning Experience
Shield Platform Encryption works the same way in the Lightning Experience as it does in Salesforce Classic, with a few minor exceptions.
Field Limits with Shield Platform Encryption
It’s good practice to use validation rules to enforce these field limits. In addition, because encrypted content is often longer than its
ciphertext, encrypting a field can impose further limits on the values that you store in that field. Therefore, test your field limits in
longer fields, such as Address and Subject, and on any encrypted field that contains non-ASCII values such as Chinese, Japanese, or
Korean-encoded data.
Which Salesforce Apps Don’t Support Shield Platform Encryption?
Some Salesforce features work as expected when you work with data that’s encrypted with Shield Platform Encryption. Others don’t.
118
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption Best Practices
Encryption
3. Create a strategy early for backing up and archiving keys and data.
If your tenant secrets are destroyed, reimport them to access your data. You are solely responsible for making sure that your data
and tenant secrets are backed up and stored in a safe place. Salesforce cannot help you with deleted, destroyed, or misplaced tenant
secrets.
4. Read the Shield Platform Encryption considerations and understand their implications on your organization.
• Evaluate the impact of the considerations on your business solution and implementation.
• Test Shield Platform Encryption in a sandbox environment before deploying to a production environment. Encryption policy
settings can be deployed using change sets.
• Before enabling encryption, fix any violations that you uncover. For example, if you reference encrypted fields in a SOQL ORDER
BY clause, a violation occurs. Fix the violation by removing references to the encrypted fields.
• When requesting feature enablement, such as pilot features, give Salesforce Customer Support several days lead time. The time
to complete the process varies based on the feature and how your org is configured.
119
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption Best Practices
Encryption
7. Grant the Manage Encryption Keys user permission to authorized users only.
Users with the Manage Encryption Keys permission can generate, export, import, and destroy organization-specific keys. Monitor
the key management activities of these users regularly with the setup audit trail.
12. Use discretion when granting login as access to users or Salesforce Customer Support.
If you grant login access to a user, and they have field level security access to an encrypted field, that user is able to view encrypted
data in that field in plaintext.
If you want Salesforce Customer Support to follow specific processes around asking for or using login as access, you can create
special handling instructions. Salesforce Customer Support follows these instructions in situations where login as access may help
them resolve your case. To set up these special handling instructions, contact your account executive.
120
Strengthen Your Data’s Security with Shield Platform General Shield Platform Encryption Considerations
Encryption
Flow Builder Record Choice Set resource Record Choice Set resource
Get Records element Get Records element
Delete Records element
Update Records element
121
Strengthen Your Data’s Security with Shield Platform General Shield Platform Encryption Considerations
Encryption
You can store the value from an encrypted field in a variable and operate on that value in your flow’s logic. You can also update the
value for an encrypted field.
Paused flow interviews can cause data to be saved in an unencrypted state. When a flow or process is waiting to resume, the associated
flow interview is serialized and saved to the database. The flow interview is serialized and saved when:
• Users pause a flow
• Flows execute a Wait element
• Processes are waiting to execute scheduled actions
If the flow or process loads encrypted fields into a variable during these processes, that data isn’t always encrypted at rest.
Custom Fields
You can’t use encrypted custom fields in criteria-based sharing rules.
Some custom fields can’t be encrypted.
• Fields that have the Unique or External ID attributes or include these attributes on previously encrypted custom fields
(applies only to fields that use the probabilistic encryption scheme)
• Fields on external data objects
• Fields that are used in an account contact relation
You can’t use Schema Builder to create an encrypted custom field.
You can’t use Shield Platform Encryption with Custom Metadata Types.
Masking Tradeoffs
Shield Platform Encryption doesn’t provide a masking feature, but it encrypts fields that you configure with masking. We reserve a few
values to notify you when the encryption key used for an encrypted masked field is unavailable or has been destroyed. The topic Why
Isn’t My Encrypted Data Masked? on page 32 lists all the reserved masking notification strings.
122
Strengthen Your Data’s Security with Shield Platform General Shield Platform Encryption Considerations
Encryption
For information about SOQL and SOSL compatibility with deterministic encryption, see Considerations for Using Deterministic
Encryption in Salesforce Help.
Tip: Consider whether you can replace a WHERE clause in a SOQL query with a FIND query in SOSL.
• When you query encrypted data, invalid strings return an INVALID_FIELD error instead of the expected MALFORMED_QUERY.
Portals
If a legacy portal (created before 2013) is enabled in your org, you can't encrypt standard fields. To enable encryption on standard fields,
deactivate all legacy customer and partner portals. (Salesforce Experience Cloud sites are supported.)
To deactivate a legacy customer portal, go to the Customer Portal Settings page in Setup. To deactivate a legacy partner portal, go to
the Partners page in Setup.
Search
If you encrypt fields with a key and then destroy the key, the corresponding search terms remain in the search index. However, you can’t
decrypt the data associated with the destroyed key.
123
Strengthen Your Data’s Security with Shield Platform General Shield Platform Encryption Considerations
Encryption
• Fax
• Mobile
• Home Phone
• Other Phone
• Email
When the Account Name or Contact Name field is encrypted with probabilistic encryption, searching for duplicate accounts or contacts
to merge doesn’t return any results. With deterministic encryption, searching for duplicate accounts or contacts to merge will find
duplicates.
When you encrypt the First Name or Last Name field on a contact, that contact appears in the Calendar Invite lookup only if you haven’t
filtered by First Name or Last Name.
Data copied from an encrypted Contact field to a Quote field isn't encrypted.
Email-to-Case
Copying text from email fields also copies unicode characters embedded in email text. Two of those unicode character sequences,
\uFFFE and \uFFFF, can’t be included in text encrypted by Shield Platform Encryption. If you encounter an error mentioning these
unicode sequences, delete the text copied from the email field and type it manually.
Campaigns
Campaign member search isn’t supported when you search by encrypted fields.
Notes
You can encrypt the body text of Notes created with the new Notes tool. However, the Preview file and Notes created with the old Notes
tool aren’t supported.
124
Strengthen Your Data’s Security with Shield Platform General Shield Platform Encryption Considerations
Encryption
Salesforce Experiences
If you encrypt the Account Name field and you’re not using Person Accounts, encryption affects how users’ roles are displayed to admins.
Normally, a site user’s role name is displayed as a combination of their account name and the name of their user profile. When you
encrypt the Account Name field, the account ID is displayed instead of the account name.
For example, when the Account Name field isn’t encrypted, users belonging to the Acme account with the Customer User profile would
have a role called Acme Customer User. When Account Name is encrypted (and Person Accounts aren’t in use), the role is displayed
as something like 001D000000IRt53 Customer User.
125
Strengthen Your Data’s Security with Shield Platform Considerations for Using Deterministic Encryption
Encryption
Employees
If the email field is encrypted using probabilistic encryption, wellness check surveys can’t be used. Deterministic encryption is fully
supported.
General
• Encrypted fields can’t be used in:
– Criteria-based sharing rules
– Similar opportunities searches
– External lookup relationships
• Fields encrypted with the probabilistic encryption scheme can’t be used in filter criteria for data management tools. For considerations
specific to filter-preserving deterministic encryption, read Considerations for Using Deterministic Encryption.
• Web-to-Case is supported, but the Web Company, Web Email, Web Name, and Web Phone fields aren’t encrypted at rest.
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
126
Strengthen Your Data’s Security with Shield Platform Considerations for Using Deterministic Encryption
Encryption
Case Sensitivity
When you use case-sensitive deterministic encryption, case matters. In reports, list views, and SOQL queries on encrypted fields, the
results are case-sensitive. Therefore, a SOQL query against the Contact object, where LastName = Jones, returns only Jones, not jones
or JONES. Similarly, when the case-sensitive deterministic scheme tests for unicity (uniqueness), each version of “Jones” is unique.
Chat
For the best possible recommendation results, use the case-sensitive deterministic encryption scheme with the Utterance field on the
Utterance Suggestion object. This field doesn’t support other encryption schemes at this time.
The Actor Name field on the Conversation Entry object supports case-sensitive deterministic encryption, but not case-insensitive
deterministic encryption.
Compound Fields
Even with deterministic encryption, some kinds of searches don’t work when data is encrypted with case-sensitive deterministic encryption.
Concatenated values, such as compound names, aren’t the same as the separate values. For example, the ciphertext for the compound
name “William Jones” isn’t the same as the concatenation of the ciphertexts for “William” and “Jones”.
So, if the First Name and Last Name fields are encrypted in the Contacts object, this query doesn’t work:
Select Id from Contact Where Name = 'William Jones'
Case-sensitive and case-insensitive deterministic encryption schemes support compound fields, but only with individual column queries.
127
Strengthen Your Data’s Security with Shield Platform Considerations for Using Deterministic Encryption
Encryption
External ID
Case-insensitive deterministic encryption supports Text and Email external ID custom fields but not other external ID custom fields.
When you create or edit these fields, use one of the recommended field setting combinations.
You can’t save changes to both Unique - Case-Sensitive and Encrypted options at the same time. Change one setting, save it, then
change the next.
Filter Operators
In reports and list views, the operators “equals” and “not equal to” are supported with case-sensitive deterministic encryption. Other
operators, like “contains” or “starts with,” don’t return an exact match and aren’t supported. Features that rely on unsupported operators,
such as Refine By filters, also aren’t supported.
Case-insensitive deterministic encryption supports list views and reports. However, the user interface displays all operators, including
operators that aren’t supported for encrypted data. To review the list of supported operators available in Salesforce Classic, see Use
Encrypted Data in Formulas.
Formulas
Fields encrypted with the deterministic encryption scheme can’t be referenced in SOQL WHERE queries.
128
Strengthen Your Data’s Security with Shield Platform Considerations for Using Deterministic Encryption
Encryption
Indexes
Case-sensitive deterministic encryption supports single-column indexes, single-column case-sensitive unique indexes, two-column
indexes, and custom indexes on standard and custom fields.
Case-insensitive deterministic encryption offers limited support for standard indexes on these standard fields.
• Contact—Email
• Email Message—Relation
• Lead—Email
• Name
Queries against these fields, when encrypted with case-insensitive deterministic encryption, can perform poorly with large tables. For
optimal query performance, use custom indexes instead of standard indexes. To set up custom indexes, contact Salesforce Customer
Support. Lookup fields that reference the Name field also follow this pattern because they rely on indexes. To filter on the Name field in
list views and reports, filter against the standard Name field instead of a lookup field.
Expect the enablement process to take longer when you apply deterministic encryption to a field with a large number of records. To
support filtering, the enablement process also rebuilds field indexes.
129
Strengthen Your Data’s Security with Shield Platform Shield Platform Encryption and the Lightning Experience
Encryption
130
Strengthen Your Data’s Security with Shield Platform Field Limits with Shield Platform Encryption
Encryption
Note: This list isn’t exhaustive. For information about a field not shown here, refer to the API.
131
Strengthen Your Data’s Security with Shield Platform Which Salesforce Apps Don’t Support Shield Platform
Encryption Encryption?
Note: This page is about Shield Platform Encryption, not Classic Encryption. What's the difference?
132