Skip to content
IRI Logo
Solutions Products
  • Solutions
  • Products
  • Blog
  • BI
  • Big Data
  • DQ
  • ETL
  • IRI
    • IRI Business
    • IRI Workbench
  • Mask
  • MDM
    • Master Data Management
    • Metadata Management
  • Migrate
    • Data Migration
    • Sort Migration
  • Test Data
  • Transform
  • VLDB
  • VLOG
korean passport

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.

Data Profiling: Discovering Data Details
PCI Tokenization in FieldShield
generator korean kssn number security

Related articles

Masking RDB Data in the…
Find & Mask File PII…
Data Class & Rule Library…
Connecting MariaDB and MySQL to…
The IRI Platform
IRI Test Data Generation
IRI Data Governance
Pseudonym Hash Set (File) Creation…
Consistent, Self-Updating and Secure Pseudonymization
IRI Voracity and Test Design…
Creating Set Files in IRI…

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Big Data 66
  • Business Intelligence (BI) 77
  • Data Masking/Protection 163
  • Data Quality (DQ) 41
  • Data Transformation 94
  • ETL 122
  • IRI 229
    • IRI Business 86
    • IRI Workbench 162
  • MDM 37
    • Master Data Management 12
    • Metadata Management 25
  • Migration 65
    • Data Migration 60
    • Sort Migration 6
  • Test Data 102
  • VLDB 78
  • VLOG 40

Tracking

© 2025 Innovative Routines International (IRI), Inc., All Rights Reserved | Contact