<div class="content"><p>The Encrypting File System Remote Protocol (hereafter
referred to as EFSRPC) is a <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_8a7f6700-8311-45bc-af10-82e10accd331" data-linktype="relative-path">Remote
Procedure Call (RPC)</a> interface that is used to manage data objects stored
in an encrypted form. The objective of encrypting data in this fashion is to
enforce access control policies and to provide confidentiality from
unauthorized users.</p><p>EFSRPC is implemented in Windows to provide remote
management for <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_a04c146a-de3b-4e4b-829f-a9e772f3fe25" data-linktype="relative-path">files</a>
encrypted by the <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_3bd30c20-9517-4030-a48c-380362e209a1" data-linktype="relative-path">Encrypting
File System (EFS)</a>. EFS is the ability of the <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_402152c6-0a56-4c6c-be8a-a74cd413318d" data-linktype="relative-path">New Technology File System
(NTFS)</a> file system to encrypt files on disk in a manner that is transparent
to the user. For more information on EFS, see <a href="https://go.microsoft.com/fwlink/?LinkId=90185" data-linktype="external">[MSFT-EFS]</a>. For more
information about <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_86f79a17-c0be-4937-8660-0cf6ce5ddc1a" data-linktype="relative-path">NTFS</a>,
see <a href="https://go.microsoft.com/fwlink/?LinkId=90200" data-linktype="external">[MSFT-NTFS]</a>.</p><p>EFSRPC does not address how data is encrypted, how the
encrypted data is stored, or how it is accessed for routine operations such as
reading, writing, creating, and deleting. All these actions are specific to the
server implementation. On Windows, NTFS provides the storage mechanism (the
file is the unit of storage) and the Server Message Block (SMB) Protocol
provides remote access to such files. For more information about <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_09dbec39-5e75-4d9a-babf-1c9f1d499625" data-linktype="relative-path">SMB</a>, see <a href="../ms-smb/f210069c-7086-4dc2-885e-861d837df688" data-linktype="relative-path">[MS-SMB]</a>
and <a href="../ms-smb2/5606ad47-5ee0-437a-817e-70c366052962" data-linktype="relative-path">[MS-SMB2]</a>.</p><p>EFSRPC models the underlying data encryption architecture
using two basic constructs:</p><ul><li><p><span><span> 
</span></span>A set of data objects, each of which is encrypted independently and
can be managed independently.</p>
</li><li><p><span><span> 
</span></span>A set of access control subjects, each of which is represented by
a key pair generated by a <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_4cf96ca0-e3a9-4165-8d1a-a21b1397007a" data-linktype="relative-path">public
key</a> cryptographic algorithm. The public key of this key pair is embedded in
a <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_7a0f4b71-23ba-434f-b781-28053ed64879" data-linktype="relative-path">certificate</a> and can be
widely distributed in that form. The corresponding <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_6fca10f4-e829-42ab-ad40-1566585060ca" data-linktype="relative-path">private key</a> is held solely
by the user or users who represent that subject. Thus, a given access control
subject can correspond to one or more users, and a given user can possess the
private keys for zero or more access control subjects. Access control subjects
are further divided into two types:</p>
<ul><li><p><span><span>  </span></span>Unprivileged
user subjects, which are used for routine data access by ordinary users of the
system. For convenience, this specification refers to such subjects as user
certificate.</p>
</li><li><p><span><span>  </span></span><a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_c2d1bb54-31a8-4918-a163-39a7851c347a" data-linktype="relative-path">Data Recovery Agents (DRAs)</a>,
which are controlled by system administrators. The storage system ensures that
all active DRAs for the system are automatically authorized to access all
encrypted objects on the system. If an unprivileged user loses the private key,
an administrator can use a DRA&#39;s private key to recover the contents of
encrypted objects.</p>
</li></ul></li></ul><p>EFSRPC also assumes that each encrypted object is associated
with some security-related metadata, which contains information required for
authorized users and DRAs to access the <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_787ee6a8-5f01-4526-828a-d1b3de39c21a" data-linktype="relative-path">plaintext</a> of the object.
This specification refers to this security-related metadata as the <a href="3166cf4a-e085-47be-94c6-b69bddf274ff" data-linktype="relative-path">EFSRPC Metadata</a>.</p><p>EFSRPC does not specify how data is encrypted, stored, or
accessed. It is possible to build a compliant EFSRPC implementation that uses a
mechanism, such as <a href="230807ac-20be-494f-86e3-4c8ac23ea584#gt_9f92aa05-dd0a-45f2-88d6-89f1fb654395" data-linktype="relative-path">access
control lists (ACLs)</a>, instead of encryption to control access to data
objects. For the purposes of this specification, the term encrypted is used to
indicate that a data object and its metadata can be successfully manipulated
through the EFSRPC methods, with the exception of the <a href="0d599976-758c-4dbd-ac8c-c9db2a922d76" data-linktype="relative-path">EfsRpcEncryptFileSrv</a>
method, which converts data objects from an unencrypted state to an encrypted
state.</p><p>Within the preceding model, EFSRPC provides various
categories of management routines. The syntax of the individual methods and
rules for how these methods are processed on the server are specified in
section <a href="403c7ae0-1a3a-4e96-8efc-54e79a2cc451" data-linktype="relative-path">3.1.4.2</a>. The
categories of management routines that EFSRPC provides are as follows:</p><ul><li><p><span><span> 
</span></span>Requesting the server to convert objects from encrypted state to
unencrypted state and vice versa.</p>
<ul><li><p><span><span>  </span></span>EfsRpcEncryptFileSrv (section 3.1.4.2.5)</p>
</li><li><p><span><span>  </span></span><a href="043715de-caee-402a-a61b-921743337e78" data-linktype="relative-path">EfsRpcDecryptFileSrv (section 3.1.4.2.6)</a></p>
</li></ul></li><li><p><span><span> 
</span></span>Creating, querying, and manipulating the EFSRPC Metadata. Clients
use the following methods to query and change which user certificates can be
used to decrypt an encrypted object. The set of user certificates with access
to an object needs to be changed when the set of users with access to the
object changes or when a user with access to the object changes the user
certificate. The following methods can also be used to copy the access rights
from one object to another; the <a href="b39ec3e2-d3f0-4934-925e-74032365f9d2" data-linktype="relative-path">EfsRpcDuplicateEncryptionInfoFile</a>
method is particularly well-suited for this purpose. Methods:</p>
<ul><li><p><span><span>  </span></span><a href="a058dc6c-bb7e-491c-9143-a5cb1f7e7cea" data-linktype="relative-path">EfsRpcQueryUsersOnFile (section 3.1.4.2.7)</a></p>
</li><li><p><span><span>  </span></span><a href="cf759c00-1b90-4c33-9ace-f51c20149cea" data-linktype="relative-path">EfsRpcQueryRecoveryAgents (section 3.1.4.2.8)</a></p>
</li><li><p><span><span>  </span></span><a href="28609dad-5fa5-4af9-9382-18d40e3e9dec" data-linktype="relative-path">EfsRpcRemoveUsersFromFile (section 3.1.4.2.9)</a></p>
</li><li><p><span><span>  </span></span><a href="afd56d24-3732-4477-b5cf-44cc33848d85" data-linktype="relative-path">EfsRpcAddUsersToFile (section 3.1.4.2.10)</a></p>
</li><li><p><span><span>  </span></span><a href="6813bfa8-1538-4c5f-982a-ad58caff3c1c" data-linktype="relative-path">EfsRpcFileKeyInfo (section 3.1.4.2.12)</a></p>
</li><li><p><span><span>  </span></span>EfsRpcDuplicateEncryptionInfoFile (section 3.1.4.2.13)</p>
</li><li><p><span><span>  </span></span><a href="d36df703-edc9-4482-87b7-d05c7783d65e" data-linktype="relative-path">EfsRpcAddUsersToFileEx (section 3.1.4.2.14)</a></p>
</li><li><p><span><span>  </span></span><a href="d0da10ab-3139-4d67-a66c-ea6eb497118d" data-linktype="relative-path">EfsRpcFileKeyInfoEx (section 3.1.4.2.15)</a></p>
</li><li><p><span><span>  </span></span><a href="5cb4e26d-5632-4048-8b2d-f661f8e8ee6b" data-linktype="relative-path">EfsRpcGetEncryptedFileMetadata (section 3.1.4.2.16)</a></p>
</li><li><p><span><span>  </span></span><a href="38a5a7d3-4d47-4075-b830-b657805f2e94" data-linktype="relative-path">EfsRpcSetEncryptedFileMetadata (section 3.1.4.2.17)</a></p>
</li></ul></li><li><p><span><span> 
</span></span>Performing backup of encrypted objects in ciphertext form along
with their EFSRPC Metadata, and restoring encrypted objects from such backups. Depending
on the implementation of these methods, the backups that are created can expose
the implementation-specific EFSRPC Metadata format to the client. The Windows
implementation of these methods exposes the Windows EFSRPC Metadata format;
however, Windows applications do not manipulate this information. The following
methods are suitable for secure content archival or transferring encrypted data
securely between servers of the same implementation because they do not require
decrypting the data. Methods:</p>
<ul><li><p><span><span>  </span></span><a href="ccc4fb75-1c86-41d7-bbc4-b278ec13bfb8" data-linktype="relative-path">EfsRpcOpenFileRaw (section 3.1.4.2.1)</a></p>
</li><li><p><span><span>  </span></span><a href="a3a6d95f-ebd5-4a08-9d19-6b6c1b7d41f6" data-linktype="relative-path">EfsRpcReadFileRaw (section 3.1.4.2.2)</a></p>
</li><li><p><span><span>  </span></span><a href="b4fa10e8-31bb-4dd4-87af-1c4a3dedf417" data-linktype="relative-path">EfsRpcWriteFileRaw (section 3.1.4.2.3)</a></p>
</li><li><p><span><span>  </span></span><a href="c5da8aa7-fe38-4940-8d40-2cebbd887cba" data-linktype="relative-path">EfsRpcCloseRaw (section 3.1.4.2.4)</a></p>
</li></ul></li><li><p><span><span> 
</span></span>Controlling the server&#39;s encryption subsystem. Methods:</p>
<ul><li><p><span><span>  </span></span><a href="a7e37233-b684-4c3f-905b-81c2e04482f1" data-linktype="relative-path">EfsRpcFlushEfsCache (section 3.1.4.2.18)</a></p>
</li></ul></li></ul><p>Most of the EFSRPC routines are stateless and can be called
in any order. When one of these routines is called, the message exchange is as
follows.</p><p><img id="MS-EFSR_pict5ea2186e-5734-5873-8745-bc58e7c9e00a.png" src="ms-efsr_files/image001.png" alt="Message exchange for stateless routines" title="Message exchange for stateless routines" data-linktype="relative-path"/></p><p><b>Figure 1: Message exchange for stateless routines</b></p><p>There are two routines in EFSRPC that are an exception to
the stateless nature of the protocol. Several methods, collectively known as
the EFSRPC raw methods, are an exception and need to be called in a specific
order. This includes the EfsRpcOpenFileRaw, EfsRpcReadFileRaw,
EfsRpcWriteFileRaw, and EfsRpcCloseRaw methods. The following two sequences are
permissible.</p><p><img id="MS-EFSR_pict6ccfefc2-aa97-e96e-aed7-bd121ca89234.png" src="ms-efsr_files/image002.png" alt="Message sequence for opening a file" title="Message sequence for opening a file" data-linktype="relative-path"/></p><p><b>Figure 2: Message sequence for opening a file</b></p><p><img id="MS-EFSR_pict92d1a417-f9c2-153a-a700-4f790cbc0b23.png" src="ms-efsr_files/image003.png" alt="Message sequence for importing a file" title="Message sequence for importing a file" data-linktype="relative-path"/></p><p><b>Figure 3: Message sequence for importing a file</b></p></div>