Skip to main content

Data Masking Document with eBA Plus AI

This document explains how data masking with AI works in eBA Plus, use cases and arguments.

Configuration

Before starting data masking operations with AI in eBA Plus, the 'AI' breakdown should be added in the eBA Configuration Editor and the following values should be entered into it.

  • Enable: true
  • Address: https://ai.synergynow.io/
  • TenantId: The tenantId value of the relevant customer.
  • Token: The value of the token belonging to the respective customer.

The Enable parameter is used to turn on and off all AI processes within eBA Plus. 'true'/'false' Values.

The Address parameter is the parameter that specifies which service the AI processes will use in eBA Plus.

The TenantId parameter is the parameter that specifies the customer using the AI service in eBA Plus.

The Token parameter is the token value required for the customer to use the AI service in eBA Plus.

Empowerment

In order for users to use AI operations in eBA Plus, sysAI authorization must be defined for the relevant organizational unit from the eBA System Manager or Organization menu in the web interface.

When data masking operations are used on the process or external applications, the user using the relevant process/external application must also have sysAI authorization.

Before You Begin

The 'path' parameter in the methods that provide data masking operations with AI in eBA Plus supports all path structures in the eBA Plus DM structure. In other words, we can use DM to mask a file, file content, a document in the files object in the form, or a specific version of the file.

Data masking operations with AI can only be performed for '.pdf', '.doc' and '*.docx' formats. In other formats, methods are likely to fail.

In addition, the enum types required for the use of the methods are as follows.

DataCategories 'enum'

'''csharp public enum DataCategories { Unknown, FullName, Address, Email, NationalIdNumber, TaxNumber, SocialSecurityNumber, CreditCardNumber, Iban, BankAccountNumber, InstitutionName, Country, City, IPAddress, Date, InvoiceNumber, Website, Salary, Amount, BankName }


These are the category types that specify which categories will be captured or masked in the methods.

### DataMaskingActionTypes 'enum'
'''csharp
public enum DataMaskingActionTypes
{
ShowOnlyFirstCharacters,
Change,
Hide,
RestrictedShow
}

These are the values that specify how to mask the value captured in the CreateMaskedData and CreateMaskedDocument methods. When the value of ShowOnlyFirstCharacters, Hide or RestrictedShow** is selected, there<MaskedDataOption> is no need to give the 'ActionValue' value in the 'List maskedDataOptions' parameter of the two methods mentioned.

  • ShowOnlyFirstCharacters: Ensures that only the first character of the captured value is visible.
  • Change: Allows the captured value to be replaced with the 'ActionValue' value.
  • Hide: Ensures that the captured value is hidden.
  • RestrictedShow: Ensures that the captured value is displayed in different formats in a protected manner. When this option is selected, the value 'RestrictedShowOptions' must be sent full.

DataRestrictedShowOptions 'enum'

'''csharp public enum DataRestrictedShowOptions { ShowFirstXCharacters, ShowLastXCharacters, ShowFirstLastXCharacters, HideFirstXCharacters, HideLastXCharacters, HideFirstLastXCharacters, ShowYear, HideYear, ShowMonth, HideMonth, ShowDay, HideDay, ShowHour, HideHour, ShowMinute, HideMinute, ShowSecond, HideSecond, HideCurrency is based on HideAmount }


These```<```MaskedDataOption```>``` are the values to be used in the 'RestrictedShowOptions' value in the 'List maskedDataOptions' parameter used in the CreateMaskedData** and **CreateMaskedDocument** methods.

## Methods
In eBA Plus, data masking operations with AI are provided by 3 methods in **eBAPI.dll**.

- **ExtractDataCategories**
- **CreateMaskedData**
- **CreateMaskedDocument**

### ExtractDataCategories
This method finds and returns the data that needs to be masked in the given document.

#### Parameters
***path** ('string'): The document path where the data to be masked will be found.
* **dataCategories** ('List```<```DataCategories```>```'): This parameter is defined as 'null' by default, it is not mandatory. If 'null' is passed as or a value is not given, it returns all the data that needs to be masked in the document. If the parameter is populated, it returns only the data that fits the given categories and needs to be masked.

#### Output Value
* **DMDataCategoryCollection**: This object has been implemented from the 'IEnumerable```<```DMDataCategory```>```' interface. Each object in it is of the 'DMDataCategory' type, and the properties of this type are as follows.
* **Category** ('int'): Specifies which category the captured data belongs to, 'DataCategories' returns the 'int' equivalent of the enum type.
* **Value** ('string'): Fetches the captured data.
* **ConfidenceScore** ('float'): Indicates the security of the match.
* **LongText** ('string'): The sentence in which the captured value is located.
* **Format** ('string'): Specifies if the captured value fits a format, for example, it can capture date-time information and write dd:MM:yyyy.

#### Use Case
'''csharp
using eBAPI;
using eBAPI.Connection;
using eBAPI.DocumentManagement;

