EaseFilter Demo Project
|
EncryptionHandler.cs
Go to the documentation of this file.
80 public static bool EncryptFileWithEmbeddedPolicy(string fileName, string passPhrase, AESAccessPolicy policy, out string lastError)
102 ret = FilterAPI.AESEncryptFile(fileName, (uint)encryptionKey.Length, encryptionKey, (uint)iv.Length, iv, false);
105 lastError = "Encrypt file " + fileName + " failed with error:" + FilterAPI.GetLastErrorMessage();
126 policy.OffsetOfExcludeProcessNames = policy.OffsetOfIncludeProcessNames + policy.LengthOfIncludeProcessNames;
129 policy.OffsetOfIncludeUserNames = policy.OffsetOfExcludeProcessNames + policy.LengthOfExcludeProcessNames;
132 policy.OffsetOfExcludeUserNames = policy.OffsetOfIncludeUserNames + policy.LengthOfIncludeUserNames;
199 public static bool ConvertFileToFilterDriverAwareEncryptFile(string fileName, string passPhrase, out string lastError)
227 lastError = fileName + " is not valid share encrypted file, the sizeOfAESData:" + sizeOfAESData + " >= file size:" + fileSize;
237 //decrypt the embedded data, since the last 4 bytes is not encrypted, after decryption,need to write the clear size back.
241 //since the last 4 bytes for sizeOfAESData is not encrypted, we need to put back the clear value back.
250 lastError = fileName + " is not valid share encrypted file, the encryption key:" + verificationKey + " is not valid.";
281 public static bool EncryptFileAndEmbedExpireTime(string fileName, string passPhrase, DateTime expireTimeUtc, out string lastError)
297 ret = FilterAPI.AESEncryptFile(fileName, (uint)encryptionKey.Length, encryptionKey, (uint)iv.Length, iv, false);
300 lastError = "Encrypt file " + fileName + " failed with error:" + FilterAPI.GetLastErrorMessage();
329 public static bool ProcessEncryptedFile(string sourceFileName, string destFileName, out string lastError)
340 lastError = "ProcessEncryptedFile " + sourceFileName + ", destFileName " + destFileName + " failed with error:" + FilterAPI.GetLastErrorMessage();
350 lastError = "ProcessEncryptedFile " + sourceFileName + ", destFileName " + destFileName + " failed with error:" + ex.Message;
static bool ConvertFileToFilterDriverAwareEncryptFile(string fileName, string passPhrase, out string lastError)
Process the encrypted file's embedded access policy, remove embedded information, add AESTagData to e...
Definition: EncryptionHandler.cs:199
enum _AESFlags AESFlags
uint AESVerificationKey
Definition: EncryptionHandler.cs:41
static bool EncryptFileWithEmbeddedPolicy(string fileName, string passPhrase, AESAccessPolicy policy, out string lastError)
Create an encrypted file with embedded access control policy, distribute the encrypted file via inter...
Definition: EncryptionHandler.cs:80
uint OffsetOfIncludeProcessNames
Definition: EncryptionHandler.cs:50
static bool EncryptFileAndEmbedExpireTime(string fileName, string passPhrase, DateTime expireTimeUtc, out string lastError)
Definition: EncryptionHandler.cs:281
Definition: Utils.cs:26
uint OffsetOfIncludeUserNames
Definition: EncryptionHandler.cs:54
string ExcludeProcessNames
Definition: EncryptionHandler.cs:58
Definition: FilterAPI.h:57
static bool ProcessEncryptedFile(string sourceFileName, string destFileName, out string lastError)
Definition: EncryptionHandler.cs:329
string IncludeProcessNames
Definition: EncryptionHandler.cs:57
Definition: FilterAPI.h:53
Definition: FilterAPI.h:56
uint LengthOfExcludeUserNames
Definition: EncryptionHandler.cs:55
string ExcludeUserNames
Definition: EncryptionHandler.cs:60
uint OffsetOfExcludeProcessNames
Definition: EncryptionHandler.cs:52
uint LengthOfIncludeUserNames
Definition: EncryptionHandler.cs:53
uint OffsetOfExcludeUserNames
Definition: EncryptionHandler.cs:56
uint AccessFlags
Definition: EncryptionHandler.cs:47
Definition: FilterAPI.h:55
uint SizeOfAESData
Definition: EncryptionHandler.cs:61
long ExpireTime
Definition: EncryptionHandler.cs:46
static byte [] GetKeyByPassPhrase(string pwStr)
Generate 32 bytes key array by pass phrase string
Definition: Utils.cs:207
uint LengthOfExcludeProcessNames
Definition: EncryptionHandler.cs:51
Definition: FilterAPI.h:54
string IncludeUserNames
Definition: EncryptionHandler.cs:59
uint LengthOfIncludeProcessNames
Definition: EncryptionHandler.cs:49
Services Overview
Architect, implement and test file system filter drivers for a wide range of functionality. We can offer several levels of assistance to meet your specific.
Contact Us
You are welcome to contact us for salse or partnership.
Sales: sales@easefilter.com
Support: support@easefilter.com
Info: info@easefilter.com