Saturday, August 23, 2008

Validating Social Security Numbers

Validating Social Security Numbers should not be difficult. The Social Security Administration has taken a lot of heat for exposing people's SSNs over the years. The Social Security Number Verification Service appears to be open to corporations and businesses. I'm not sure how hard it would be for a crook posing as a small businessman to get authorization in order to validate stolen SSNs. One can find a breakdown of the Social Security Number here, though I've used CPSR's SSN Structure FAQ before. I knocked out a quick bash script in an hour or two:



while [ true ] ;
echo "Enter a Social Security Number [nnn-nn-nnnn] or Ctrl-C quit:"
read SSN

AREANUM=` echo $SSN | awk -F- '{ print $1 }'`
if [ $SSN = "123-45-6789" ] || [ $AREANUM = "000" ] || [ $AREANUM -gt 799 ] ; then
echo "Invalid SSN!"
printf "\n"
echo "$SSN appears to be valid. Check the Death list"
printf "\n"

It took me so long, because my skills have atrophied from lack of use. The script didn't even need a regex such as \d{3}\-\d{2}\-\d{3} since a valid input format was specified. I could have done more error checking, but for a quick and dirty bash script it's not bad.

The sad part about all of this is that the expensive application my firm bought isn't smart enough to screen out SSNs such as 123-45-6789, or any thing with an area number (the first three digits) equal to 000 or above 799. It will trigger on any nine digit sequence. I emailed the script to some colleagues. I doubt the system admins can write a filter mimicing what my script does. They ought to be able to, but from what I've been told the filter scripting language is poorly designed. The Death List is a list of SSN owners who have died. The Social Security Administration updates the list regularly. I wonder how many dead people will be voting this November?


Hi John

I've heard that in the US Republican entities (eg. Jeb Bush and Co in the past) often organise the vote counting (down to actualy designing the computers and counting procedures).

Therefore, I dare say the number of dead Democrats voting will be far exceeded by the number of dead Republicans ;)

Post a Comment

Links to this post:

Create a Link

<< Home

This page is powered by Blogger. Isn't yours?