# AI Context for Ssn Generator Coding

## Profile
- Name: Ssn Generator Coding
- Location: United States
- About me: \# SSNPad.py \- creates a SSN scratch pad.  This is used to map one SSN value to 
\# a random replacement value.  Useful to protect a SSN number while preserving
\# the format of the data.  Reasonably secure if the scratch pad is kept secure.

\# This script creates a text file with the following structure:
\# XXXXXXXXX\|YYYYYYYYY
\# where XXXXXXXXX is the source SSN and 
\# YYYYYYYYY is a psuedo\(semi\)\-random alternate SSN

\# Sample:

\# SSN numbers are composed of three parts:
\# AAA\-GG\-IIII
\# AAA \= The Area \(used to map to a state, doesn't anymore\)
\# GG \= Group 01\-99
\# IIII a zero padded number between 0001\-9999

\# This process takes a specific source Area and Group \(i.e. 123\-45\) and maps it
\# to a randomly chosen different replacement Area and Group \(i.e. 763\-22\) and 
\# then generates a random replacement ID for each source ID.

\# A sample of the output:  
\# 001010001\|686075132
\# 001010002\|686074919
\# 001010003\|686077114
\# 001010004\|686078786

import random
from itertools import product

f \= open\("SSNList.txt",'w\+'\)

master\_groups \= list\(product\(range\(1, 899 \+ 1\), range\(1, 99\+1\)\)\)
area\_groups \= list\(master\_groups\)

for \(area, group\) in master\_groups:
	area\_group \= random.choice\(area\_groups\)
	id\_list \= range\(1, 9999 \+ 1\)
	for n in range\(1, 9999 \+ 1\):
		leftSSN \= "\{0:0&gt;3\}\{1:0&gt;2\}\{2:0&gt;4\}".format\(area, group, n\)

		random\_id \= random.choice\(id\_list\)

		rightSSN \= '\{0:0&gt;3\}\{1:0&gt;2\}\{2:0&gt;4\}'.format\(
			area\_group\[0\], area\_group\[1\], random\_id\)

		id\_list.remove\(random\_id\)

		f.write\('\{0\}\|\{1\}n'.format\(leftSSN,rightSSN\)\)
	area\_groups.remove\(area\_group\)

f.close\(\)

## Online Presence
\[Gravatar Profile\]: [gravatar.com/ssngeneratororg](https://gravatar.com/ssngeneratororg)