public void ExtractDataCategories()
{
eBAConnection con = CreateServerConnection();
con. Open();

DMDataCategoryCollection categories = con. FileSystem.ExtractDataCategories("AI/biography_document.pdf", new List```<```DataCategories```>``` { DataCategories.FullName, DataCategories.Email, DataCategories.NationalIdNumber, DataCategories.City });
for (int i = 0; i ```<``` categories. Count; i++)
{
DMDataCategory caughtValue = categories[i];
int category = caughtValue.Category;
string value = caughtValue.Value;
float confidenceScore = caughtValue.ConfidenceScore;
string longText = caughtValue.LongText;
string format = caughtValue.Format;
}

con. close();
}

CreateMaskedData

This method finds the data that needs to be masked in the given document and returns the values it finds both in the sentence and by masking the value.

Parameters

*path ('string'): The document path where the data to be masked will be found.

  • maskedDataOptions ('List<MaskedDataOption>'): This is the parameter where the settings are made for which categories will be masked and how. The properties of the 'maskedDataOption' type are as follows. *Category ('DataCategories'): Specifies which category to capture, 'DataCategories' is of enum type.
    • ActionType ('DataMaskingActionTypes'): Specifies how to take action when the specified Category value is captured, 'DataMaskingActionTypes' is of enum type.
    • ActionValue ('string'): A parameter that specifies which value should be replaced when the ActionType value is selected as Change.
    • RestrictedShowOptions ('Dictionary<DataRestrictedShowOptions, int> '): This is the parameter where protected view formats are specified when the ActionType value is selected as RestrictedShow. The Key value of each mapping in the dictionary is of the 'DataRestrictedShowOptions' enum type, and the Value value is of the 'int' type. The key value corresponds to the protection format, and the value value corresponds to the X character in this protection format.

Output Value

  • DMMaskedDataCategoryCollection: This object is implemented from the 'IEnumerable<DMMaskedDataCategory>' interface. Each object in it is of the 'DMMaskedDataCategory' type, and the properties of this type are as follows.
    • Category ('int'): Specifies which category the captured data belongs to, 'DataCategories' returns the 'int' equivalent of the enum type.
    • Value ('string'): Fetches the captured data.
    • ConfidenceScore ('float'): Indicates the security of the match.
    • Format ('string'): Specifies if the captured value fits a format, for example, it can capture date-time information and write dd:MM:yyyy.
    • MaskedText ('string'): The captured value is masked against the specified ActionType.
    • MaskedValue ('string'): The masked sentence in which the captured value is contained relative to the specified ActionType.
    • OriginalText ('string'): The sentence in which the captured value is located.

Use Case

