ENCRYPTED FIELD
Fairlight
fairlite at fairlite.com
Wed Oct 28 08:48:25 PDT 2009
On Wed, Oct 28, 2009 at 11:24:35AM -0400, Richard Kreiss may or may not have
proven themselves an utter git by pronouncing:
>
> I have an encrypted field of 20 characters which decrypted would be numbers.
>
> Anyone have an easy way to test the value to see if it is encrypted since
> there is no guarantee that any specific graphics character would be
> present.
>
> Based on the values I am looking at it appears I need to test for characters
> in the following dec ranges:
>
> 1-47
> 58-64
> 92-255
>
> Since numbers can be present, I dont want to test for these as the
> decrypted value is numbers.
>
> Strtok would work to test for values which can be entered from the keyboard.
> It is that range 128 and above which I also would need to test for.
>
> Any suggestions on how to test for those values?
I don't know of an encryption algorithm that would leave all numbers based
on all numeric input. I suppose it's possible, but highly unlikely.
Instead of checking each character to be in one of three ranges, loop to
dlen() of the field, mid()ing off one char further each time. Check to see
if the char -is- numeric. The first time you hit a non-numeric, you've
found it's encrypted, exit loop early. Otherwise, it's 99.999% likely not
encrypted.
mark->
--
Audio panton, cogito singularis,
More information about the Filepro-list
mailing list