Navigation: Masks Reference >

Randomize Mask

 

 

 

Randomize Mask

The Randomize mask replaces alphanumeric characters with randomized alphanumeric characters.

It will only replace alphabetic characters with random alphabetic characters (always preserving case) and numeric digits with random numeric digits.

All other characters (eg. spaces, special symbols, etc) are preserved.

This mask is primarily intended to work with text data types. Decimal numeric types can also be masked although care should be taken if distinct values are required as discussed for the "Distinct" parameter below.

This mask is particularly useful for fields that may contain sensitive information and you want to preserve as many lexical characteristics as possible. For example, you want to ensure that the masked value is exactly the same length as the original value and that the case is preserved. Also, you want to be sure that the punctuation, white space, etc appears exactly as it did in the original. This may help add to the degree of confidence in an application being tested because specific field characteristics, such as the actual lengths or appearance of special characters of the original data shall be replicated in the masked data.

The potential disadvantage is that fields which ordinarily consist of obvious patterns, such as sentences in a client's notes, will appear as gibberish text. For example, "Client 2441234, called today." could be masked with something like "Rsoewn 8710283, iausjk mjhdd.".

 

 

Randomize

Alphabetic characters

If this box is selected then original alphabetic characters shall be replaced with random alphabetic characters. Case is always preserved.

If this box is not selected then all alphabetic characters shall be preserved.

 

Numeric characters

If this box is selected then each original numeric digit shall be replaced with a random numeric digit.

If this box is not selected then all numeric digits shall be preserved.

For masking fields that represent numbers, consider using the Random Number mask.

 

Deterministic Distinctness

This section shall only be enabled if the mask is configured for deterministic mode otherwise it shall be disabled and the settings shall be ignored at runtime.

Generate distinct masked values when in deterministic mode for distinct original values (no collisions):

Select this box if all instances of a distinct original value are to be masked with the same distinct masked value. i.e. a one-to-one relationship for original-to-masked values.

Example:

If this box is selected and the input value is 'Daytime' and the masked value is 'Kwucomp', then the masked value of 'Kwucomp' shall be generated for only the input value 'Daytime'.

If this box is not selected then it is possible that multiple different input values could produce the same masked value of 'Kwucomp'.

Note: If you want the same set of masked values generated for the same set of original values on every masking run then you must ensure that Deterministic mode is used.

 

This field represents an integer and can be up to N digits wide

The Randomize mask generates distinct values for all possible values of a given character length. However, leading zeros in numbers are not significant and therefore although the Randomize mask shall produce distinct textual results, it could result in duplicates (collisions) when converted to numeric types due to the non-significance of leading zeroes.

For example:

Original numeric value = 1      -->  Input to Randomize = "1"      -->  Masked value = "5"      -->  Converted back to numeric = 5    
 Original numeric value = 368  -->  Input to Randomize = "368"  -->  Masked value = "005"  -->  Converted back to numeric = 5

Note that as far as character data is concerned, "005" is distinct to "5"; however, when converted back to numeric they shall both be 5 and therefore a collision would occur.

Therefore, this parameter effectively specifies a fixed width for which all numeric values shall be zero-padded on the left as text input to the Randomize function. In the above example, if this parameter was specified as 4 digits wide then:    

Original numeric value = 1      -->  Input to Randomize = "0001"  -->  Masked value = "0359"  -->  Converted back to numeric = 359    
 Original numeric value = 368  -->  Input to Randomize = "0368"  -->  Masked value = "8276"  -->  Converted back to numeric = 8276

Note that this means that the Randomize mask shall effectively generate values in the range from 0 to (10**n)-1 which in this example would be 0 to 9999 inclusive.

For masking fields that represent numbers, consider using the Random Number mask.

 

Masking Range

This panel allows you to specify a partial range of an original value to be selected for masking. The default, as shown in the mask above, shall select the entire value.

See the example below for a screen capture that shows a partial masking range selection.
  

Select Range

This defines what part of each value shall be selected for masking (subject further to the First and Last parameters below). Everything outside of this range shall be preserved.

Entire Field - The entire value is selected.

Before Substring - Only that part of the value from the appears before the specified substring in the value shall be selected for masking. The substring and remainder of the value shall be preserved.

After Substring - Only that part of the value from the appears after the specified substring in the value shall be selected for masking. The substring and part of the value that appears before the substring shall be preserved.
   

Substring

The substring that shall be considered the delimiter of the masking range.

Every character in this field is significant including quotes and spaces. Therefore, unless you want to search the field for a quotes and spaces do not include them in this field.

 

Preserve or Mask

If Preserve is selected from the combo box then the First and Last parameters shall describe how many characters from the original value shall be preserved in the masked value.

If Mask is selected from the combo box then the First and Last parameters shall describe how many characters in the original value shall be masked. All other characters shall be preserved.

First

This specifies how many of the first count of characters of the specified character unit shall be preserved or masked.

The character unit combo box offers the selection:

All                    - Every character is counted, including non-alphanumerics. ie. This yields a fixed offset.
 Alphabetic        - Only alphabetic characters are counted
 Numeric           - Only numeric characters are counted
 AlphaNumeric   - Only alphanumeric characters are counted

Example:

Suppose you have a telephone number field that contains a 3 digit area code followed by some other digits and formatting. However, the formatting is variable, such as in the following sample data:
    604-123-1234
    (415) 123-1234

Therefore, if you wanted to preserve the area codes and mask the remaining digits while preserving the original formatting, you could specify the Randomize parameters: Preserve, First 3 Numeric, which could yield masked values something like:
     604-817-9553
     (415) 261-8971

Last

This specifies how many of the last count of characters of the specified character unit shall be preserved or masked.

 

 Example

Suppose that you wanted to mask only that part of email addresses before the '@' character. This would automatically preserve the domain names because they appear outside of this range.

Furthermore, suppose that you wanted to preserve the first 2 characters and last 1 character of this selected masking range. You probably wouldn't really want to preserve these 3 characters; it's being done in this example for illustrative purposes only.

The following settings would achieve this result:

Here is the corresponding sample output:

Consider the first line in the sample output above. First, the masking range in selected. This is the substring before the first occurrence, from the left, of the '@' character. Therefore, the range selected is 'Roseann.Cheek'. Next, we specified that the first 2 characters and the last 1 character of this range are to be preserved. The remainder of the range shall be masked. Therefore the masked result of the selected range is 'Rolcecr.Bhsvk' (the preserved characters are shown in bold). The full masked result for this field is 'Rolcecr.Bhsvk@ourtestdomain.com'.

 

Determinism

If you want the masked results to be the same for each run on the same input then all settings for this mask must remain the same for each run.

The Randomize mask is always case-sensitive so that is why the 'Ignore case of original string' option does not appear in this mask's Determinism tab.

 

  

 

 

 

Copyright © 2019-2021 DataVeil Technologies Pty Ltd