IRI Blog Articles

Diving Deeper into Data Management

 

 

Generating Test NID Data: Korean Social Security Numbers

by Zachary McHenry

This article discusses the generation of computationally valid social security numbers for the purposes of testing applications specific to Korean business interests. If you are interested in US social security number test data generation, see this article. If you are interested in masking existing social security numbers for data privacy law compliance, see this article.


The Korean Social Security Number (KSSN) is similar to the United States Social Security Number (US SSN) in that it is used to identify a citizen in Korea. It contains 13 digits, and is in the following format:

BBBBBB-GRRRRSC

The first six characters of the KSSN comprise the recipient’s date of birth, while the seventh digit specifies gender. The next four numbers signify the region where the person was born. The 12th digit is a serial number based on the region and date of birth. The final character is a calculated check character used to validate the KSSN.

IRI has created new functions for its RowGen test data generation software product for those who wish to create valid or invalid KSSN values, and/or validate existing KSSN values.  Any number of records can be generated and sent to one or more output file or table targets in one or more (custom) formats, with or without other data fields. The other fields can either be randomly generated, or randomly selected from real data, to provide realism and privacy together.


Creating Valid KSSN Values

To create a computationally and structurally correct KSSN, the RowGen user can define a job script similar to this one:

/INFILE=RowGen_KSSN_valid.placeholder.in
   /ALIAS=RGKSSN
   /PROCESS=RANDOM
   /INCOLLECT=1   # Number of records to produce
   /FIELD=(NATID=natid_gen_korea("64/12/26", "M"), TYPE=ASCII, POSITION=1,
   SEPARATOR="\n")
/REPORT
/OUTFILE=stdout
   /PROCESS=RECORD
   /FIELD=(NATID, TYPE=ASCII, POSITION=1, SEPARATOR="\t")

The output from this routine is:

641226-3191835

Note:

  • FieldName is the desired name for the field.
  • BirthDate is a string that is surrounded by quotation marks, that signifies the specific birth date for the desired social security number in year, month, day format.
  • Gender is a string surrounded by quotation marks that consists of an M or F character to represent male or female.
  • These fields are optional, but if one is not present the others must not be present.
  • Without the parameters the routine will create a completely random, valid, Korean Social Security Number


Creating Invalid KSSN Values

If the user is interested in generating an invalid Korean SSN — for example, to protect people from identity fraud — then using a different control character would satisfy this need. A RowGen job script calling this function to create a properly formatted, but computationally incorrect Korean SSN might be:

/INFILE=RowGen_KSSN_valid.placeholder.in
   /ALIAS=RGKSSN
   /PROCESS=RANDOM
   /INCOLLECT=1    # Number of records to produce
   /FIELD=(NATID=natid_gen_invalid_korea("74/11/23", "F"), TYPE=ASCII, POSITION=1,
   SEPARATOR="\n")

The output from this routine is:

741123-2384775

Validating KSSN Values

If the user is interested in authenticating KSSN values — such as numbers which were generated through the previous scripts or if the user has a list of numbers to validate — then the RowGen job could look like this:

/INFILE=RowGen_KSSN_valid.placeholder.in
   /ALIAS=RGKSSN
   /PROCESS=RANDOM
   /INCOLLECT=1
   /FIELD=(NATID=natid_gen_korea("70/02/13", "F"), TYPE=ASCII, POSITION=1, SEPARATOR="\t")
   /FIELD=(Validate=natid_validate_korea(NATID), TYPE = ASCII, POSITION = 2, SEPARATOR="\t")
/REPORT
/OUTFILE=stdout
   /PROCESS=RECORD
   /FIELD=(NATID, TYPE=ASCII, POSITION=1,SEPARATOR="\n")
   /FIELD=(Validate, TYPE=ASCII, POSITION=2,SEPARATOR="\t")

The output from this routine is:

700213-2218801 Valid

The general specification:

/FIELD=(FieldName=natid_validate(KoreanSSN), TYPE=ASCII, POSITION=2, SEPARATOR=”\t”)

assumes:

  • FieldName is the desired name for the field.
  • KoreanSSN is a string that can be used from a previously generated number in the routine, a file, or a specific Korean SSN that the user is trying to test.

If you are interested in using either of these functions in RowGen, please contact your IRI representative.

Print Friendly

{ 0 comments… add one now }

Leave a Comment

Previous post:

Next post: