Transparent On Access File Encryption SDK

EaseFilter Transparent On Access File Encryption SDK 是通过 EaseFilter 加密过滤器驱动程序 (EEFD) 实现的。 EEFD 提供了全面的安全解决方案来开发透明的访问文件级加密产品。 EEFD 提供了透明地加密新创建的文件、在客户端定义的策略控制下授权或阻止访问加密/解密的解决方案。

Easefilter Encryption Filter Driver (EEFD)

EEFD 是文件系统文件级加密过滤驱动程序。 它拦截针对文件系统的 I/O 请求。 通过在请求到达其预期目标文件系统之前拦截该请求,筛选驱动程序可以加密或解密请求的原始目标提供的数据缓冲区。 尽管市场上有很多加密库,但开发可靠的透明访问文件加密产品仍然非常复杂。 EEFD是一个成熟的商业产品。 它为开发人员提供了完整的模块化框架,即使没有驱动程序开发经验,也可以在一天内构建按访问文件加密软件。

符合 FIPS 的加密

EEFD 利用 Microsoft CNG 加密库和 AES 算法。 AES 加密算法(也称为 Rijndael 算法)是美国国家标准与技术研究院 (NIST) 于 2001 年制定的电子数据加密规范。AES 是一种符合美国 FIPS 140-2 的对称分组密码算法 。 它的固定块大小为 128 位,密钥大小为 128、192 或 256 位。

每个进程的访问限制

EEFD 支持按进程访问文件加密的访问限制。 您可以设置加密文件的进程白名单或黑名单。 白名单进程可以读取加密文件以获得明文。 黑名单进程只能获取加密后的原始数据。 EEFD 利用隔离微型过滤器驱动程序技术来实现加密文件到进程的两个视图。 未经授权的进程将看到带有原始密文的加密数据视图。 授权进程将看到带有明文的解密数据视图。

嵌入 DRM 的加密文件头

EEFD 支持加密标头,并将自定义数字版权管理 (DRM) 数据嵌入到加密文件中。 通过自定义 DRM 数据,您可以定义自定义加密访问策略,它允许您动态地完全控制加密文件访问。 您可以随时授予、撤销或终止加密文件访问权限,即使在加密文件已发送出您的组织之后也是如此。 您可以开发安全应用程序以使用 EEFD 实施安全文件共享解决方案。

高性能加密

CNG 加密库支持 AES-NI(或英特尔高级加密标准新指令;AES-NI)。 借助硬件辅助支持,它利用硬件增强的加密技术,可以实现比其他方式更高的速度和/或更高的安全性。 EEFD 利用 AES 分组密码算法,它允许您以任何分组(16 字节)加密或解密加密文件。 您可以读取加密文件的随机块,而无需解密整个文件。 EEFD 将分组密码操作集成在同一读取或写入 IO 中,无需额外的 IO。 分组密码极大地提高了加密或解密性能。

EEFD 的用例
  1. 静态数据加密。
    静态加密可确保数据在磁盘上时经过加密,从而防止攻击者访问未加密的数据。
  2. 数据保护。
    文档加密,文件加密是数据保护非常重要的一步,只有授权的用户或进程才能读取加密的数据,或者会得到原始的加密数据。
  3. 防止数据丢失。
    为了防止数据泄露,您的数据始终被加密,即使您的数据丢失并在未经授权的地方被发现,它们也会受到保护,防止未经授权的访问。
  4. 使用 DRM 保护文件共享。
    通过嵌入加密标头的数字版权管理数据来加密您的文件,随时随地保护、跟踪和控制您的加密文件,即使文件被共享,您也可以随时向任何用户授予或撤销访问控制。
透明的按访问文件加密 C# 示例

下面是一个c# on access文件加密示例,演示如何使用SDK。 首先,您需要在计算机A中设置一个加密文件夹。您可以配置可以读取加密文件的授权进程和用户。 然后,如果您想将加密文件分发到B计算机,则可以在B计算机中设置解密文件夹。为了访问B计算机中的加密文件,您需要设置授权进程,只有授权进程才能访问加密文件 文件。

使用 EEFD 的自动加密代码片段

下面的代码片段演示了如何设置一个过滤规则来加密加密文件夹中的文件,以及如何设置另一个过滤规则来解密加密的文件。 只有授权的进程和用户才能读取加密文件,未授权的进程或用户将获得原始的加密数据:

  1. 设置一个自动加密文件夹,该文件夹中所有新创建的文件都会自动加密。 当白名单中的用户访问文件时,加密文件将自动解密。 黑名单中的用户访问该文件时不会被解密,而是得到原始的加密数据。
  2. 设置一个自动加密文件夹,该文件夹中所有新创建的文件都会自动加密,所有进程在读取加密文件时都会得到原始加密数据,这样您就可以安全地将这些文件上传或共享到云端。< /里>
  3. 设置加密on-go文件夹,该文件夹中的文件不加密,当黑名单中的用户访问文件时,文件会在内存中自动加密。 因此,如果您想安全地共享这些进程的文件,可以将这些进程添加到黑名单中。
