# Data masking plugin functions
This feature was implemented in Percona Server for MySQL 8.0.17-8.
The Percona Data Masking plugin is a free and Open Source implementation of the
*MySQL*’s data masking plugin. Data Masking provides a set of functions to hide
sensitive data with modified content.
Data masking can have either of the characteristics:
* Generation of random data, such as an email address
* De-identify data by transforming the data to hide content
The data masking functions have the following categories:
* General purpose
* Special purpose
* Generating Random Data with Defined characteristics
* Using Dictionaries to Generate Random Data
## General purpose
The general purpose data masking functions are the following:
Parameter |
Description |
Returns |
gen_blacklist(str, dictionary_name, replacement_dictionary_name) |
Replaces a term with a term from a second dictionary. Deprecated in Percona Server for MySQL 8.0.34. |
A dictionary term |
gen_blocklist(str, dictionary_name, replacement_dictionary_name) |
Replaces a term with a term from a second dictionary. |
A dictionary term |
gen_dictionary(dictionary_name) |
Randomizes the dictionary terms |
A random term from the selected dictionary. |
gen_dictionary_drop(dictionary_name) |
Removes the selected dictionary from the dictionary registry. |
Either success or failure |
gen_dictionary_load(dictionary path, dictionary name) |
Loads a file into the dictionary registry and configures the dictionary name. The name can be used with any function. If the dictionary is edited, you must drop and then reload the dictionary to view the changes. |
Either success or failure |
### Example
An example of `gen_blocklist()`:
```{.bash data-prompt="mysql>"}
mysql> SELECT gen_blocklist('apple', 'fruit', 'nut');
```
??? example "Expected output"
```{.text .no-copy}
+-----------------------------------------+
| gen_blocklist('apple', 'fruit', 'nut') |
+-----------------------------------------+
| walnut |
+-----------------------------------------+
```
An example of `gen_dictionary()`:
```{.bash data-prompt="mysql>"}
mysql> SELECT gen_dictionary('trees');
```
??? example "Expected output"
```{.text .no-copy}
+--------------------------------------------------+
| gen_dictionary('trees') |
+--------------------------------------------------+
| Norway spruce |
+--------------------------------------------------+
```
An example of `gen_dictionary_drop()`:
```{.bash data-prompt="mysql>"}
mysql> SELECT gen_dictionary_drop('mytestdict')
```
??? example "Expected output"
```{.text .no-copy}
+-------------------------------------+
| gen_dictionary_drop('mytestdict') |
+-------------------------------------+
| Dictionary removed |
+-------------------------------------+
```
An example of `gen_dictionary_load(path, name)`:
```{.bash data-prompt="mysql>"}
mysql> SELECT gen_dictionary_load('/usr/local/mysql/dict-files/testdict', 'testdict');
```
??? example "Expected output"
```{.text .no-copy}
+-------------------------------------------------------------------------------+
| gen_dictionary_load('/usr/local/mysql/mysql/dict-files/testdict', 'testdict') |
+-------------------------------------------------------------------------------+
| Dictionary load successfully |
+-------------------------------------------------------------------------------+
```