Logo
Data Masking Algorithm

Background #

Data masking algorithms are by the mask features. A variety of algorithms are built-in to make it easy for users to fully leverage the feature.

Parameters #

Hash Data Masking Algorithm #

MD5 Data Masking Algorithm #

Type: MD5

Attributes:

NameDataTypeDescription
saltStringSalt value (optional)

Mask Data Masking Algorithm #

Keep First N Last M Data Masking Algorithm #

Type: KEEP_FIRST_N_LAST_M

Attributes:

NameDataTypeDescription
first-nintfirst n substring
last-mintlast m substring
replace-charStringreplace char

Keep From X To Y Data Masking Algorithm #

Type: KEEP_FROM_X_TO_Y

Attributes:

NameDataTypeDescription
from-xintstart position (from 0)
to-yintend position (from 0)
replace-charStringreplace char

Mask First N Last M Data Masking Algorithm #

Type: MASK_FIRST_N_LAST_M

Attributes:

NameDataTypeDescription
first-nintfirst n substring
last-mintlast m substring
replace-charStringreplace char

Mask From X To Y Data Masking Algorithm #

Type: MASK_FROM_X_TO_Y

Attributes:

NameDataTypeDescription
from-xintstart position (from 0)
to-yintend position (from 0)
replace-charStringreplace char

Mask Before Special Chars Data Masking Algorithm #

Type: MASK_BEFORE_SPECIAL_CHARS

Attributes:

NameDataTypeDescription
special-charsStringSpecial chars (first appearance)
replace-charStringreplace char

Mask After Special Chars Data Masking Algorithm #

Type: MASK_AFTER_SPECIAL_CHARS

Attributes:

NameDataTypeDescription
special-charsStringSpecial chars (first appearance)
replace-charStringreplace char

Replace Data Masking Algorithm #

Personal Identity Number Random Replace Data Masking Algorithm #

Type: PERSONAL_IDENTITY_NUMBER_RANDOM_REPLACE

Attributes:

NameDataTypeDescription
alpha-two-country-area-codeStringalpha two country area code (Optional, default value: CN)

Military Identity Number Random Replace Data Masking Algorithm #

类型:MILITARY_IDENTITY_NUMBER_RANDOM_REPLACE

可配置属性:

NameDataTypeDescription
type-codesStringmilitary identity number type codes (separate with comma)

Telephone Random Replace Data Masking Algorithm #

Type: TELEPHONE_RANDOM_REPLACE

Attributes:

NameDataTypeDescription
network-numbersStringNetwork numbers (separate with comma)

Landline Number Random Replace Data Masking Algorithm #

Type: LANDLINE_NUMBER_RANDOM_REPLACE

Attributes:

NameDataTypeDescription
landline-numbersStringLandline numbers (separate with comma)

Operating Procedure #

  1. Configure maskAlgorithms in a mask rule.
  2. Use relevant algorithm types in maskAlgorithms.

Configuration Examples #

rules:
- !MASK
  tables:
    t_user:
      columns:
        password:
          maskAlgorithm: md5_mask
        email:
          maskAlgorithm: mask_before_special_chars_mask
        telephone:
          maskAlgorithm: keep_first_n_last_m_mask

  maskAlgorithms:
    md5_mask:
      type: MD5
    mask_before_special_chars_mask:
      type: MASK_BEFORE_SPECIAL_CHARS
      props:
        special-chars: '@'
        replace-char: '*'
    keep_first_n_last_m_mask:
      type: KEEP_FIRST_N_LAST_M
      props:
        first-n: 3
        last-m: 4
        replace-char: '*'