using System;
using EaseFilter.FilterControl;

namespace AutoFileEncryption
{
class Program
{
static FilterControl filterControl = new FilterControl();

static void Main(string[] args)
{
string lastError = string.Empty;
string licenseKey = "Email us to request a trial key: info@easefilter.com";

FilterAPI.FilterType filterType = FilterAPI.FilterType.CONTROL_FILTER
| FilterAPI.FilterType.ENCRYPTION_FILTER | FilterAPI.FilterType.PROCESS_FILTER;
int serviceThreads = 5;
int connectionTimeOut = 10; //seconds

try
{
//copy the right Dlls to the current folder.
Utils.CopyOSPlatformDependentFiles(ref lastError);

if (!filterControl.StartFilter(filterType, serviceThreads, connectionTimeOut, licenseKey, ref lastError))
{
Console.WriteLine("Start Filter Service failed with error:" + lastError);
return;
}

//setup a file filter rule for folder encryptFolder
string encryptFolder = "c:\\encryptFolder\\*";
FileFilter fileFilter = new FileFilter(encryptFolder);

//enable the encryption for the filter rule.
fileFilter.EnableEncryption = true;

//get the 256bits encryption key with the passphrase
string passPhrase = "mypassword";
fileFilter.EncryptionKey = Utils.GetKeyByPassPhrase(passPhrase, 32);

//disable the decyrption right, read the raw encrypted data for all except the authorized processes or users.
fileFilter.EnableReadEncryptedData = false;

//setup the authorized processes to decrypt the encrypted files.
string authorizedProcessesForEncryptFolder = "notepad.exe;wordpad.exe";

string[] processNames = authorizedProcessesForEncryptFolder.Split(new char[] { ';' });
if (processNames.Length > 0)
{
foreach (string processName in processNames)
{
if (processName.Trim().Length > 0)
{
//authorized the process with the read encrypted data right.
fileFilter.ProcessNameAccessRightList.Add(processName, FilterAPI.ALLOW_MAX_RIGHT_ACCESS);
}
}
}

//setup the authorized users to decrypt the encrypted files.
string authorizedUsersForEncryptFolder = "domainName\\user1";

if (!string.IsNullOrEmpty(authorizedUsersForEncryptFolder) && !authorizedUsersForEncryptFolder.Equals("*"))
{
string[] userNames = authorizedUsersForEncryptFolder.Split(new char[] { ';' });
if (userNames.Length > 0)
{
foreach (string userName in userNames)
{
if (userName.Trim().Length > 0)
{
//authorized the user with the read encrypted data right.
fileFilter.userAccessRightList.Add(userName, FilterAPI.ALLOW_MAX_RIGHT_ACCESS);
}
}
}

if (fileFilter.userAccessRightList.Count > 0)
{
//set black list for all other users except the white list users.
uint accessFlag = FilterAPI.ALLOW_MAX_RIGHT_ACCESS & ~(uint)FilterAPI.AccessFlag.ALLOW_READ_ENCRYPTED_FILES;
//disable the decryption right, read the raw encrypted data for all except the authorized users.
fileFilter.userAccessRightList.Add("*", accessFlag);
}
}

//add the encryption file filter rule to the filter control
filterControl.AddFilter(fileFilter);

//setup a file filter rule for folder decryptFolder
string decryptFolder = "c:\\decryptFolder\\*";
FileFilter decryptFileFilter = new FileFilter(decryptFolder);

//enable the encryption for the filter rule.
decryptFileFilter.EnableEncryption = true;

//get the 256bits encryption key with the passphrase
decryptFileFilter.EncryptionKey = Utils.GetKeyByPassPhrase(passPhrase, 32);

//don't encrypt the new created file in the folder.
decryptFileFilter.EnableEncryptNewFile = false;

//disable the decyrption right, read the raw encrypted data for all except the authorized processes or users.
decryptFileFilter.EnableReadEncryptedData = false;

//setup authorized processes to decrypt the encrypted files.
string authorizedProcessesForDecryptFolder = "notepad.exe;wordpad.exe";

processNames = authorizedProcessesForDecryptFolder.Split(new char[] { ';' });
if (processNames.Length > 0)
{
foreach (string processName in processNames)
{
if (processName.Trim().Length > 0)
{
//authorized the process with the read encrypted data right.
decryptFileFilter.ProcessNameAccessRightList.Add(processName, FilterAPI.ALLOW_MAX_RIGHT_ACCESS);
}
}
}

filterControl.AddFilter(decryptFileFilter);

if (!filterControl.SendConfigSettingsToFilter(ref lastError))
{
Console.WriteLine("SendConfigSettingsToFilter failed." + lastError);
return;
}

Console.WriteLine("Start filter service succeeded.");

// Wait for the user to quit the program.
Console.WriteLine("Press 'q' to quit the sample.");
while (Console.Read() != 'q') ;

filterControl.StopFilter();

}
catch (Exception ex)
{
Console.WriteLine("Start filter service failed with error:" + ex.Message);
}

}

}
}
京公网安备 号    |    备案号:京ICP备09015132号-1024