Using MySQL Enterprise Data Masking and De-Identification Payment card Primary Account Number masking.   Masking functions provide strict and relaxed masking of Primary Account Numbers. mysql>  SELECT mask_pan(gen_rnd_pan()); +-------------------------+ | mask_pan(gen_rnd_pan()) | +-------------------------+ | XXXXXXXXXXXX2461 | +-------------------------+ mysql>  SELECT mask_pan_relaxed(gen_rnd_pan()); +---------------------------------+ | mask_pan_relaxed(gen_rnd_pan()) | +---------------------------------+ | 770630XXXXXX0807 | +---------------------------------+ mysql>  SELECT mask_ssn(gen_rnd_ssn()); +-------------------------+ | mask_ssn(gen_rnd_ssn()) | +-------------------------+ | XXX-XX-1723 | +-------------------------+ US Social Security number masking.  mask_ssn()  masks all but the last four digits of the number: • mask_pan_relaxed()  is similar but does not mask the first six digits that indicate the payment card issuer unmasked: • mask_pan()  masks all but the last four digits of the number: Generating Random Data with Specific Characteristics Several functions generate random values. These values can be used for testing, simulation, and so forth. gen_range()  returns a random integer selected from a given range: gen_rnd_email()  returns a random email address in the  example.com  domain: gen_rnd_pan()  returns a random payment card Primary Account Number: (The  gen_rnd_pan()  function result is not shown because its return values should be used only for testing purposes, and not for publication. It cannot be guaranteed the number is not assigned to a legitimate payment account.) gen_rnd_ssn()  returns a random US Social Security number with the first and second parts each chosen from a range not used for legitimate numbers: 1579 mysql>  SELECT gen_rnd_pan(); mysql>  SELECT gen_rnd_email(); +---------------------------+ | gen_rnd_email() | +---------------------------+ | ayxnq.xmkpvvy@example.com | +---------------------------+ mysql>  SELECT gen_range(1, 10); +------------------+ | gen_range(1, 10) | +------------------+ | 6 | +------------------+