'''csharp using eBAPI; using eBAPI.Connection; using eBAPI.DocumentManagement;

List<MaskedDataOption> showOptions = new List<MaskedDataOption> { new MaskedDataOption { Category = DataCategories.FullName, ActionType = DataMaskingActionTypes.RestrictedShow, ActionValue = null, RestrictedShowOptions = new Dictionary<DataRestrictedShowOptions, int> { { DataRestrictedShowOptions.ShowFirstXCharacters, 3 } } }, new MaskedDataOption { Category = DataCategories.InstitutionName, ActionType = DataMaskingActionTypes.Change, ActionValue = "[Secret]", RestrictedShowOptions = null }, new MaskedDataOption { Category = DataCategories.Email, ActionType = DataMaskingActionTypes.Hide, ActionValue = null, RestrictedShowOptions = null }, new MaskedDataOption { Category = DataCategories.Address, ActionType = DataMaskingActionTypes.ShowOnlyFirstCharacters, ActionValue = null, RestrictedShowOptions = null } };

public void CreateMaskedData() { eBAConnection con = CreateServerConnection(); con. Open();

DMMaskedDataCategoryCollection categories = con. FileSystem.CreateMaskedData("AI/biography_document.pdf", showOptions); for (int i = 0; i < categories. Count; i++) { DMDataCategory caughtValue = categories[i]; int category = caughtValue.Category; string value = caughtValue.Value; float confidenceScore = caughtValue.ConfidenceScore; string longText = caughtValue.LongText; string format = caughtValue.Format; string maskedText = caughtValue.MaskedText; string maskedValue = caughtValue.MaskedValue; string originalText = caughtValue.OriginalText; }

con. close(); }


### CreateMaskedDocument
This method finds the data that needs to be masked in the given document and creates the masked version of the document on the DM by masking the values it finds.

#### Parameters
***path** ('string'): The document path where the data to be masked will be found.
* **maskedDataOptions** ('List```<```MaskedDataOption```>```'): This is the parameter where the settings are made for which categories will be masked and how. The properties of the 'maskedDataOption' type are as follows.
***Category** ('DataCategories'): Specifies which category to capture, 'DataCategories' is of enum type.
* **ActionType** ('DataMaskingActionTypes'): Specifies how to take action when the specified **Category** value is captured, 'DataMaskingActionTypes' is of enum type.
* **ActionValue** ('string'): A parameter that specifies which value should be replaced when the **ActionType** value is selected as **Change**.
* **RestrictedShowOptions** ('Dictionary```<```DataRestrictedShowOptions, int```>``` '): This is the parameter where protected view formats are specified when the ActionType value is selected as **RestrictedShow**. The Key value of each mapping in the dictionary is of the 'DataRestrictedShowOptions' enum type, and the Value value is of the 'int' type.
The key value corresponds to the protection format, and the value value corresponds to the X character in this protection format.
***destination** ('string'): This parameter is defined as 'null' by default, it is not mandatory. If 'null' is passed or a value is not given, the new document created is created by adding the value **[MASKED]** to the beginning of the file name in the position in the **path** parameter. For example **'[MASKED] Biography Document.pdf'**. If it is to be sent full, it must have a valid DM path and include the document name. For example, **'Masked Documents/2025/Ali Doğru.pdf'**

#### Output Value
* **DMFile**: Keeps the masked document in **eBAPI.dll**.

#### Use Case
'''csharp
using eBAPI;
using eBAPI.Connection;
using eBAPI.DocumentManagement;

List```<```MaskedDataOption```>``` showOptions = new List```<```MaskedDataOption```>```
{
new MaskedDataOption
{
Category = DataCategories.BankAccountNumber,
ActionType = DataMaskingActionTypes.RestrictedShow,
ActionValue = null,
RestrictedShowOptions = new Dictionary```<```DataRestrictedShowOptions, int```>```
{
{ DataRestrictedShowOptions.HideFirstLastXCharacters, 3 }
}
},
new MaskedDataOption
{
Category = DataCategories.Website,
ActionType = DataMaskingActionTypes.Change,
ActionValue = "[WEBSITE]",
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.Email,
ActionType = DataMaskingActionTypes.Hide,
ActionValue = null,
RestrictedShowOptions = null
},
new MaskedDataOption
{
Category = DataCategories.InvoiceNumber,
ActionType = DataMaskingActionTypes.ShowOnlyFirstCharacters,
ActionValue = null,
RestrictedShowOptions = null
}
};

public void CreateMaskedDocument()
{
eBAConnection con = CreateServerConnection();
con. Open()

DMFile file = con. FileSystem.CreateMaskedDocument("AI/biography_document.docx", showOptions);

con. close();
}