> For the complete documentation index, see [llms.txt](https://docs.guardware.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.guardware.com/protect/encryption-and-policies/encrypt-by-data-type.md).

# Encrypt by Data Type

A Data Type defines the type of information GuardWare recognises as sensitive, such as personal details, financial data, or confidential business information. For details on Data Type, see [here](/data-governance/data-governance/data-type.md).&#x20;

PROTECT automatically encrypts files when their contents match a configured Data Type. Data Types identify sensitive information using:

* Sensitive Words
* Regular Expressions
* Filename Expressions

When a match is detected, PROTECT encrypts the file and applies the classification assigned to the Data Type.

You must [assign Security Groups to each Data Type](#assign-security-group-to-a-data-type) to control who can access or decrypt the files that match that Data Type.

### **1. Sensitive Words**

GuardWare scans files for pre-defined sensitive keywords or phrases. If any of the words or phrases are detected, PROTECT automatically encrypts the file.\
Example:

1. Data Type: Payroll Documents
2. Data Identifier: Sensitive Words
3. Phrases: PAYSTUB\
   In this example, if PROTECT finds the word PAYSTUB in any file, the file is automatically encrypted.

### **2. Regular Expression**

Regular expressions are used to detect structured data patterns such as credit card numbers or identification numbers. If PROTECT finds a matching pattern, it automatically encrypts the file.

Example:

1. Data Type: Card Number Regex
2. Data Identifier: Regular Expression
3. Expression: (?:\d\[ -]\*?){13,19}\
   In this example, if a file contains a number that matches this pattern, PROTECT encrypts it.

### **3. Filename Expression**

PROTECT can automatically encrypt files based on their folder paths or file-name patterns. These expressions can include:

1. **Folder expression**: Encrypt files stored in a specific directory or path.
2. **File expression**: Encrypt files that match certain naming patterns, regardless of where they are saved.

When a user creates, moves, or saves a file that matches any defined Filename Expression, PROTECT applies encryption even if the file content does not contain sensitive words or detection patterns.

**Examples**:

1. Folder expression:\
   `*\Desktop*\Confidential*` \
   `*\Desktop\Confidential*`   \
   `\192.168.0.5\Public\PROTECT\Confidential*`\
   In this example, any file stored in or moved to a folder path containing the word “Confidential”, whether on a local desktop or network location, will be automatically encrypted by PROTECT.&#x20;
2. File expression:\
   `*_salary.xlsx`\
   In this example, any file that ends with “\_salary.xlsx”, no matter where it is saved, will be automatically encrypted.

### Select Data Types

Select the Data Types that PROTECT should use to identify sensitive information. Only selected Data Types are available for Security Group assignment and automatic file protection.

1. Go to **PROTECT > Encrypt by Data Type** and click **Add Data Types**.
2. In the available Data Types list, select the Data Types you want PROTECT to monitor and click **Add Selected Data Type**.<br>

   <figure><img src="/files/Uh6h1GfmQtHE6DASIndN" alt=""><figcaption></figcaption></figure>

The selected Data Types will appear on the list with status **Enabled**. You can then assign one or more Security Groups to control access to files that match that Data Type.

### Assign Security Group to a Data Type

1. Go to **PROTECT > Encrypt by Data Type**. You’ll see a list of Data Types (both pre-defined and custom).
2. Search for the Data Type you want to assign. **Enable** the data type from the **STATUS** column if it is disabled. You’ll only be able to assign Security Groups once the Data Type is enabled.&#x20;
3. For **Filename Expression**, select **Encrypt** or **Decrypt** in **Folder Rule.**
   * Select **Encrypt** to automatically encrypt all files that match the specified filename expression when they are moved to the designated folder.
   * Select **Decrypt** to automatically decrypt all files that match the specified filename expression when they are moved to the designated folder.<br>

     <figure><img src="/files/LIaFGQdmCIQslmIwj5w9" alt=""><figcaption></figcaption></figure>
4. Click **+Assign Security Group** in the **ACTIONS** column.\
   &#x20;

   <figure><img src="/files/45rVJMmOubg7ZwrsN5iB" alt=""><figcaption></figcaption></figure>
5. Select the Security Groups you want to assign and click **Assign Security Group**. Only the assigned Security Group members can access the protected files.\
   &#x20;

   <figure><img src="/files/9613aed3999f7a96f709afe2d562927be41b8cb8" alt=""><figcaption></figcaption></figure>

### Assign Data Type to a Security Group

1. Go to **PROTECT > Encrypt by Data Type**. You’ll see a list of pre-defined Data Types.
2. Select the **Security Groups** tab.
3. Search for the Security Group you want to assign and click **+Assign Data Types** in the **ACTIONS** column. \
   &#x20;

   <figure><img src="/files/MPoPGnTHWI8W8OOlg0Hq" alt=""><figcaption></figcaption></figure>
4. Select the Data Types you want to assign and click **Assign Data Types**. Only the assigned Security Group members can access the protected files.<br>

   <figure><img src="/files/e698322904a21b0c081fe9898da34baf5d39d1a1" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.guardware.com/protect/encryption-and-policies/encrypt-by-data-type.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
