[Tutor] Randomize SSN value in field

Kent Johnson kent37 at tds.net
Thu May 22 19:39:04 CEST 2008


On Thu, May 22, 2008 at 12:14 PM, GTXY20 <gtxy20 at gmail.com> wrote:
> Hello all,
>
> I will be dealing with an address list where I might have the following:
>
> Name SSN
> John 111111111
> John 111111111
> Jane 222222222
> Jill 333333333
>
> What I need to do is parse the address list and then create a unique random
> unidentifiable value for the SSN field

> The unique random value does not have to follow this convention but it needs
> to be unique so that I can relate it back to the original SSN when needed.
> As opposed to using the random module I was thinking that it would be better
> to use either sha or md5. Just curious as to thoughts on the correct
> approach.

How are you relating back to the SSN? Are you keeping a
cross-reference? If so, you might just assign sequence numbers for the
unidentifiable value. If you want the key itself to be convertable
back to the SSN (which wouldn't work with random values) you will need
some cryptography. If you want a unique key that won't collide with
other keys then sha or md5 is a better bet than random.

Kent


More information about the Tutor mailing list